Skip to content

fPortfolio Inputs as List - Error Msg

4 messages · Bastian Offermann, Brian G. Peterson, Martin Becker

#
Hello,

I am trying to use flexible inputs for an unconstrained Markowitz 
optimization using the fPortfolio package.

The documentation says

*"a time series or a named list, containing either a series of returns 
or named
entries ?mu? and ?Sigma? being mean and covariance matrix." *

is required as inputs. However, when supplying a list containing mu and 
sigma I get the following error

*Error: class(data) == "timeSeries" is not TRUE

r.p <- 0.05
Spec <- portfolioSpec()
setType(Spec) <- "MV"
cons <- "Short"
setOptimize(Spec) <- "minRisk"
setTargetReturn(Spec) <- r.p/52
setNFrontierPoints(Spec) <- 10
setSolver(Spec) <- "solveRshortExact"

mu <- c(0.0002884615, 0.0007085510)
covar <- matrix(c(0.0002536010, 0.0001704248, 0.0001704248, 
0.0007122588), 2, 2)

Data1 <- list(mu, covar)

eff.front1 <- portfolioFrontier(data = Data1, spec = Spec, constraints = 
cons)

*Any input appreciated. Thanks in advance.

Regards

BO
#
Nobody? Thanks.

Bastian Offermann schrieb:
#
Bastian Offermann wrote:
Please post both your code and the data you are using to replicate your 
problem.  If you provide data in addition to the commands you tried, per the 
list posting guidelines, it is much easier for someone else to replicate your 
problem.

Regards,

    - Brian
#
Bastian Offermann wrote:
Which documentation? What version of fPortfolio? I don't see this 
documentation fragment on ?portfolioFrontier for 280.74.
(Besides, Data1 [as defined below] is not a list with named entries ?mu? 
and ?Sigma?.)

Regards,

  Martin