[R-SIG-Finance] (no subject)
francesco.citta at gmail.com
francesco.citta at gmail.com
Mon Jun 26 16:09:58 CEST 2017
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]]
More information about the R-SIG-Finance
mailing list