[Returnanalytics-commits] r1931 - pkg/PortfolioAnalytics/sandbox

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Apr 29 23:44:15 CEST 2012


Author: braverock
Date: 2012-04-29 23:44:15 +0200 (Sun, 29 Apr 2012)
New Revision: 1931

Modified:
   pkg/PortfolioAnalytics/sandbox/script.workshop2012.R
Log:
- sum the output of pasd.garch, needs to be univariate to go into the objective

Modified: pkg/PortfolioAnalytics/sandbox/script.workshop2012.R
===================================================================
--- pkg/PortfolioAnalytics/sandbox/script.workshop2012.R	2012-04-29 18:46:03 UTC (rev 1930)
+++ pkg/PortfolioAnalytics/sandbox/script.workshop2012.R	2012-04-29 21:44:15 UTC (rev 1931)
@@ -194,9 +194,9 @@
 }
 
 pasd.garch<- function(R,weights,garch.sigma,...) {
-    #sigmas is an input of predicted sigmas on a date, 
-    # presumably from a GARCH model
-    as.numeric((garch.sigma[last(index(R)),]*weights)*sqrt(12))
+	#sigmas is an input of predicted sigmas on a date, 
+	# presumably from a GARCH model
+	as.numeric(sum((garch.sigma[last(index(R)),]*weights)*sqrt(12)))
 }
 
 ## Apply multi-factor model



More information about the Returnanalytics-commits mailing list