[Yuima-commits] r358 - pkg/yuima/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Nov 28 11:48:18 CET 2014


Author: lorenzo
Date: 2014-11-28 11:48:18 +0100 (Fri, 28 Nov 2014)
New Revision: 358

Modified:
   pkg/yuima/R/qmle.R
Log:
Fixed bugs in qmle

Modified: pkg/yuima/R/qmle.R
===================================================================
--- pkg/yuima/R/qmle.R	2014-11-27 09:31:54 UTC (rev 357)
+++ pkg/yuima/R/qmle.R	2014-11-28 10:48:18 UTC (rev 358)
@@ -1056,7 +1056,7 @@
     # INSERT HERE THE NECESSARY STEPS FOR FINDING THE PARAMETERS OF LEVY
    if(Est.Incr=="Carma.Inc"){
      # inc.levy.fin<-zoo(inc.levy,tt,frequency=1/env$h)
-     inc.levy.fin<-zoo(inc.levy[-1],tt[(1+length(tt)-length(inc.levy[-1])):length(tt)])
+     inc.levy.fin<-zoo(inc.levy,tt[(1+length(tt)-length(inc.levy)):length(tt)])
      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,
@@ -1124,7 +1124,7 @@
           if(floor(yuima at sampling@n/yuima at sampling@Terminal)!=yuima at sampling@n/yuima at sampling@Terminal){
             yuima.stop("the n/Terminal in sampling information is not an integer. Set Aggregation=FALSE")
           }
-          inc.levy1<-diff(cumsum(inc.levy)[seq(from=1,
+          inc.levy1<-diff(cumsum(c(0,inc.levy))[seq(from=1,
                                                to=yuima at sampling@n[1],
                                                by=(yuima at sampling@n/yuima at sampling@Terminal)[1]
                                                )])
@@ -1228,7 +1228,7 @@
           if(floor(yuima at sampling@n/yuima at sampling@Terminal)!=yuima at sampling@n/yuima at sampling@Terminal){
             yuima.stop("the n/Terminal in sampling information is not an integer. Aggregation=FALSE is recommended")
           }
-         inc.levy1<-diff(cumsum(inc.levy)[seq(from=1,
+         inc.levy1<-diff(cumsum(c(0,inc.levy))[seq(from=1,
                                               to=yuima at sampling@n[1],
                                               by=(yuima at sampling@n/yuima at sampling@Terminal)[1]
          )])
@@ -1344,7 +1344,7 @@
 #    carma_final_res<-list(mle=final_res,Incr=inc.levy,model=yuima) 
     if(Est.Incr=="Carma.IncPar"){
       #inc.levy.fin<-zoo(inc.levy,tt,frequency=1/env$h)
-      inc.levy.fin<-zoo(inc.levy[-1],tt[(1+length(tt)-length(inc.levy[-1])):length(tt)])
+      inc.levy.fin<-zoo(inc.levy,tt[(1+length(tt)-length(inc.levy)):length(tt)])
       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,



More information about the Yuima-commits mailing list