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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 29 05:35:00 CEST 2014


Author: iacus
Date: 2014-04-29 05:34:57 +0200 (Tue, 29 Apr 2014)
New Revision: 308

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/R/qmle.R
Log:
fixed qmle to allow for easy AIC/BIC stat

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2014-04-23 02:43:23 UTC (rev 307)
+++ pkg/yuima/DESCRIPTION	2014-04-29 03:34:57 UTC (rev 308)
@@ -1,8 +1,8 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project package for SDEs
-Version: 1.0.13
-Date: 2014-04-23
+Version: 1.0.14
+Date: 2014-04-29
 Depends: methods, zoo, stats4, utils, expm
 Suggests: cubature, mvtnorm
 Author: YUIMA Project Team

Modified: pkg/yuima/R/qmle.R
===================================================================
--- pkg/yuima/R/qmle.R	2014-04-23 02:43:23 UTC (rev 307)
+++ pkg/yuima/R/qmle.R	2014-04-29 03:34:57 UTC (rev 308)
@@ -104,8 +104,10 @@
 #     return(null)
 #   }
 #   
-  
-	diff.par <- yuima at model@parameter at diffusion
+
+    yuima.nobs <- as.integer(max(unlist(lapply(get.zoo.data(yuima),length))-1,na.rm=TRUE))
+
+    diff.par <- yuima at model@parameter at diffusion
 	
 #	24/12
   if(is(yuima at model, "yuima.carma") && length(diff.par)==0
@@ -680,22 +682,22 @@
   if(!is(yuima at model,"yuima.carma")){
     final_res<-new("mle", call = call, coef = coef, fullcoef = unlist(mycoef), 
                    vcov = vcov, min = min, details = oout, minuslogl = minusquasilogl, 
-                   method = method)
+                   method = method, nobs=yuima.nobs)
   }else{
     if( Est.Incr=="Carma.IncPar" || Est.Incr=="Carma.Inc" ){
     final_res<-new("yuima.carma.qmle", call = call, coef = coef, fullcoef = unlist(mycoef), 
                    vcov = vcov, min = min, details = oout, minuslogl = minusquasilogl, 
-                    method = method)
+                    method = method, nobs=yuima.nobs)
     }else{
       if(Est.Incr=="Carma.Par"){
       final_res<-new("mle", call = call, coef = coef, fullcoef = unlist(mycoef), 
                      vcov = vcov, min = min, details = oout, minuslogl = minusquasilogl, 
-                     method = method)
+                     method = method, nobs=yuima.nobs)
       }else{
         yuima.warn("The variable Est.Incr is not correct. See qmle documentation for the allowed values ")
         final_res<-new("mle", call = call, coef = coef, fullcoef = unlist(mycoef), 
                        vcov = vcov, min = min, details = oout, minuslogl = minusquasilogl, 
-                       method = method)
+                       method = method, nobs=yuima.nobs)
         return(final_res)
       }
     }
@@ -756,7 +758,7 @@
      carma_final_res<-new("yuima.carma.qmle", call = call, coef = coef, fullcoef = unlist(mycoef), 
                           vcov = vcov, min = min, details = oout, minuslogl = minusquasilogl, 
                           method = method, Incr.Lev = inc.levy.fin,
-                          model = yuima at model)
+                          model = yuima at model, nobs=yuima.nobs)
      return(carma_final_res)
    }
    
@@ -1033,12 +1035,12 @@
       carma_final_res<-new("yuima.carma.qmle", call = call, coef = coef, fullcoef = unlist(coef), 
                      vcov = cov, min = min, details = oout, minuslogl = minusquasilogl, 
                      method = method, Incr.Lev = inc.levy.fin,
-                           model = yuima at model)
+                           model = yuima at model, nobs=yuima.nobs)
     }else{
       if(Est.Incr=="Carma.Par"){
         carma_final_res<-new("mle", call = call, coef = coef, fullcoef = unlist(coef), 
             vcov = cov, min = min, details = oout, minuslogl = minusquasilogl, 
-            method = method)
+            method = method, nobs=yuima.nobs)
       }
     }
     return(carma_final_res)    



More information about the Yuima-commits mailing list