[Returnanalytics-commits] r3525 - pkg/PerformanceAnalytics/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Sep 6 00:17:42 CEST 2014


Author: bodanker
Date: 2014-09-06 00:17:42 +0200 (Sat, 06 Sep 2014)
New Revision: 3525

Modified:
   pkg/PerformanceAnalytics/R/VaR.R
Log:
- Fix error in reasonableness check when tmp is not finite


Modified: pkg/PerformanceAnalytics/R/VaR.R
===================================================================
--- pkg/PerformanceAnalytics/R/VaR.R	2014-09-04 10:12:27 UTC (rev 3524)
+++ pkg/PerformanceAnalytics/R/VaR.R	2014-09-05 22:17:42 UTC (rev 3525)
@@ -217,6 +217,8 @@
             columns<-ncol(rVaR)
             for(column in 1:columns) {
                 tmp=rVaR[,column]
+                if (!is.finite(tmp)) # skip reasonableness check if tmp is NA, NaN, +/-Inf, etc
+                    next()
                 if (eval(tmp < 0)) { #eval added previously to get around Sweave bitching
                     message(c("VaR calculation produces unreliable result (inverse risk) for column: ",column," : ",rVaR[,column]))
                     # set VaR to NA, since inverse risk is unreasonable



More information about the Returnanalytics-commits mailing list