[Vinecopula-commits] r92 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Di Mär 31 14:15:11 CEST 2015


Author: tnagler
Date: 2015-03-31 14:15:11 +0200 (Tue, 31 Mar 2015)
New Revision: 92

Modified:
   pkg/R/BiCopEst.r
   pkg/R/BiCopSelect.r
Log:
fixed issue in MLE_intern where optim returns an error ('non-finite value supplied'); set lower bound of likelihood to -10^250 instead of -10^300

Modified: pkg/R/BiCopEst.r
===================================================================
--- pkg/R/BiCopEst.r	2015-03-30 18:36:33 UTC (rev 91)
+++ pkg/R/BiCopEst.r	2015-03-31 12:15:11 UTC (rev 92)
@@ -473,8 +473,8 @@
                          PACKAGE = "VineCopula")[[7]] %*% weights
             }
             
-            if (is.infinite(ll) || is.na(ll) || ll < -10^300) 
-                ll <- -10^300
+            if (is.infinite(ll) || is.na(ll) || ll < -10^250) 
+                ll <- -10^250
             
             return(ll)
         }
@@ -643,10 +643,10 @@
                              as.double(rep(0, n)), 
                              PACKAGE = "VineCopula")[[7]] %*% weights
                 }
+
+                if (is.infinite(ll) || is.na(ll) || ll < -10^250) 
+                    ll <- -10^250
                 
-                if (is.infinite(ll) || is.na(ll) || ll < -10^300) 
-                    ll <- -10^300
-                
                 return(ll)
             }
             
@@ -712,8 +712,8 @@
                          as.double(rep(0, n)), 
                          PACKAGE = "VineCopula")[[7]] %*% weights
             }
-            if (is.infinite(ll) || is.na(ll) || ll < -10^300) 
-                ll <- -10^300
+            if (is.infinite(ll) || is.na(ll) || ll < -10^250) 
+                ll <- -10^250
             
             return(ll)
         }

Modified: pkg/R/BiCopSelect.r
===================================================================
--- pkg/R/BiCopSelect.r	2015-03-30 18:36:33 UTC (rev 91)
+++ pkg/R/BiCopSelect.r	2015-03-31 12:15:11 UTC (rev 92)
@@ -1,5 +1,4 @@
 BiCopSelect <- function(u1, u2, familyset = NA, selectioncrit = "AIC", indeptest = FALSE, level = 0.05, weights = NA, rotations = TRUE) {
-    
     ## sanity checks
     if (is.null(u1) == TRUE || is.null(u2) == TRUE) 
         stop("u1 and/or u2 are not set or have length zero.")
@@ -31,9 +30,9 @@
     data2 <- u2
     
     ## adjust familyset if rotations = TRUE
-    if (rotations) familyset <- with_rotations(familyset)
+    if (rotations) 
+        familyset <- with_rotations(familyset)
     
-    
     if (!is.na(familyset[1]) & any(familyset == 0)) {
         # select independence if allowed
         out$p.value.indeptest <- NA



Mehr Informationen über die Mailingliste Vinecopula-commits