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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon May 22 18:42:07 CEST 2017


Author: lorenzo
Date: 2017-05-22 18:42:07 +0200 (Mon, 22 May 2017)
New Revision: 613

Modified:
   pkg/yuima/R/qmle.R
Log:
Gaussian CARMA: qmle fixed parameters

Modified: pkg/yuima/R/qmle.R
===================================================================
--- pkg/yuima/R/qmle.R	2017-05-15 21:38:03 UTC (rev 612)
+++ pkg/yuima/R/qmle.R	2017-05-22 16:42:07 UTC (rev 613)
@@ -596,6 +596,9 @@
           if(mean.noise %in% names(lower)){lower[mean.noise]<-10^-7}
         oout <- optim(new.start, fj, method = method, hessian = TRUE, lower=lower, upper=upper)
 
+        if(length(fixed)>0)
+          oout$par[fixed.par]<- unlist(fixed)[fixed.par]
+
         if(is.CARMA(yuima)){
           HESS <- oout$hessian
         } else {
@@ -609,6 +612,26 @@
           HESS<-HESS[-idx.b0,]
           HESS<-HESS[,-idx.b0]
         }
+        # if(is.CARMA(yuima) && length(yuima at model@parameter at measure)!=0){
+        #   for(i in c(1:length(fixed.par))){
+        #     indx.fixed<-match(fixed.par[i],rownames(HESS))
+        #     HESS<-HESS[-indx.fixed,]
+        #     HESS<-HESS[,-indx.fixed]
+        #   }
+        #   if(is.CARMA(yuima) && (NoNeg.Noise==TRUE)){
+        #     idx.noise<-(match(mean.noise,rownames(HESS)))
+        #     HESS<-HESS[-idx.noise,]
+        #     HESS<-HESS[,-idx.noise]
+        #   }
+        # }
+        if(is.CARMA(yuima)&& length(fixed)>0){
+          for(i in c(1:length(fixed.par))){
+            indx.fixed<-match(fixed.par[i],rownames(HESS))
+            HESS<-HESS[-indx.fixed,]
+            HESS<-HESS[,-indx.fixed]
+          }
+        }
+
         if(is.CARMA(yuima) && length(yuima at model@parameter at measure)!=0){
           for(i in c(1:length(fixed.par))){
             indx.fixed<-match(fixed.par[i],rownames(HESS))
@@ -621,6 +644,8 @@
             HESS<-HESS[,-idx.noise]
           }
         }
+
+
         HaveDriftHess <- TRUE
         HaveDiffHess <- TRUE
       } else { ### one dimensional optim



More information about the Yuima-commits mailing list