[R-SIG-Finance] fPortfolio Inputs as List - Error Msg
Bastian Offermann
bastian2507hk at yahoo.co.uk
Wed Jan 14 03:28:17 CET 2009
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
More information about the R-SIG-Finance
mailing list