[Yuima-commits] r719 - in pkg/yuima: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 5 17:24:47 CET 2020


Author: iacus
Date: 2020-02-05 17:24:46 +0100 (Wed, 05 Feb 2020)
New Revision: 719

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/R/lasso.R
Log:
fixed array problem

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2020-02-05 15:22:28 UTC (rev 718)
+++ pkg/yuima/DESCRIPTION	2020-02-05 16:24:46 UTC (rev 719)
@@ -1,7 +1,7 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project Package for SDEs
-Version: 1.9.5
+Version: 1.9.6
 Depends: R(>= 2.10.0), methods, zoo, stats4, utils, expm, cubature,
         mvtnorm
 Imports: Rcpp (>= 0.12.1), boot (>= 1.3-2), glassoFast

Modified: pkg/yuima/R/lasso.R
===================================================================
--- pkg/yuima/R/lasso.R	2020-02-05 15:22:28 UTC (rev 718)
+++ pkg/yuima/R/lasso.R	2020-02-05 16:24:46 UTC (rev 719)
@@ -25,7 +25,7 @@
     fail <- lapply(lambda0, function(x) as.numeric(NA))
     cat("\nLooking for MLE estimates...\n")
     fit <- try(qmle(yuima, start = start, ...), silent = TRUE)
-    if (class(fit) == "try-error"){
+    if (class(fit)[1] == "try-error"){
       tmp <- list(mle = fail, sd.mle = NA, lasso = fail, sd.lasso = NA)
       class(tmp) <- "yuima.lasso"
       return(tmp)
@@ -32,7 +32,7 @@
     }
     theta.mle <- coef(fit)
     SIGMA <- try(sqrt(diag(vcov(fit))), silent = TRUE)
-    if (class(SIGMA) == "try-error"){
+    if (class(SIGMA)[1] == "try-error"){
      tmp <- list(mle = theta.mle, sd.mle = NA, lasso = fail, sd.lasso = NA)
      class(tmp) <- "yuima.lasso"
      return(tmp)
@@ -39,7 +39,7 @@
     }
 
     H <- try(solve(vcov(fit)), silent = TRUE)
-    if (class(H) == "try-error"){
+    if (class(H)[1] == "try-error"){
       tmp <- list(mle = theta.mle, sd.mle = SIGMA, lasso = fail, sd.lasso = NA)
       class(tmp) <- "yuima.lasso"
       return(tmp)
@@ -65,7 +65,7 @@
     fit2 <- try( do.call(optim, args = args), silent = TRUE)
     
     
-    if (class(fit2) == "try-error"){
+    if (class(fit2)[1] == "try-error"){
       tmp <- list(mle = theta.mle, sd.mle = SIGMA, lasso = fail, sd.lasso = NA)
       class(tmp) <- "yuima.lasso"
       return(tmp)
@@ -72,7 +72,7 @@
     }
     theta.lasso <- fit2$par
     SIGMA1 <- try(sqrt(diag(solve(fit2$hessian))), silent = TRUE)
-    if (class(SIGMA1) == "try-error"){
+    if (class(SIGMA1)[1] == "try-error"){
       tmp <- list(mle = theta.mle, sd.mle = SIGMA, lasso = theta.lasso,
     sd.lasso = NA)
       class(tmp) <- "yuima.lasso"



More information about the Yuima-commits mailing list