Hello, I found a problem when I tried to use the "maxreturnPortfolio" function of fPortfolio's package (3011.78 version) after setting a target risk. This is my code: defaultSpec=portfolioSpec() setOptimize(defaultSpec)="risk" setTargetRisk(defaultSpec)=0.3 lppData=100*LPP2005.RET defaultData=portfolioData(lppData,spec=defaultSpec) maxReturn=maxreturnPortfolio(defaultData,spec = defaultSpec,constraints = "LongOnly") print(maxReturn)
The output is: Title: MV Return Maximized Efficient Portfolio Estimator: covEstimator Solver: solveRquadprog Optimize: maxReturn Constraints: LongOnly Portfolio Weights: SBI SPI SII LMI MPI ALT 0.3555 0.0000 0.0890 0.4893 0.0026 0.0636 Covariance Risk Budgets: SBI SPI SII LMI MPI ALT 0.3555 0.0000 0.0890 0.4893 0.0026 0.0636 Target Returns and Risks: mean Cov CVaR VaR 0.0105 0.0986 0.2020 0.1558 The Target Risk (0.3) is different than optimized risk (0.0986) and the portfolio weitghts are the same of the min risk problem. For this target volatility I will expect a return near 0.05. I tried to change the solver (setSolver(defaultSpec)="solveRsocp") but I obtained this error message: Error in as.vector(data) : no method for coercing this S4 class to a vector Can you help me? Thanks Francesco Citta [[alternative HTML version deleted]] _______________________________________________ R-SIG-Finance@r-project.org 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.