Try this example: > library(fPortfolio) > returnData <- 100 * LPP2005.RET[, 1:6] > portfSpec <- portfolioSpec() > setNFrontierPoints(portfSpec) <- 5 > longFrontier <- portfolioFrontier(returnData, portfSpec) > longFrontier@portfolio
The portfolio slot has all the information you are looking for Alain -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Vishal Belsare Sent: Monday, February 28, 2011 3:40 PM To: [email protected] 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 _______________________________________________ [email protected] 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}} _______________________________________________ [email protected] 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.
