[Returnanalytics-commits] r2024 - pkg/PerformanceAnalytics/sandbox/Meucci/demo

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jun 17 10:20:53 CEST 2012


Author: mkshah
Date: 2012-06-17 10:20:53 +0200 (Sun, 17 Jun 2012)
New Revision: 2024

Modified:
   pkg/PerformanceAnalytics/sandbox/Meucci/demo/RankingInformation.R
Log:
Adding StackedBarChart function for PosteriorFrontier

Modified: pkg/PerformanceAnalytics/sandbox/Meucci/demo/RankingInformation.R
===================================================================
--- pkg/PerformanceAnalytics/sandbox/Meucci/demo/RankingInformation.R	2012-06-17 08:13:38 UTC (rev 2023)
+++ pkg/PerformanceAnalytics/sandbox/Meucci/demo/RankingInformation.R	2012-06-17 08:20:53 UTC (rev 2024)
@@ -73,6 +73,13 @@
 plot( x = (frontierPosterior$Sdev)^2 , y = frontierPosterior$e , xlab = "Variance" , ylab = "Expected Return" , main = "Posterior" , type = "l" , ylim = c( .03 , .1 ) )
 # PlotResults( frontierPosterior$e , frontierPosterior$Sdev , frontierPosterior$Composition , frontierPosterior$Exps , Lower , Upper )
 
+# bar chart of portfolios on frontier
+options( warn = 0 )
+library( ggplot2 )
+plotStackedBar <- StackedBarChart( frontierPosterior$Composition )
+plotStackedBar
+options( warn = 2 )
+
 # Tests
 # Test1 - views that are already in the prior return no revision
 result  = ViewRanking( X , P , c(3,3) , c(4,4) ) # none of the probabilities are revised from 1e-05. Why? Because the expectation that asset 3 is lower than expected return of asset 4 is already satisfied in prior



More information about the Returnanalytics-commits mailing list