[R-SIG-Finance] fPortfolio, frontierSlider, weightsSlider
John P. Burkett
burkett at uri.edu
Fri Jul 31 19:59:36 CEST 2009
Brian G. Peterson wrote:
> John P. Burkett wrote:
>> The package fPortfolio, when I used it a year ago, included a
function frontierSlider, which worked well for me. Judging by the April
20, 2009 reference manual for fPortfolio, the old frontierSlider
function has been replaced by a new weightsSlider function.
>> My attempt to follow the example on p. 57 of the reference manual
goes as follows:
>> > Data = SMALLCAP.RET
>> > Data = Data[, c("BKE", "GG", "GYMB", "KRON")]
>> > frontier = portfolioFrontier(Data)
>> > weightsSlider(frontier)
>> Error in getTargetRisk(object)[, 1] : incorrect number of dimensions
>> My attempts to use weightsSlider with my own data end with the same
>> Can anyone diagnosis the error message and/or suggest how to produce
an interactive portfolio weights plot?
> Here's how to diagnose the problem and gather more information to
share with the list:
> step through the function,
> examine what it is doing. Go all the way to the failure point once.
> Do it again, but this time pay attention as you get close to the
failure point. Collect data to share here on the data being passed into
the bit (getTargetRisk) that fails.
> Examine what the getTargetRisk function normally expects.
Thank you, Brian, for your good suggestions. My attempt to use debug and
the results are as follows:
debugging in: weightsSlider(frontier)
object <<- object
nFrontierPoints <- length(getTargetRisk(object)[, 1])
dim = dim(getWeights(object))
starts = c(Start))
debug: object <<- object
debug: nFrontierPoints <- length(getTargetRisk(object)[, 1])
Error in getTargetRisk(object)[, 1] : incorrect number of dimensions
Trying to learn what the getTargetRisk function normally expect, I did
eliciting the following response:
getDefault package:fPortfolio R Documentation
Extractor functions to get information from objects of class
fPFOLIODATA, fPFOLIOSPEC, fPFOLIODATA, fPFOLIOVAL, and fPORTFOLIO.
object: an object of class 'fPFOLIODATA', 'fPFOLIOSPEC' or
...: optional arguments to be passed.
Doing "getTargetRisk" got this response:
I'd be grateful for help in interpreting the above results and/or
suggestions for obtaining more information.
John P. Burkett
Department of Economics
University of Rhode Island
Kingston, RI 02881-0808
phone (401) 874-9195
More information about the R-SIG-Finance