[Returnanalytics-commits] r2913 - pkg/PortfolioAnalytics/sandbox
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Aug 28 03:01:39 CEST 2013
Author: rossbennett34
Date: 2013-08-28 03:01:39 +0200 (Wed, 28 Aug 2013)
New Revision: 2913
Modified:
pkg/PortfolioAnalytics/sandbox/testing_efficient_frontier.R
Log:
Modifying testing_efficient_frontier to include print and summary methods.
Modified: pkg/PortfolioAnalytics/sandbox/testing_efficient_frontier.R
===================================================================
--- pkg/PortfolioAnalytics/sandbox/testing_efficient_frontier.R 2013-08-28 00:16:36 UTC (rev 2912)
+++ pkg/PortfolioAnalytics/sandbox/testing_efficient_frontier.R 2013-08-28 01:01:39 UTC (rev 2913)
@@ -37,6 +37,8 @@
# mean-var efficient frontier
meanvar.ef <- create.EfficientFrontier(R=R, portfolio=meanvar.portf, type="mean-StdDev")
+print(meanvar.ef)
+summary(meanvar.ef)
chart.EfficientFrontier(meanvar.ef, match.col="StdDev", type="b")
chart.EfficientFrontier(meanvar.ef, match.col="StdDev", type="l", rf=0)
chart.Weights.EF(meanvar.ef, colorset=bluemono, match.col="StdDev")
@@ -49,10 +51,13 @@
chart.Weights.EF(opt_meanvar, match.col="StdDev")
# or we can extract the efficient frontier and then plot it
ef <- extractEfficientFrontier(object=opt_meanvar, match.col="StdDev", n.portfolios=15)
+print(ef)
chart.Weights.EF(ef, match.col="StdDev", colorset=bluemono)
# mean-etl efficient frontier
meanetl.ef <- create.EfficientFrontier(R=R, portfolio=meanetl.portf, type="mean-ES")
+print(meanetl.ef)
+summary(meanetl.ef)
chart.EfficientFrontier(meanetl.ef, match.col="ES", main="mean-ETL Efficient Frontier", type="l", col="blue")
chart.Weights.EF(meanetl.ef, colorset=bluemono, match.col="ES")
@@ -92,6 +97,3 @@
chart.EfficientFrontierOverlay(R=R, portfolio_list=portf.list, type="mean-StdDev", match.col="StdDev",
legend.loc="right", legend.labels=legend.labels)
-# TODO add the following methods for objects of class efficient.frontier
-# - print
-# - summary
More information about the Returnanalytics-commits
mailing list