[R-SIG-Finance] fPortfolio: Extracting Weight Vectors for FrontierPoints?
Ledon, Alain - Eqty NY
alain.ledonwong at baml.com
Mon Feb 28 22:25:40 CET 2011
Try this example:
> library(fPortfolio)
> returnData <- 100 * LPP2005.RET[, 1:6]
> portfSpec <- portfolioSpec()
> setNFrontierPoints(portfSpec) <- 5
> longFrontier <- portfolioFrontier(returnData, portfSpec)
> longFrontier at portfolio
The portfolio slot has all the information you are looking for
Alain
-----Original Message-----
From: r-sig-finance-bounces at r-project.org
[mailto:r-sig-finance-bounces at r-project.org] On Behalf Of Vishal Belsare
Sent: Monday, February 28, 2011 3:40 PM
To: r-sig-finance at r-project.org
Subject: [R-SIG-Finance] fPortfolio: Extracting Weight Vectors for
FrontierPoints?
Experimenting with the fPortfolio package, and computing the frontier
using some asset returns, a portfolio specification and some
constraints, I save that to an object, presumably of fPortfolio class.
I can print it,
summarize it, and plot it. However, I cannot figure out how to EXTRACT
the weight assigned to each asset on the many frontier points. If I
set the number of frontier points to compute at 50, the print and
summary will show only 5.
The 'getWeights' method will show only one vector and I don't know
which point it is for. Can you please enlighten about how to extract
the weight vector when there are say, 50 or 100 frontier points we
have computedr? I went through the the documentation for fPortfolio,
fAssets and other packages, but they don't have any information about
this.
The information is definitely in the object because I can plot the
weights across the assets in the risk-return space. I want to get
something like, a list of weight vectors, each vector corresponding to
the 'n' frontier points.
Thanks,
Vishal Belsare
_______________________________________________
R-SIG-Finance at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions
should go.
----------------------------------------------------------------------
This message w/attachments (message) is intended solely ...{{dropped:7}}
More information about the R-SIG-Finance
mailing list