[Yuima-commits] r334 - in pkg/yuima: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Sep 29 13:40:51 CEST 2014
Author: iacus
Date: 2014-09-29 13:40:51 +0200 (Mon, 29 Sep 2014)
New Revision: 334
Modified:
pkg/yuima/DESCRIPTION
pkg/yuima/R/qmle.R
pkg/yuima/R/rng.R
pkg/yuima/R/yuima.model.R
pkg/yuima/man/setModel.Rd
Log:
fixed multivariate Levy, Carma, CP, and friends
Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION 2014-09-28 19:43:13 UTC (rev 333)
+++ pkg/yuima/DESCRIPTION 2014-09-29 11:40:51 UTC (rev 334)
@@ -1,7 +1,7 @@
Package: yuima
Type: Package
Title: The YUIMA Project package for SDEs
-Version: 1.0.34
+Version: 1.0.35
Date: 2014-09-29
Depends: methods, zoo, stats4, utils, expm, cubature, mvtnorm
Author: YUIMA Project Team
Modified: pkg/yuima/R/qmle.R
===================================================================
--- pkg/yuima/R/qmle.R 2014-09-28 19:43:13 UTC (rev 333)
+++ pkg/yuima/R/qmle.R 2014-09-29 11:40:51 UTC (rev 334)
@@ -521,7 +521,8 @@
HaveDriftHess <- FALSE
HaveDiffHess <- FALSE
HaveMeasHess <- FALSE
-
+
+
if(length(start)){
if(JointOptim){ ### joint optimization
old.fixed <- fixed
@@ -630,6 +631,7 @@
theta2 <- NULL
+
if(length(idx.drift)>0){
## DRIFT estimation with first state diffusion estimates
fixed <- old.fixed
@@ -684,7 +686,11 @@
}
} # END if(is.CARMA)
+
+
oout1 <- do.call(optim, args=mydots)
+
+
# oout1 <- optim(mydots$par,f,method = "L-BFGS-B" , lower = mydots$lower, upper = mydots$upper)
} else {
mydots$f <- mydots$fn
@@ -756,7 +762,7 @@
#names(par) <- unique(c(diff.par, drift.par))
# nm <- unique(c(diff.par, drift.par))
-# ESTIMATION OF CP part
+# START: ESTIMATION OF CP part
theta3 <- NULL
if(length(idx.measure)>0 & !is.CARMA(yuima)){
@@ -805,6 +811,7 @@
start <- old.start
fixed.par <- old.fixed.par
}
+# END: ESTIMATION OF CP part
@@ -816,6 +823,8 @@
}
coef <- oout$par
+
+
control=list()
par <- coef
if(!is.CARMA(yuima)){
@@ -912,6 +921,7 @@
else matrix(numeric(0L), 0L, 0L)
+
mycoef <- as.list(coef)
if(!is.CARMA(yuima)){
@@ -946,12 +956,15 @@
min <- min.diff + min.jump
if(min==0)
min <- NA
+
+
dummycov<-matrix(0,length(coef),length(coef))
rownames(dummycov)<-names(coef)
colnames(dummycov)<-names(coef)
dummycov[rownames(vcov),colnames(vcov)]<-vcov
vcov<-dummycov
+
# new("mle", call = call, coef = coef, fullcoef = unlist(mycoef),
# vcov = vcov, min = min, details = oout, minuslogl = minusquasilogl,
# method = method)
@@ -1060,6 +1073,7 @@
}
+
dummycovCarmaNoise<-vcov[unique(measure.par),unique(c(measure.par))] #we need to adjusted
dummycoeffCarmapar<-coef[unique(c(drift.par,diff.par))]
if(!is.null(loc.par)){
Modified: pkg/yuima/R/rng.R
===================================================================
--- pkg/yuima/R/rng.R 2014-09-28 19:43:13 UTC (rev 333)
+++ pkg/yuima/R/rng.R 2014-09-29 11:40:51 UTC (rev 334)
@@ -28,7 +28,10 @@
if(length(mu)!=length(beta)){
stop("Error: wrong input dimension.")
}
- if(missing(Lambda) | is.na(Lambda)){
+ if(missing(Lambda))
+ Lambda <- NA
+
+ if(is.na(Lambda)){
## univariate case
if(length(mu)!=1 || length(beta)!=1){
stop("Error: wrong input dimension.")
@@ -179,8 +182,10 @@
if(length(mu)!=length(beta)){
stop("Error: wrong input dimension.")
}
-
- if(missing(Lambda) | is.na(Lambda)){
+ if(missing(Lambda))
+ Lambda <- NA
+
+ if(is.na(Lambda)){
## univariate case
gamma <- sqrt(alpha^2 - beta^2)
if(gamma <0){
Modified: pkg/yuima/R/yuima.model.R
===================================================================
--- pkg/yuima/R/yuima.model.R 2014-09-28 19:43:13 UTC (rev 333)
+++ pkg/yuima/R/yuima.model.R 2014-09-29 11:40:51 UTC (rev 334)
@@ -121,7 +121,7 @@
setModel <- function(drift=NULL,
diffusion=NULL,
hurst=0.5,
- jump.coeff=character(),
+ jump.coeff=NULL,
measure=list(),
measure.type=character(),
state.variable="x",
@@ -488,7 +488,10 @@
##:: get parameters in jump expression
J.flag <- FALSE
- jump.par <- unique(all.vars(JUMP))
+ # jump.par <- unique(all.vars(JUMP))
+ jump.par <- unlist(lapply(JUMP,all.vars))
+ if(is.null(jump.par))
+ jump.par <- character()
if(length(na.omit(match(jump.par, jump.variable)))){
J.flag <- TRUE
}
Modified: pkg/yuima/man/setModel.Rd
===================================================================
--- pkg/yuima/man/setModel.Rd 2014-09-28 19:43:13 UTC (rev 333)
+++ pkg/yuima/man/setModel.Rd 2014-09-29 11:40:51 UTC (rev 334)
@@ -21,7 +21,7 @@
}
\usage{
-setModel(drift = NULL, diffusion = NULL, hurst = 0.5, jump.coeff = character(),
+setModel(drift = NULL, diffusion = NULL, hurst = 0.5, jump.coeff = NULL,
measure = list(), measure.type = character(), state.variable = "x",
jump.variable = "z", time.variable = "t", solve.variable, xinit)
}
More information about the Yuima-commits
mailing list