|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
portfolioFrontier/Spec: targetReturnList,
I am trying to help a colleague with a question, but I am - by no means - an expert in this area. The output of the portfolioFrontier function in the code below doesn't change for different values of targetReturn and riskFreeRate (in portfolioSpec). I would appreciate if someone could point me to information on why this should be expected or not. Best, Josh require(TTR) require(zoo) suppressMessages(require(fPortfolio)) syms <- c('ABNDX','CAIBX','CWBFX','CWGIX','RYEOX','RYMTX','DBV') X <- getYahooData(syms[1], start=20070601, quiet=TRUE) X <- zoo( X$Close, X$Date ) for(i in 2:NROW(syms)) { print(syms[i]) x <- getYahooData(syms[i], start=20070601, quiet=TRUE) X <- cbind( X, zoo( x$Close, x$Date ) ) } colnames(X) <- syms R <- as.timeSeries(returns(X, percentage = TRUE)) Spec = portfolioSpec(model = list(type = c("MV", "CVaR"), estimator = c("mean", "cov"), tailRisk = list(), params = list()), portfolio = list(weights = NULL, targetReturn = NULL, targetRisk = 4, targetAlpha = 0.05, riskFreeRate = NULL, nFrontierPoints = 50), solver = list(solver = c("quadprog", "Rdonlp2", "lpSolve"), trace = FALSE)) Spec frontier <- portfolioFrontier( R, Spec, c("minW[1:nAssets]=0")) weightsSlider(frontier) > sessionInfo() R version 2.7.0 (2008-04-22) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods [8] base other attached packages: [1] fPortfolio_260.72 fAssets_260.72 fRegression_260.72 fMultivar_260.72 [5] sn_0.4-4 mnormt_1.2-1 fTrading_260.72 polspline_1.0.15 [9] nnet_7.2-42 mgcv_1.3-31 fBasics_260.72 fImport_260.72 [13] fSeries_260.72 fCalendar_262.73 fEcofin_260.72 fUtilities_260.72 [17] spatial_7.2-42 RUnit_0.4.17 robustbase_0.2-8 MASS_7.2-42 [21] lpSolve_5.6.2 quadprog_1.4-11 zoo_1.5-3 TTR_0.14-0 loaded via a namespace (and not attached): Error in x[["Version"]] : subscript out of bounds In addition: Warning message: In FUN(c("grid", "lattice")[[2L]], ...) : DESCRIPTION file of package 'lattice' is missing or broken -- http://quantemplation.blogspot.com _______________________________________________ R-SIG-Finance@... mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. -- If you want to post, subscribe first. |
|
|
Re: portfolioFrontier/Spec: targetReturndear josh as portfolioFrontier seems to trace out the whole frontier of efficient portfolios, i would not expect that changing the targetReturn and the riskFreeRate makes a difference. targetReturn should only be relevant if you look for one specific portfolio, namely the one that minimises some `risk' measure (say, variance) while at the same time satisfying your targetReturn constraint. when you plot the whole frontier, you will get the portfolios for _all_ feasible targetReturns. the riskFreeRate should also not have an impact on the shape of the equity portfolio frontier. all it allows is that you can build linear combinations between the riskless asset and equity portfolios. (the riskless asset will have zero risk and is thus a point on the y-axis which you can connect by a line with any equity portfolio) regards, enrico -----Ursprüngliche Nachricht----- Von: r-sig-finance-bounces@... [mailto:r-sig-finance-bounces@...] Im Auftrag von Josh Ulrich Gesendet: Donnerstag, 8. Mai 2008 21:08 An: R-sig-finance Betreff: [R-SIG-Finance] portfolioFrontier/Spec: targetReturn List, I am trying to help a colleague with a question, but I am - by no means - an expert in this area. The output of the portfolioFrontier function in the code below doesn't change for different values of targetReturn and riskFreeRate (in portfolioSpec). I would appreciate if someone could point me to information on why this should be expected or not. Best, Josh require(TTR) require(zoo) suppressMessages(require(fPortfolio)) syms <- c('ABNDX','CAIBX','CWBFX','CWGIX','RYEOX','RYMTX','DBV') X <- getYahooData(syms[1], start=20070601, quiet=TRUE) X <- zoo( X$Close, X$Date ) for(i in 2:NROW(syms)) { print(syms[i]) x <- getYahooData(syms[i], start=20070601, quiet=TRUE) X <- cbind( X, zoo( x$Close, x$Date ) ) } colnames(X) <- syms R <- as.timeSeries(returns(X, percentage = TRUE)) Spec = portfolioSpec(model = list(type = c("MV", "CVaR"), estimator = c("mean", "cov"), tailRisk = list(), params = list()), portfolio = list(weights = NULL, targetReturn = NULL, targetRisk = 4, targetAlpha = 0.05, riskFreeRate = NULL, nFrontierPoints = 50), solver = list(solver = c("quadprog", "Rdonlp2", "lpSolve"), trace = FALSE)) Spec frontier <- portfolioFrontier( R, Spec, c("minW[1:nAssets]=0")) weightsSlider(frontier) > sessionInfo() R version 2.7.0 (2008-04-22) i386-pc-mingw32 locale: LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252 attached base packages: [1] tcltk stats graphics grDevices utils datasets methods [8] base other attached packages: [1] fPortfolio_260.72 fAssets_260.72 fRegression_260.72 fMultivar_260.72 [5] sn_0.4-4 mnormt_1.2-1 fTrading_260.72 polspline_1.0.15 [9] nnet_7.2-42 mgcv_1.3-31 fBasics_260.72 fImport_260.72 [13] fSeries_260.72 fCalendar_262.73 fEcofin_260.72 fUtilities_260.72 [17] spatial_7.2-42 RUnit_0.4.17 robustbase_0.2-8 MASS_7.2-42 [21] lpSolve_5.6.2 quadprog_1.4-11 zoo_1.5-3 TTR_0.14-0 loaded via a namespace (and not attached): Error in x[["Version"]] : subscript out of bounds In addition: Warning message: In FUN(c("grid", "lattice")[[2L]], ...) : DESCRIPTION file of package 'lattice' is missing or broken -- http://quantemplation.blogspot.com _______________________________________________ R-SIG-Finance@... mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. -- If you want to post, subscribe first. No virus found in this incoming message. Checked by AVG. 07.05.2008 17:23 Checked by AVG. 08.05.2008 17:24 _______________________________________________ R-SIG-Finance@... mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. -- If you want to post, subscribe first. |
| Free Forum Powered by Nabble | Forum Help |