[Returnanalytics-commits] r3689 - pkg/Dowd/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jun 22 14:41:03 CEST 2015


Author: dacharya
Date: 2015-06-22 14:41:03 +0200 (Mon, 22 Jun 2015)
New Revision: 3689

Modified:
   pkg/Dowd/R/BootstrapES.R
   pkg/Dowd/R/BootstrapESConfInterval.R
   pkg/Dowd/R/BootstrapESFigure.R
   pkg/Dowd/R/BootstrapVaR.R
   pkg/Dowd/R/BootstrapVaRConfInterval.R
   pkg/Dowd/R/BootstrapVaRFigure.R
Log:
"error" of MATLAB code was changed to "stop" in R.

Modified: pkg/Dowd/R/BootstrapES.R
===================================================================
--- pkg/Dowd/R/BootstrapES.R	2015-06-22 12:34:44 UTC (rev 3688)
+++ pkg/Dowd/R/BootstrapES.R	2015-06-22 12:41:03 UTC (rev 3689)
@@ -23,10 +23,10 @@
 BootstrapES <- function(Ra, number.resamples, cl){
   
   if (nargs() < 3){
-    error("Too few arguments")
+    stop("Too few arguments")
   }
   if (nargs() > 3){
-    error("Too many arguments")
+    stop("Too many arguments")
   }
   
   profit.loss.data <- as.vector(Ra)
@@ -37,10 +37,10 @@
   
   # Check that inputs have correct dimensions
   if (length(cl) != 1) {
-    error("Confidence level must be a scalar")
+    stop("Confidence level must be a scalar")
   }
   if (length(number.resamples) != 1){
-    error("Number of resamples must be a scalar");
+    stop("Number of resamples must be a scalar");
   }
   
   # Check that inputs obey sign and value restrictions

Modified: pkg/Dowd/R/BootstrapESConfInterval.R
===================================================================
--- pkg/Dowd/R/BootstrapESConfInterval.R	2015-06-22 12:34:44 UTC (rev 3688)
+++ pkg/Dowd/R/BootstrapESConfInterval.R	2015-06-22 12:41:03 UTC (rev 3689)
@@ -42,10 +42,10 @@
   
   # Check that inputs have correct dimensions
   if (is.vector(cl) & (length(cl) != 1) ) {
-    error("Confidence level must be a scalar")
+    stop("Confidence level must be a scalar")
   }
   if (length(number.resamples) != 1) {
-    error("Number of resamples must be a scalar")
+    stop("Number of resamples must be a scalar")
   }
   # Check that inputs obey sign and value restrictions
   if (cl >= 1){

Modified: pkg/Dowd/R/BootstrapESFigure.R
===================================================================
--- pkg/Dowd/R/BootstrapESFigure.R	2015-06-22 12:34:44 UTC (rev 3688)
+++ pkg/Dowd/R/BootstrapESFigure.R	2015-06-22 12:41:03 UTC (rev 3689)
@@ -41,10 +41,10 @@
   
   # Check that inputs have correct dimensions
   if (is.vector(cl) & (length(cl) != 1) ) {
-    error("Confidence level must be a scalar")
+    stop("Confidence level must be a scalar")
   }
   if (length(number.resamples) != 1) {
-    error("Number of resamples must be a scalar")
+    stop("Number of resamples must be a scalar")
   }
   # Check that inputs obey sign and value restrictions
   if (cl >= 1){

Modified: pkg/Dowd/R/BootstrapVaR.R
===================================================================
--- pkg/Dowd/R/BootstrapVaR.R	2015-06-22 12:34:44 UTC (rev 3688)
+++ pkg/Dowd/R/BootstrapVaR.R	2015-06-22 12:41:03 UTC (rev 3689)
@@ -23,10 +23,10 @@
 BootstrapVaR <- function(Ra, number.resamples, cl){
   
   if (nargs() < 3){
-    error("Too few arguments")
+    stop("Too few arguments")
   }
   if (nargs() > 3){
-    error("Too many arguments")
+    stop("Too many arguments")
   }
   
   profit.loss.data <- as.vector(Ra)
@@ -37,10 +37,10 @@
   
   # Check that inputs have correct dimensions
   if (length(cl) != 1) {
-    error("Confidence level must be a scalar")
+    stop("Confidence level must be a scalar")
   }
   if (length(number.resamples) != 1){
-    error("Number of resamples must be a scalar");
+    stop("Number of resamples must be a scalar");
   }
   
   # Check that inputs obey sign and value restrictions

Modified: pkg/Dowd/R/BootstrapVaRConfInterval.R
===================================================================
--- pkg/Dowd/R/BootstrapVaRConfInterval.R	2015-06-22 12:34:44 UTC (rev 3688)
+++ pkg/Dowd/R/BootstrapVaRConfInterval.R	2015-06-22 12:41:03 UTC (rev 3689)
@@ -42,10 +42,10 @@
   
   # Check that inputs have correct dimensions
   if (is.vector(cl) & (length(cl) != 1) ) {
-    error("Confidence level must be a scalar")
+    stop("Confidence level must be a scalar")
   }
   if (length(number.resamples) != 1) {
-    error("Number of resamples must be a scalar")
+    stop("Number of resamples must be a scalar")
   }
   # Check that inputs obey sign and value restrictions
   if (cl >= 1){

Modified: pkg/Dowd/R/BootstrapVaRFigure.R
===================================================================
--- pkg/Dowd/R/BootstrapVaRFigure.R	2015-06-22 12:34:44 UTC (rev 3688)
+++ pkg/Dowd/R/BootstrapVaRFigure.R	2015-06-22 12:41:03 UTC (rev 3689)
@@ -40,10 +40,10 @@
   
   # Check that inputs have correct dimensions
   if (is.vector(cl) & (length(cl) != 1) ) {
-    error("Confidence level must be a scalar")
+    stop("Confidence level must be a scalar")
   }
   if (length(number.resamples) != 1) {
-    error("Number of resamples must be a scalar")
+    stop("Number of resamples must be a scalar")
   }
   # Check that inputs obey sign and value restrictions
   if (cl >= 1){



More information about the Returnanalytics-commits mailing list