[R-SIG-Finance] Static Portfolio Optimization
Dirk Eddelbuettel
edd at debian.org
Thu Oct 1 22:40:45 CEST 2009
On 1 October 2009 at 15:25, Dirk Eddelbuettel wrote:
| Correct -- the tseries package has done since time immportal.
Oops: "... has done this since time immortal" is what I meant. Someone
please write semantic and syntactic checker for Emacs....
Sorry, Dirk
| And some seven or eight years ago I sent Adrian a patch, styled after the
| discussion in Huang and Litzenberger, that adds the ability to have long and
| short positions.
|
| Which Adrian promptly added and which has been there ever since:
|
| R> head(as.zoo(EuStockMarkets))
| DAX SMI CAC FTSE
| 1991(130) 1629 1678 1773 2444
| 1991(131) 1614 1688 1750 2460
| 1991(132) 1607 1679 1718 2448
| 1991(133) 1621 1684 1708 2470
| 1991(134) 1618 1687 1723 2485
| 1991(135) 1611 1672 1714 2467
| R> X <- diff(log(as.zoo(EuStockMarkets)))
| R> res <- portfolio.optim(X) ## Long only
| R> res$pw
| [1] 0.0000 0.3958 0.0000 0.6042
| R> res <- portfolio.optim(X, shorts=TRUE) ## Long/Short
| R> res$pw
| [1] 0.02550 0.38213 -0.06377 0.65614
| R>
|
| This is arguably a better example than the one in help(portfolio.optim) so
| maybe I should send Kurt a new patch :)
|
| Dirk
|
| --
| Three out of two people have difficulties with fractions.
|
| _______________________________________________
| 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.
--
Three out of two people have difficulties with fractions.
More information about the R-SIG-Finance
mailing list