[R-SIG-Finance] fPortfolio - SOCP not available?
Diethelm Wuertz
wuertz at itp.phys.ethz.ch
Thu Apr 22 00:50:04 CEST 2010
Heiko Mayer wrote:
> Hi,
>
> I have tried to use the maxreturnPortfolio Function in fPortfolio using the
> Rsocp solver. According to the ebook "Portfolio Optimization with
> R/Rmetrics", Rsocp is the preferred solver for that function. It appears to
> me that this solver is not installed (yet?)
>
> require(fPortfolio)
> lppData=100*LPP2005.RET[,1:6]
> maxRetSpec=portfolioSpec()
> setTargetRisk(maxRetSpec)=0.07
> setSolver(maxRetSpec)=solveRsocp
> maxreturnPortfolio(data=lppData, spec = maxRetSpec, constraints =
> "LongOnly")
>
Try
require(fPortfolio)
require(fPortfolioSolver)
lppData=100*LPP2005.RET[,1:6]
maxRetSpec=portfolioSpec()
setTargetRisk(maxRetSpec)=0.07
setSolver(maxRetSpec)="solveRsocp"
efficientPortfolio(data=lppData, spec=maxRetSpec, constraints="LongOnly")
Title:
MV Efficient Portfolio
Estimator: covEstimator
Solver: solveRsocp
Optimize: maxReturn
Constraints: LongOnly
Portfolio Weights:
SBI SPI SII LMI MPI ALT
0.0000 0.0002 0.0833 0.2626 0.0000 0.1104
Covariance Risk Budgets:
SBI SPI SII LMI MPI ALT
0.0000 0.0014 0.1539 0.1124 0.0000 0.7324
Target Return and Risks:
mean mu Cov Sigma CVaR VaR
0.0129 0.0129 0.0700 0.0700 0.1413 0.0978
Description:
Thu Apr 22 00:46:10 2010 by user: Rmetrics
Have you heard from the Meielisalp Workhop?
Register at: www.rmetrics.org
regards
Diethelm Wuertz
> Using the code above, I am getting an error that solveRsocp is not known. I
> have searched RForge and found the Rsocp::socp code. However, I was not
> able to find any examples or manual. Has anybody used Rsocp so far and
> could give me hint how to use it?
>
> Thanks,
> Heiko
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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.
> -- Also note that this is not the r-help list where general R questions should go.
More information about the R-SIG-Finance
mailing list