[Yuima-commits] r462 - pkg/yuima/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Sep 10 15:34:53 CEST 2016
Author: lorenzo
Date: 2016-09-10 15:34:53 +0200 (Sat, 10 Sep 2016)
New Revision: 462
Modified:
pkg/yuima/R/yuima.model.R
Log:
Added new setModel
Modified: pkg/yuima/R/yuima.model.R
===================================================================
--- pkg/yuima/R/yuima.model.R 2016-09-02 17:40:52 UTC (rev 461)
+++ pkg/yuima/R/yuima.model.R 2016-09-10 13:34:53 UTC (rev 462)
@@ -130,25 +130,8 @@
solve.variable,
xinit=NULL){
## we need a temp env for simplifications
- if(!is.null(jump.coeff)){
- if(is.matrix(jump.coeff)){
- if(dim(jump.coeff)[2]!=1){
- intensity <- NULL
- df <- as.list(measure[["df"]])
- if(any(measure.type=="CP")){
- intensity <- measure[["intensity"]]
- }
- res <- setMultiModel(drift = drift, diffusion = diffusion,
- hurst = hurst, jump.coeff = jump.coeff,
- intensity = intensity, df = df,
- measure.type = measure.type, state.variable = state.variable,
- jump.variable = jump.variable, time.variable = time.variable,
- solve.variable = solve.variable, xinit= xinit)
- return(res)
- }
- }
- }
+
yuimaENV <- new.env()
##::measure and jump term #####################################
@@ -162,6 +145,38 @@
codelist <- c("rIG", "rNIG", "rgamma", "rbgamma", "rvgamma", "rstable")
##::end make type function list ####
+ ## Multivariate YUIMA model
+
+
+ if(!is.null(jump.coeff)){
+ if(is.matrix(jump.coeff)){
+
+ if(dim(jump.coeff)[2]!=1){
+ intensity <- NULL
+ df <- as.list(measure[["df"]])
+ if(any(measure.type=="CP")){
+ intensity <- measure[["intensity"]]
+ }
+ my.cond <- TRUE
+ tmp <- regexpr("\\(", measure$df)[1]
+ measurefunc <- substring(measure$df, 1, tmp-1)
+ if(!is.na(match(measurefunc, codelist))){
+ my.cond <- FALSE
+ }
+ if(my.cond){
+ res <- setMultiModel(drift = drift, diffusion = diffusion,
+ hurst = hurst, jump.coeff = jump.coeff,
+ intensity = intensity, df = df,
+ measure.type = measure.type, state.variable = state.variable,
+ jump.variable = jump.variable, time.variable = time.variable,
+ solve.variable = solve.variable, xinit= xinit)
+ return(res)
+ }
+ }
+ }
+ }
+
+
if(!length(measure.type)){
if( length(jump.coeff) || length(measure) ){
yuima.warn("measure type does not match with jump term.")
@@ -325,6 +340,9 @@
n.jump <- 1
}
+
+
+
##::end measure and jump term #####################################
##:: check for errors and reform values
More information about the Yuima-commits
mailing list