[R-SIG-Finance] fPortfolio Inputs as List - Error Msg

Martin Becker martin.becker at mx.uni-saarland.de
Thu Jan 15 09:44:43 CET 2009


Bastian Offermann wrote:
> 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." *
>
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

> 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
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.


-- 
Dr. Martin Becker
Statistics and Econometrics
Saarland University
Campus C3 1, Room 206
66123 Saarbruecken
Germany



More information about the R-SIG-Finance mailing list