[R-SIG-Finance] Portfolio Optimization with tawny package
Brian Lee Yung Rowe
rowe at muxspace.com
Tue Oct 15 13:39:26 CEST 2013
Eric:
The best way to use an alternate optimizer over the default is to take the denoised correlation matrix and pass it to another optimizer.
p <- TawnyPortfolio(h, 90)
ws.2 <- denoise(p, RandomMatrixDenoiser())
The focus of tawny is really on cleaning covariance and correlation matrices, so I've only included a very basic optimization method. I am working on some improvements to the package, and most of the enhancements are tied to improving and generalizing the implementations for shrinkage and random matrix theory, along with better analysis tools and integration with simulated time series. (If you have any requests, feel free to let me know.)
As for portfolio optimization, the fPortfolio package used to offer numerous techniques, although I'm not sure where the state of the art is these days. You can always roll your own and implement an optimizer with linear or quadratic programming that has the constraints you are looking for.
Warm Regards,
Brian
On Oct 14, 2013, at 10:31 PM, Eric Thungstom <eric.thungstrom at gmail.com> wrote:
> I'm just starting to use the tawny to do portfolio optimization. I;m
> wondering if there is a way to force the optimization to not allow short
> selling. If I use the package example:
>
> require(tawny)
> data(sp500.subset)
> h <- sp500.subset
> ws.1 <-optimizePortfolio(h, 150, RandomMatrixDenoiser())
>
>
> head(ws.1[,1:5])
> [,1] [,2] [,3] [,4] [,5]
> 2008-12-15 0.09248187 0.2088942 -0.0028581226 -0.05568185 -0.011270020
> 2008-12-16 0.09312921 0.2184338 -0.0041928798 -0.05388050 -0.007905639
> 2008-12-17 0.09697907 0.2152621 0.0004219331 -0.05719625 -0.007520671
> 2008-12-18 0.10532884 0.2226241 -0.0004360120 -0.05933589 -0.008948998
> 2008-12-19 0.10566713 0.2241632 -0.0001421756 -0.05808452 -0.008664915
> 2008-12-22 0.10716821 0.2256598 0.0020645245 -0.05588680 -0.005201937
>
> Npte some of the portfolio weights are negative implying short selling.
>
> The package works great but not sure how I could determine the optimum
> portfolio given a "no short selling" criteria.
>
> Thanks in advance for your comments
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at 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.
More information about the R-SIG-Finance
mailing list