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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 25 02:16:30 CEST 2012


Author: peter_carl
Date: 2012-04-25 02:16:30 +0200 (Wed, 25 Apr 2012)
New Revision: 1909

Modified:
   pkg/PortfolioAnalytics/sandbox/script.workshop2012.R
Log:
- added pameanLCL for forecasting

Modified: pkg/PortfolioAnalytics/sandbox/script.workshop2012.R
===================================================================
--- pkg/PortfolioAnalytics/sandbox/script.workshop2012.R	2012-04-24 02:48:22 UTC (rev 1908)
+++ pkg/PortfolioAnalytics/sandbox/script.workshop2012.R	2012-04-25 00:16:30 UTC (rev 1909)
@@ -125,6 +125,9 @@
 pamean <- function(n=12, R, weights, geometric=TRUE)
 { as.vector(sum(Return.annualized(last(R,n), geometric=geometric)*weights)) }
 
+pameanLCL <- function(n=36, R, weights, scale=12)
+{ as.vector(sum( scale*mean.LCL(last(R,n))*weights)) }
+
 paEMA <- function(n=10, R, weights, ...)
 {# call Exponential Moving Average from TTR, return the last observation
   sum((12*last(apply(R,2,FUN=TTR::EMA,n=n)))*weights)



More information about the Returnanalytics-commits mailing list