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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Jan 29 22:34:20 CET 2014


Author: lorenzo
Date: 2014-01-29 22:34:18 +0100 (Wed, 29 Jan 2014)
New Revision: 272

Modified:
   pkg/yuima/DESCRIPTION
   pkg/yuima/NAMESPACE
   pkg/yuima/R/qmle.R
   pkg/yuima/man/qmle.Rd
Log:
Deleted dependence from GeneralizedHyperbolic package

Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION	2014-01-28 21:07:30 UTC (rev 271)
+++ pkg/yuima/DESCRIPTION	2014-01-29 21:34:18 UTC (rev 272)
@@ -1,9 +1,9 @@
 Package: yuima
 Type: Package
 Title: The YUIMA Project package (unstable version)
-Version: 0.1.222
-Date: 2014-01-13
-Depends: methods, zoo, stats4, utils, Matrix, GeneralizedHyperbolic
+Version: 0.1.223
+Date: 2014-01-30
+Depends: methods, zoo, stats4, utils, Matrix
 Suggests: cubature, mvtnorm
 Author: YUIMA Project Team.
 Maintainer: Stefano M. Iacus <stefano.iacus at R-project.org>

Modified: pkg/yuima/NAMESPACE
===================================================================
--- pkg/yuima/NAMESPACE	2014-01-28 21:07:30 UTC (rev 271)
+++ pkg/yuima/NAMESPACE	2014-01-29 21:34:18 UTC (rev 272)
@@ -6,7 +6,6 @@
 importFrom("Matrix")
 importFrom(stats, confint)
 importFrom(stats4)
-importFrom("GeneralizedHyperbolic")
 
 
 importFrom(utils, toLatex)

Modified: pkg/yuima/R/qmle.R
===================================================================
--- pkg/yuima/R/qmle.R	2014-01-28 21:07:30 UTC (rev 271)
+++ pkg/yuima/R/qmle.R	2014-01-29 21:34:18 UTC (rev 272)
@@ -745,46 +745,48 @@
   #         measure.par
   #         sapply(gregexpr("\\W+", measurefunc),length)
   
-          name.func.dummy <- as.character(model at measure$df$expr[1])
-          name.func<- substr(name.func.dummy,1,(nchar(name.func.dummy)-1))
-          names.measpar<-rev(as.vector(strsplit(name.func,', '))[[1]][-1])
-          valuemeasure<-as.numeric(names.measpar)
-          NaIdx<-which(is.na(valuemeasure))
-          if(length(NaIdx)!=0){
-            yuima.warn("the constrained MLE for levy increment will be implemented as soon as possible")
-          }
+  # Delete Dependence of GeneralizedHyperbolic package: 30/01
           
-          inc.levy1<-diff(cumsum(inc.levy)[seq(from=1,
-                                    to=yuima at sampling@n[1],
-                                    by=(yuima at sampling@n/yuima at sampling@Terminal)[1]
-                                    )])
-          result.Levy<-nigFit(inc.levy1)      
+#           name.func.dummy <- as.character(model at measure$df$expr[1])
+#           name.func<- substr(name.func.dummy,1,(nchar(name.func.dummy)-1))
+#           names.measpar<-rev(as.vector(strsplit(name.func,', '))[[1]][-1])
+#           valuemeasure<-as.numeric(names.measpar)
+#           NaIdx<-which(is.na(valuemeasure))
+#           if(length(NaIdx)!=0){
+#             yuima.warn("the constrained MLE for levy increment will be implemented as soon as possible")
+#           }
+#           
+#           inc.levy1<-diff(cumsum(inc.levy)[seq(from=1,
+#                                     to=yuima at sampling@n[1],
+#                                     by=(yuima at sampling@n/yuima at sampling@Terminal)[1]
+#                                     )])
+#           result.Levy<-nigFit(inc.levy1)      
+#           
+#           Inc.Parm<-coef(result.Levy)
+#           IncVCOV<--solve(nigHessian(inc.levy, param=Inc.Parm))
+#   
+#           names(Inc.Parm)[NaIdx]<-measure.par
+#           #prova<-as.matrix(IncVCOV)
+#           rownames(IncVCOV)[NaIdx]<-as.character(measure.par)
+#           colnames(IncVCOV)[NaIdx]<-as.character(measure.par)
+#           
+#           
+#           coef<-NULL
+#           coef<-c(dummycoeffCarmapar,Inc.Parm)
+#           #       names.par<-c(unique(c(drift.par,diff.par)),names(Inc.Parm))
+#           #       
+#           names.par<-names(coef)
+#           cov<-NULL
+#           cov<-matrix(0,length(names.par),length(names.par))
+#           rownames(cov)<-names.par
+#           colnames(cov)<-names.par
+#           if(is.null(loc.par)){
+#             cov[unique(c(drift.par,diff.par)),unique(c(drift.par,diff.par))]<-dummycovCarmapar
+#           }else{
+#             cov[unique(c(drift.par,diff.par,info at loc.par)),unique(c(drift.par,diff.par,info at loc.par))]<-dummycovCarmapar
+#           }
+#           cov[names(Inc.Parm),names(Inc.Parm)]<-IncVCOV
           
-          Inc.Parm<-coef(result.Levy)
-          IncVCOV<--solve(nigHessian(inc.levy, param=Inc.Parm))
-  
-          names(Inc.Parm)[NaIdx]<-measure.par
-          #prova<-as.matrix(IncVCOV)
-          rownames(IncVCOV)[NaIdx]<-as.character(measure.par)
-          colnames(IncVCOV)[NaIdx]<-as.character(measure.par)
-          
-          
-          coef<-NULL
-          coef<-c(dummycoeffCarmapar,Inc.Parm)
-          #       names.par<-c(unique(c(drift.par,diff.par)),names(Inc.Parm))
-          #       
-          names.par<-names(coef)
-          cov<-NULL
-          cov<-matrix(0,length(names.par),length(names.par))
-          rownames(cov)<-names.par
-          colnames(cov)<-names.par
-          if(is.null(loc.par)){
-            cov[unique(c(drift.par,diff.par)),unique(c(drift.par,diff.par))]<-dummycovCarmapar
-          }else{
-            cov[unique(c(drift.par,diff.par,info at loc.par)),unique(c(drift.par,diff.par,info at loc.par))]<-dummycovCarmapar
-          }
-          cov[names(Inc.Parm),names(Inc.Parm)]<-IncVCOV
-          
         }
         if(measurefunc=="rgamma"){
   #         result.Levy<-gigFit(inc.levy)
@@ -839,11 +841,25 @@
 quasilogl <- function(yuima, param, print=FALSE){
 
 	d.size <- yuima at model@equation.number
+	if (is(yuima at model, "yuima.carma")){
+	  # 24/12
+	  d.size <-1
+	}
+	
 	n <- length(yuima)[1]
 	
 	env <- new.env()
 	assign("X",  as.matrix(yuima:::onezoo(yuima)), envir=env)
 	assign("deltaX",  matrix(0, n-1, d.size), envir=env)
+  
+	if (is(yuima at model, "yuima.carma")){
+	  #24/12 If we consider a carma model,
+	  # the observations are only the first column of env$X
+	  env$X<-as.matrix(env$X[,1])
+	  env$deltaX<-as.matrix(env$deltaX[,1])
+	}
+	
+  
 	for(t in 1:(n-1))
 	env$deltaX[t,] <- env$X[t+1,] - env$X[t,]
 	
@@ -981,7 +997,8 @@
     # We build the two step procedure as described in
   #  if(length(yuima at model@info at scale.par)!=0){
        prova<-as.numeric(param)
-       names(prova)<-fullcoef[oo]
+       #names(prova)<-fullcoef[oo]
+	     names(prova)<-names(param)
        param<-prova[c(length(prova):1)]
        
        y<-as.numeric(env$X)

Modified: pkg/yuima/man/qmle.Rd
===================================================================
--- pkg/yuima/man/qmle.Rd	2014-01-28 21:07:30 UTC (rev 271)
+++ pkg/yuima/man/qmle.Rd	2014-01-29 21:34:18 UTC (rev 272)
@@ -281,7 +281,7 @@
 
 # carma(p=2,q=1) driven by a normal inverse gaussian process
 mod3<-setCarma(p=2,q=1,
-               measure=list(df=list("rNIG(z, alpha, beta, delta, mu)")),
+               measure=list(df=list("rNIG(z, alpha, beta, delta1, mu)")),
                measure.type="code")
 #
 
@@ -292,7 +292,7 @@
                  b1=2,
                  alpha=1,
                  beta=0,
-                 delta=1,
+                 delta1=1,
                  mu=0)
 
 samp3<-setSampling(Terminal=100,n=200)



More information about the Yuima-commits mailing list