[R-SIG-Finance] [R-sig-finance] Newbie Question: Portfolio Optimization with MV, LPM and CVaR constraints
jon.wanxian at gmail.com
Fri Sep 11 13:59:13 CEST 2009
I'd start of by apologizing if the following has been answered in previous
discussions or materials, so far my searches haven't been resourceful.
I have a project on portfolio optimization to track performances of
portfolios created under different constraints (mean-variance, LPM, VaR and
CVaR). I've used monthly data (for 12 years) for a couple of shares, and I
stumbled on fPortfolio which I've been trying out for the last 2 weeks.
I'm having trouble figuring out a couple of things.
1. Is it possible for fPortfolio to optimize a portfolio constrained by the
2. Would it be possible to use the first 10 years of my data to optimize the
portfolios and track performances at 6 months, 1 year and 2 years after
3. I'm having some trouble with the LPM method of optimization. It's
spitting out the error below, but only on monthly data, it works fine with
Here's my codes:
data <- timeSeries(dataset)
data <- returns(data, type = "continuous")
mvspec = portfolioSpec()
lpmspec = portfolioSpec()
setEstimator(lpmspec) <- "lpmEstimator"
setType(lpmspec) <- "QLPM"
lpmspec at model$param$a <- 2
lpmspec at model$param$tau <- "colMeans"
cvarspec = portfolioSpec()
setType(cvarspec) = "CVaR"
setAlpha(cvarspec) = 0.05
setSolver(cvarspec) = "solveRsymphony"
which is spitting out the following error:
The maximum ratio portfolio could not be computed.
Your portfolio constraints may be too restrictive.
status=2 from solver solveRquadprog.
returned from Rmetrics
In addition: There were 15 warnings (use warnings() to see them)
However, it works on weekly data..?
weeklydata <- timeSeries(dataset2)
Monthly: http://www.nabble.com/file/p25398920/Portfolio1.csv Portfolio1.csv
Weekly: http://www.nabble.com/file/p25398920/weeklydata.csv weeklydata.csv
If anyone is able to point me in the right direction, I'd be extremely
View this message in context: http://www.nabble.com/Newbie-Question%3A-Portfolio-Optimization-with-MV%2C-LPM-and-CVaR-constraints-tp25398920p25398920.html
Sent from the Rmetrics mailing list archive at Nabble.com.
More information about the R-SIG-Finance