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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Oct 23 16:34:16 CEST 2021


Author: lorenzo
Date: 2021-10-23 16:34:16 +0200 (Sat, 23 Oct 2021)
New Revision: 761

Modified:
   pkg/yuima/R/qmleLevy.R
Log:
Bug Fixed issue

Modified: pkg/yuima/R/qmleLevy.R
===================================================================
--- pkg/yuima/R/qmleLevy.R	2021-10-11 19:39:50 UTC (rev 760)
+++ pkg/yuima/R/qmleLevy.R	2021-10-23 14:34:16 UTC (rev 761)
@@ -383,10 +383,10 @@
     jump.term<-eval(JUMP[[1]],envir=tmp.env)
     drif.term<-eval(DRIFT,envir=tmp.env)
     if(length(jump.term)==1){
-      jump.term <- rep(jump.term, s.size)
+      jump.term <- rep(jump.term, s.size-1)
     }
     if(length(drif.term)==1){
-      drif.term <- rep(drif.term, s.size)
+      drif.term <- rep(drif.term, s.size-1)
     } # vectorization (note. if an expression type object does not include state.variable, the length of the item after "eval" operation is 1.)
     
     # for(s in 1:(s.size-1)){
@@ -553,7 +553,8 @@
     
     DriftDerCoeff<-EvalPartDiff(myenvdrift,mydriftDer, data=pX)
     if(!is.matrix(DriftDerCoeff)){
-      sigmadrifthat<- as.matrix(sum(DriftDerCoeff^2/jump.term[1:(oldyuima at sampling@n-1)]^2)/(oldyuima at sampling@n))*coefDriftSig
+     # sigmadrifthat<- as.matrix(sum(DriftDerCoeff^2/jump.term[1:(oldyuima at sampling@n-1)]^2)/(oldyuima at sampling@n))*coefDriftSig
+      sigmadrifthat<- as.matrix(sum(DriftDerCoeff^2/jump.term[1:(oldyuima at sampling@n-1)]^2)/(oldyuima at sampling@n))
       DriftDerCoeff <- t(DriftDerCoeff)
     }else{
       sigmadrifthat<- matrix(0,dim(DriftDerCoeff)[1],dim(DriftDerCoeff)[1])
@@ -566,7 +567,8 @@
     for(t in c(1:dim(DriftDerCoeff)[2]))
       sigmadriftdiff<-sigmadriftdiff+DriftDerCoeff[,t]%*%t(DiffJumpCoeff[,t])
     
-    sigmadriftdiff<-sigmadriftdiff/oldyuima at sampling@n
+    #sigmadriftdiff<-sigmadriftdiff/oldyuima at sampling@n
+    sigmadriftdiff<-sigmadriftdiff/oldyuima at sampling@n*coefDriftSig
     
     MatSigmaHat <- rbind(cbind(sigmadiffhat,t(sigmadriftdiff)),cbind(sigmadriftdiff,sigmadrifthat))
     
@@ -649,7 +651,8 @@
       DerMeta <- 1/del*(fdataetadelta - as.matrix(fdataeta)%*%rep(1,dim(fdataetadelta)[2]))*(as.matrix(term1)%*%rep(1,dim(fdataetadelta)[2]))
       SigmaEta <- t(DerMeta)%*%DerMeta/oldyuima at sampling@Terminal
       
-      SigmaEtaAlpha<- 1/oldyuima at sampling@n*DriftDerCoeff%*%(t(DiffJumpCoeff)/(as.matrix(jump.term[-length(jump.term)]^2)%*%rep(1,dim(DiffJumpCoeff)[1])) )
+      #SigmaEtaAlpha<- 1/oldyuima at sampling@n*DriftDerCoeff%*%(t(DiffJumpCoeff)/(as.matrix(jump.term[-length(jump.term)]^2)%*%rep(1,dim(DiffJumpCoeff)[1])) )
+      SigmaEtaAlpha<- 1/oldyuima at sampling@n*DriftDerCoeff%*%(t(DiffJumpCoeff)/(as.matrix(jump.term^2)%*%rep(1,dim(DiffJumpCoeff)[1])) )
       SigmaEtaAlpha <- SigmaEtaAlpha*sum(resi^3)/oldyuima at sampling@delta
       
       b_i <- matrix(0,floor(Ter),length(c(oldyuima at model@parameter at drift, oldyuima at model@parameter at jump)))



More information about the Yuima-commits mailing list