[Yuima-commits] r643 - in pkg/yuima: . R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed May 16 04:56:47 CEST 2018
Author: lorenzo
Date: 2018-05-16 04:56:27 +0200 (Wed, 16 May 2018)
New Revision: 643
Modified:
pkg/yuima/DESCRIPTION
pkg/yuima/NAMESPACE
pkg/yuima/R/AuxMethodforPPR.R
pkg/yuima/R/DataPPR.R
pkg/yuima/R/PointProcessClasses.R
pkg/yuima/R/lambdaPPR.R
pkg/yuima/R/qmle.R
pkg/yuima/R/setHawkes.R
pkg/yuima/R/setPpr.R
pkg/yuima/R/simulateForPpr.R
pkg/yuima/R/yuima.model.R
pkg/yuima/man/DataPpr.Rd
pkg/yuima/man/Intensity.PPR.Rd
pkg/yuima/man/get.counting.data.Rd
pkg/yuima/man/info.Ppr.Rd
pkg/yuima/man/lambdaFromData.Rd
pkg/yuima/man/setPpr.Rd
pkg/yuima/man/yuima.Ppr.Rd
Log:
New version 1.7.9 (Changed name from Ppr to PPR)
Modified: pkg/yuima/DESCRIPTION
===================================================================
--- pkg/yuima/DESCRIPTION 2018-05-14 12:46:28 UTC (rev 642)
+++ pkg/yuima/DESCRIPTION 2018-05-16 02:56:27 UTC (rev 643)
@@ -1,7 +1,7 @@
Package: yuima
Type: Package
Title: The YUIMA Project Package for SDEs
-Version: 1.7.8
+Version: 1.7.9
Depends: R(>= 2.10.0), methods, zoo, stats4, utils, expm, cubature, mvtnorm
Imports: Rcpp (>= 0.12.1), boot (>= 1.3-2)
Author: YUIMA Project Team
Modified: pkg/yuima/NAMESPACE
===================================================================
--- pkg/yuima/NAMESPACE 2018-05-14 12:46:28 UTC (rev 642)
+++ pkg/yuima/NAMESPACE 2018-05-16 02:56:27 UTC (rev 643)
@@ -61,7 +61,7 @@
importFrom(stats, start)
importFrom(utils, str)
importFrom(stats, sd)
-importFrom("stats", cov2cor) # added by YK on Apr. 12, 2018
+importFrom("stats", cov2cor) # added by YK on Apr. 12, 2018
exportClasses("yuima",
@@ -88,8 +88,8 @@
"Integrand",
"Integral.sde",
"yuima.Integral",
-"info.Ppr",
-"yuima.Ppr",
+"info.PPR",
+"yuima.PPR",
"yuima.Hawkes"
)
@@ -140,7 +140,7 @@
export(setCharacteristic)
export(setCarma)
export(setPoisson)
-export(setPpr)
+export(setPPR)
export(setHawkes)
export(dconst)
export(rconst)
@@ -206,7 +206,7 @@
export(qmleL)
export(qmleLevy)
export(IC)
-export(DataPpr)
+export(DataPPR)
export(Intensity.PPR)
Modified: pkg/yuima/R/AuxMethodforPPR.R
===================================================================
--- pkg/yuima/R/AuxMethodforPPR.R 2018-05-14 12:46:28 UTC (rev 642)
+++ pkg/yuima/R/AuxMethodforPPR.R 2018-05-16 02:56:27 UTC (rev 643)
@@ -1,6 +1,6 @@
## Here we write all auxiliar functions for the Point Process
## Regression Model
-is.Ppr <- function(yuimaPpr){is(yuimaPpr,"yuima.Ppr")}
+is.PPR <- function(yuimaPPR){is(yuimaPPR,"yuima.PPR")}
Internal.LogLikPPR <- function(param,my.envd1=NULL,
my.envd2=NULL,my.envd3=NULL){
@@ -18,8 +18,8 @@
# if(is.nan(Integr1)){
# Integr1 <- -10^6
# }
- if(length(my.envd3$YUIMA.PPR at Ppr@counting.var)>0){
- cond1 <- my.envd3$YUIMA.PPR at model@solve.variable %in% my.envd3$YUIMA.PPR at Ppr@counting.var
+ if(length(my.envd3$YUIMA.PPR at PPR@counting.var)>0){
+ cond1 <- my.envd3$YUIMA.PPR at model@solve.variable %in% my.envd3$YUIMA.PPR at PPR@counting.var
cond2 <- diff(as.numeric(my.envd3$YUIMA.PPR at data@original.data[,cond1]))
#Integr2<- sum(log(IntLambda[-1][cond2!=0]),na.rm=TRUE)
Integr2 <- sum(log(IntLambda[cond2!=0]),na.rm=TRUE)
@@ -45,47 +45,47 @@
}
-quasiLogLik.Ppr <- function(yuimaPpr, parLambda=list(), method=method, fixed = list(),
+quasiLogLik.PPR <- function(yuimaPPR, parLambda=list(), method=method, fixed = list(),
lower, upper, call, ...){
- yuimaPpr->yuimaPPr
+ yuimaPPR->yuimaPPR
parLambda->param
- gfun<-yuimaPPr at gFun@formula
+ gfun<-yuimaPPR at gFun@formula
- gfun<-yuimaPPr at gFun@formula
+ gfun<-yuimaPPR at gFun@formula
- dimIntegr <- length(yuimaPPr at Kernel@Integrand at IntegrandList)
+ dimIntegr <- length(yuimaPPR at Kernel@Integrand at IntegrandList)
Integrand2 <- character(length=dimIntegr)
for(i in c(1:dimIntegr)){
- Integrand1 <- as.character(yuimaPPr at Kernel@Integrand at IntegrandList[[i]])
- timeCond <- paste0(" * (",yuimaPPr at Kernel@variable.Integral at var.time," < ",yuimaPPr at Kernel@variable.Integral at upper.var,")")
+ Integrand1 <- as.character(yuimaPPR at Kernel@Integrand at IntegrandList[[i]])
+ timeCond <- paste0(" * (",yuimaPPR at Kernel@variable.Integral at var.time," < ",yuimaPPR at Kernel@variable.Integral at upper.var,")")
Integrand2[i] <-paste0(Integrand1,timeCond)
}
- Integrand2<- matrix(Integrand2,yuimaPPr at Kernel@Integrand at dimIntegrand[1],yuimaPPr at Kernel@Integrand at dimIntegrand[2])
+ Integrand2<- matrix(Integrand2,yuimaPPR at Kernel@Integrand at dimIntegrand[1],yuimaPPR at Kernel@Integrand at dimIntegrand[2])
- for(j in c(1:yuimaPPr at Kernel@Integrand at dimIntegrand[2])){
- Integrand2[,j]<-paste0(Integrand2[,j]," * d",yuimaPPr at Kernel@variable.Integral at var.dx[j])
+ for(j in c(1:yuimaPPR at Kernel@Integrand at dimIntegrand[2])){
+ Integrand2[,j]<-paste0(Integrand2[,j]," * d",yuimaPPR at Kernel@variable.Integral at var.dx[j])
}
- colnames(Integrand2) <- paste0("d",yuimaPPr at Kernel@variable.Integral at var.dx)
+ colnames(Integrand2) <- paste0("d",yuimaPPR at Kernel@variable.Integral at var.dx)
NamesIntegrandExpr <- as.character(matrix(colnames(Integrand2), dim(Integrand2)[1],dim(Integrand2)[2], byrow = TRUE))
Integrand2expr<- parse(text=Integrand2)
- gridTime <- time(yuimaPPr at data@original.data)
+ gridTime <- time(yuimaPPR at data@original.data)
- yuimaPPr at Kernel@variable.Integral at var.dx
- if(any(yuimaPPr at Kernel@variable.Integral at var.dx %in% yuimaPPr at model@solve.variable)){
+ yuimaPPR at Kernel@variable.Integral at var.dx
+ if(any(yuimaPPR at Kernel@variable.Integral at var.dx %in% yuimaPPR at model@solve.variable)){
my.envd1<-new.env()
ExistdN<-TRUE
}else{
ExistdN<-FALSE
}
Univariate<-FALSE
- if(length(yuimaPPr at Ppr@counting.var)==1){
+ if(length(yuimaPPR at PPR@counting.var)==1){
Univariate<-TRUE
}
- if(any(!(yuimaPPr at Kernel@variable.Integral at var.dx %in% yuimaPPr at model@solve.variable))){
+ if(any(!(yuimaPPR at Kernel@variable.Integral at var.dx %in% yuimaPPR at model@solve.variable))){
my.envd2<-new.env()
ExistdX<-TRUE
}else{
@@ -95,7 +95,7 @@
my.envd3 <- new.env()
namesparam<-names(param)
- if(!(all(namesparam %in% yuimaPPr at Ppr@allparamPpr) && length(namesparam)==length(yuimaPPr at Ppr@allparamPpr))){
+ if(!(all(namesparam %in% yuimaPPR at PPR@allparamPPR) && length(namesparam)==length(yuimaPPR at PPR@allparamPPR))){
return(NULL)
}
@@ -103,43 +103,43 @@
if(ExistdN){
#CountingVariable
- for(i in c(1:length(yuimaPPr at Ppr@counting.var))){
- cond <- yuimaPPr at model@solve.variable %in% yuimaPPr at Ppr@counting.var[i]
- dummyData <-unique(yuimaPPr at data@original.data[,cond])[-1]
- assign(yuimaPPr at Ppr@counting.var[i], rep(1,length(dummyData)),envir=my.envd1)
+ for(i in c(1:length(yuimaPPR at PPR@counting.var))){
+ cond <- yuimaPPR at model@solve.variable %in% yuimaPPR at PPR@counting.var[i]
+ dummyData <-unique(yuimaPPR at data@original.data[,cond])[-1]
+ assign(yuimaPPR at PPR@counting.var[i], rep(1,length(dummyData)),envir=my.envd1)
}
# Names expression
assign("NamesIntgra", NamesIntegrandExpr, envir=my.envd1)
#dN
namedX <-NULL
namedJumpTimeX <- NULL
- for(i in c(1:length(yuimaPPr at Kernel@variable.Integral at var.dx))){
- if(yuimaPPr at Kernel@variable.Integral at var.dx[i] %in% yuimaPPr at Ppr@counting.var){
- cond <- yuimaPPr at model@solve.variable %in% yuimaPPr at Kernel@variable.Integral at var.dx[i]
- namedX<-c(namedX,paste0("d",yuimaPPr at Kernel@variable.Integral at var.dx[i]))
- namedJumpTimeX <-c(namedJumpTimeX,paste0("JumpTime.d",yuimaPPr at Kernel@variable.Integral at var.dx[i]))
- dummyData <- diff(as.numeric(yuimaPPr at data@original.data[,cond]))# We consider only Jump
+ for(i in c(1:length(yuimaPPR at Kernel@variable.Integral at var.dx))){
+ if(yuimaPPR at Kernel@variable.Integral at var.dx[i] %in% yuimaPPR at PPR@counting.var){
+ cond <- yuimaPPR at model@solve.variable %in% yuimaPPR at Kernel@variable.Integral at var.dx[i]
+ namedX<-c(namedX,paste0("d",yuimaPPR at Kernel@variable.Integral at var.dx[i]))
+ namedJumpTimeX <-c(namedJumpTimeX,paste0("JumpTime.d",yuimaPPR at Kernel@variable.Integral at var.dx[i]))
+ dummyData <- diff(as.numeric(yuimaPPR at data@original.data[,cond]))# We consider only Jump
dummyJumpTime <- gridTime[-1][dummyData!=0]
dummyData2 <- diff(unique(cumsum(dummyData)))
#dummyData3 <- zoo(dummyData2,order.by = dummyJumpTime)
dummyData3 <- rep(1,length(dummyData2))
JumpTime <- dummyJumpTime
- assign(paste0("d",yuimaPPr at Kernel@variable.Integral at var.dx[i]), dummyData3 ,envir=my.envd1)
- assign(paste0("JumpTime.d",yuimaPPr at Kernel@variable.Integral at var.dx[i]), dummyJumpTime ,envir=my.envd1)
+ assign(paste0("d",yuimaPPR at Kernel@variable.Integral at var.dx[i]), dummyData3 ,envir=my.envd1)
+ assign(paste0("JumpTime.d",yuimaPPR at Kernel@variable.Integral at var.dx[i]), dummyJumpTime ,envir=my.envd1)
}
}
assign("namedX",namedX, envir = my.envd1)
assign("namedJumpTimeX",namedJumpTimeX, envir = my.envd1)
- assign("var.time",yuimaPPr at Kernel@variable.Integral at var.time,envir=my.envd1)
- assign("t.time",yuimaPPr at Kernel@variable.Integral at upper.var,envir=my.envd1)
+ assign("var.time",yuimaPPR at Kernel@variable.Integral at var.time,envir=my.envd1)
+ assign("t.time",yuimaPPR at Kernel@variable.Integral at upper.var,envir=my.envd1)
# Covariates
- if(length(yuimaPPr at Ppr@covariates)>0){
+ if(length(yuimaPPR at PPR@covariates)>0){
# Covariates should be identified at jump time
- for(i in c(1:length(yuimaPPr at Ppr@covariates))){
- cond <- yuimaPPr at model@solve.variable %in% yuimaPPr at Ppr@covariates[i]
+ for(i in c(1:length(yuimaPPR at PPR@covariates))){
+ cond <- yuimaPPR at model@solve.variable %in% yuimaPPR at PPR@covariates[i]
condTime <- gridTime %in% my.envd1$JumpTime.dN
- assign(yuimaPPr at Ppr@covariates[i],yuimaPPr at data@original.data[condTime,cond],envir = my.envd1)
+ assign(yuimaPPR at PPR@covariates[i],yuimaPPR at data@original.data[condTime,cond],envir = my.envd1)
}
}
@@ -151,10 +151,10 @@
#Covariate
#CountingVariable
- for(i in c(1:length(yuimaPPr at Ppr@counting.var))){
- cond <- yuimaPPr at model@solve.variable %in% yuimaPPr at Ppr@counting.var[i]
- dummyData <-yuimaPPr at data@original.data[,cond]
- assign(yuimaPPr at Ppr@counting.var[i], dummyData,envir=my.envd1)
+ for(i in c(1:length(yuimaPPR at PPR@counting.var))){
+ cond <- yuimaPPR at model@solve.variable %in% yuimaPPR at PPR@counting.var[i]
+ dummyData <-yuimaPPR at data@original.data[,cond]
+ assign(yuimaPPR at PPR@counting.var[i], dummyData,envir=my.envd1)
}
@@ -167,25 +167,25 @@
# construction my.envd3
#Covariate
- dimCov<-length(yuimaPPr at Ppr@covariates)
+ dimCov<-length(yuimaPPR at PPR@covariates)
if(dimCov>0){
for(i in c(1:dimCov)){
- cond <- yuimaPPr at model@solve.variable %in% yuimaPPr at Ppr@covariates[i]
- dummyData <- yuimaPPr at data@original.data[,cond]
- assign(yuimaPPr at Ppr@covariates[i], dummyData,envir=my.envd3)
+ cond <- yuimaPPR at model@solve.variable %in% yuimaPPR at PPR@covariates[i]
+ dummyData <- yuimaPPR at data@original.data[,cond]
+ assign(yuimaPPR at PPR@covariates[i], dummyData,envir=my.envd3)
}
}
#CountingVariable
- for(i in c(1:length(yuimaPPr at Ppr@counting.var))){
- cond <- yuimaPPr at model@solve.variable %in% yuimaPPr at Ppr@counting.var[i]
- dummyData <-cumsum(c(as.numeric(yuimaPPr at data@original.data[1,cond]!=0),as.numeric(diff(yuimaPPr at data@original.data[,cond])!=0)))
- assign(yuimaPPr at Ppr@counting.var[i], dummyData,envir=my.envd3)
+ for(i in c(1:length(yuimaPPR at PPR@counting.var))){
+ cond <- yuimaPPR at model@solve.variable %in% yuimaPPR at PPR@counting.var[i]
+ dummyData <-cumsum(c(as.numeric(yuimaPPR at data@original.data[1,cond]!=0),as.numeric(diff(yuimaPPR at data@original.data[,cond])!=0)))
+ assign(yuimaPPR at PPR@counting.var[i], dummyData,envir=my.envd3)
}
#time
- assign(yuimaPPr at model@time.variable, gridTime, my.envd3)
+ assign(yuimaPPR at model@time.variable, gridTime, my.envd3)
#Model
- assign("YUIMA.PPR",yuimaPPr,envir=my.envd3)
+ assign("YUIMA.PPR",yuimaPPR,envir=my.envd3)
assign("namesparam",namesparam,envir=my.envd3)
assign("gfun",gfun,envir=my.envd3)
assign("Integrand2",Integrand2,envir=my.envd3)
@@ -263,45 +263,45 @@
}
-# quasiLogLik.Ppr <- function(yuimaPpr, parLambda=list(), method=method, fixed = list(),
+# quasiLogLik.PPR <- function(yuimaPPR, parLambda=list(), method=method, fixed = list(),
# lower, upper, call, ...){
#
-# yuimaPpr->yuimaPPr
+# yuimaPPR->yuimaPPR
# parLambda->param
-# gfun<-yuimaPPr at gFun@formula
+# gfun<-yuimaPPR at gFun@formula
#
-# dimIntegr <- length(yuimaPPr at Kernel@Integrand at IntegrandList)
+# dimIntegr <- length(yuimaPPR at Kernel@Integrand at IntegrandList)
# Integrand2 <- character(length=dimIntegr)
# for(i in c(1:dimIntegr)){
-# Integrand1 <- as.character(yuimaPPr at Kernel@Integrand at IntegrandList[[i]])
-# timeCond <- paste0(" * (",yuimaPPr at Kernel@variable.Integral at var.time," < ",yuimaPPr at Kernel@variable.Integral at upper.var,")")
+# Integrand1 <- as.character(yuimaPPR at Kernel@Integrand at IntegrandList[[i]])
+# timeCond <- paste0(" * (",yuimaPPR at Kernel@variable.Integral at var.time," < ",yuimaPPR at Kernel@variable.Integral at upper.var,")")
# Integrand2[i] <-paste0(Integrand1,timeCond)
# }
#
-# Integrand2<- matrix(Integrand2,yuimaPPr at Kernel@Integrand at dimIntegrand[1],yuimaPPr at Kernel@Integrand at dimIntegrand[2])
+# Integrand2<- matrix(Integrand2,yuimaPPR at Kernel@Integrand at dimIntegrand[1],yuimaPPR at Kernel@Integrand at dimIntegrand[2])
#
#
-# for(j in c(1:yuimaPPr at Kernel@Integrand at dimIntegrand[2])){
-# Integrand2[,j]<-paste0(Integrand2[,j]," * d",yuimaPPr at Kernel@variable.Integral at var.dx[j])
+# for(j in c(1:yuimaPPR at Kernel@Integrand at dimIntegrand[2])){
+# Integrand2[,j]<-paste0(Integrand2[,j]," * d",yuimaPPR at Kernel@variable.Integral at var.dx[j])
# }
-# colnames(Integrand2) <- paste0("d",yuimaPPr at Kernel@variable.Integral at var.dx)
+# colnames(Integrand2) <- paste0("d",yuimaPPR at Kernel@variable.Integral at var.dx)
# NamesIntegrandExpr <- as.character(matrix(colnames(Integrand2), dim(Integrand2)[1],dim(Integrand2)[2], byrow = TRUE))
# Integrand2expr<- parse(text=Integrand2)
#
-# gridTime <- time(yuimaPPr at data@original.data)
+# gridTime <- time(yuimaPPR at data@original.data)
#
-# yuimaPPr at Kernel@variable.Integral at var.dx
-# if(any(yuimaPPr at Kernel@variable.Integral at var.dx %in% yuimaPPr at model@solve.variable)){
+# yuimaPPR at Kernel@variable.Integral at var.dx
+# if(any(yuimaPPR at Kernel@variable.Integral at var.dx %in% yuimaPPR at model@solve.variable)){
# my.envd1<-new.env()
# ExistdN<-TRUE
# }else{
# ExistdN<-FALSE
# }
# Univariate<-FALSE
-# if(length(yuimaPPr at Ppr@counting.var)==1){
+# if(length(yuimaPPR at PPR@counting.var)==1){
# Univariate<-TRUE
# }
-# if(any(!(yuimaPPr at Kernel@variable.Integral at var.dx %in% yuimaPPr at model@solve.variable))){
+# if(any(!(yuimaPPR at Kernel@variable.Integral at var.dx %in% yuimaPPR at model@solve.variable))){
# my.envd2<-new.env()
# ExistdX<-TRUE
# }else{
@@ -311,7 +311,7 @@
#
# my.envd3 <- new.env()
# namesparam<-names(param)
-# if(!(all(namesparam %in% yuimaPPr at Ppr@allparamPpr) && length(namesparam)==length(yuimaPPr at Ppr@allparamPpr))){
+# if(!(all(namesparam %in% yuimaPPR at PPR@allparamPPR) && length(namesparam)==length(yuimaPPR at PPR@allparamPPR))){
# return(NULL)
# }
#
@@ -319,32 +319,32 @@
# if(ExistdN){
#
# #CountingVariable
-# for(i in c(1:length(yuimaPPr at Ppr@counting.var))){
-# cond <- yuimaPPr at Ppr@counting.var[i] %in% yuimaPPr at model@solve.variable
-# dummyData <-unique(yuimaPPr at data@original.data[,cond])[-1]
-# assign(yuimaPPr at Ppr@counting.var[i], dummyData,envir=my.envd1)
+# for(i in c(1:length(yuimaPPR at PPR@counting.var))){
+# cond <- yuimaPPR at PPR@counting.var[i] %in% yuimaPPR at model@solve.variable
+# dummyData <-unique(yuimaPPR at data@original.data[,cond])[-1]
+# assign(yuimaPPR at PPR@counting.var[i], dummyData,envir=my.envd1)
# }
# # Names expression
# assign("NamesIntgra", NamesIntegrandExpr, envir=my.envd1)
# #dN
# namedX <-NULL
-# for(i in c(1:length(yuimaPPr at Kernel@variable.Integral at var.dx))){
-# if(yuimaPPr at Kernel@variable.Integral at var.dx[i] %in% yuimaPPr at Ppr@counting.var){
-# cond <- yuimaPPr at model@solve.variable %in% yuimaPPr at Kernel@variable.Integral at var.dx[i]
-# namedX<-c(namedX,paste0("d",yuimaPPr at Kernel@variable.Integral at var.dx[i]))
-# dummyData <- diff(as.numeric(yuimaPPr at data@original.data[,cond]))# We consider only Jump
+# for(i in c(1:length(yuimaPPR at Kernel@variable.Integral at var.dx))){
+# if(yuimaPPR at Kernel@variable.Integral at var.dx[i] %in% yuimaPPR at PPR@counting.var){
+# cond <- yuimaPPR at model@solve.variable %in% yuimaPPR at Kernel@variable.Integral at var.dx[i]
+# namedX<-c(namedX,paste0("d",yuimaPPR at Kernel@variable.Integral at var.dx[i]))
+# dummyData <- diff(as.numeric(yuimaPPR at data@original.data[,cond]))# We consider only Jump
# dummyJumpTime <- gridTime[-1][dummyData>0]
# dummyData2 <- diff(unique(cumsum(dummyData)))
# dummyData3 <- zoo(dummyData2,order.by = dummyJumpTime)
-# assign(paste0("d",yuimaPPr at Kernel@variable.Integral at var.dx[i]), dummyData3 ,envir=my.envd1)
+# assign(paste0("d",yuimaPPR at Kernel@variable.Integral at var.dx[i]), dummyData3 ,envir=my.envd1)
# }
# }
# assign("namedX",namedX, envir = my.envd1)
-# assign("var.time",yuimaPPr at Kernel@variable.Integral at var.time,envir=my.envd1)
-# assign("t.time",yuimaPPr at Kernel@variable.Integral at upper.var,envir=my.envd1)
+# assign("var.time",yuimaPPR at Kernel@variable.Integral at var.time,envir=my.envd1)
+# assign("t.time",yuimaPPR at Kernel@variable.Integral at upper.var,envir=my.envd1)
#
# # Covariates
-# if(length(yuimaPPr at Ppr@covariates)>1){
+# if(length(yuimaPPR at PPR@covariates)>1){
# # Covariates should be identified at jump time
# return(NULL)
# }
@@ -357,10 +357,10 @@
# #Covariate
#
# #CountingVariable
-# for(i in c(1:length(yuimaPPr at Ppr@counting.var))){
-# cond <- yuimaPPr at Ppr@counting.var[i] %in% yuimaPPr at model@solve.variable
-# dummyData <-yuimaPPr at data@original.data[,cond]
-# assign(yuimaPPr at Ppr@counting.var[i], dummyData,envir=my.envd1)
+# for(i in c(1:length(yuimaPPR at PPR@counting.var))){
+# cond <- yuimaPPR at PPR@counting.var[i] %in% yuimaPPR at model@solve.variable
+# dummyData <-yuimaPPR at data@original.data[,cond]
+# assign(yuimaPPR at PPR@counting.var[i], dummyData,envir=my.envd1)
# }
#
#
@@ -375,16 +375,16 @@
# #Covariate
#
# #CountingVariable
-# for(i in c(1:length(yuimaPPr at Ppr@counting.var))){
-# cond <- yuimaPPr at Ppr@counting.var[i] %in% yuimaPPr at model@solve.variable
-# dummyData <-yuimaPPr at data@original.data[,cond]
-# assign(yuimaPPr at Ppr@counting.var[i], dummyData,envir=my.envd3)
+# for(i in c(1:length(yuimaPPR at PPR@counting.var))){
+# cond <- yuimaPPR at PPR@counting.var[i] %in% yuimaPPR at model@solve.variable
+# dummyData <-yuimaPPR at data@original.data[,cond]
+# assign(yuimaPPR at PPR@counting.var[i], dummyData,envir=my.envd3)
# }
# #time
-# assign(yuimaPPr at model@time.variable, gridTime, my.envd3)
+# assign(yuimaPPR at model@time.variable, gridTime, my.envd3)
#
# #Model
-# assign("YUIMA.PPR",yuimaPPr,envir=my.envd3)
+# assign("YUIMA.PPR",yuimaPPR,envir=my.envd3)
# assign("namesparam",namesparam,envir=my.envd3)
# assign("gfun",gfun,envir=my.envd3)
# assign("Integrand2",Integrand2,envir=my.envd3)
@@ -459,47 +459,47 @@
# }
-lambdaFromData <- function(yuimaPpr, PprData=NULL, parLambda=list()){
- if(is.null(PprData)){
- PprData<-yuimaPpr at data
+lambdaFromData <- function(yuimaPPR, PPRData=NULL, parLambda=list()){
+ if(is.null(PPRData)){
+ PPRData<-yuimaPPR at data
}else{
- # checklambdaFromData(yuimaPpr,PprData)
+ # checklambdaFromData(yuimaPPR,PPRData)
}
- if(!any(names(parLambda) %in% yuimaPpr at Ppr@allparamPpr)){yuima.stop("1 ...")}
- if(!any(yuimaPpr at Ppr@allparamPpr %in% names(parLambda))){yuima.stop("2 ...")}
- Time <- index(yuimaPpr at data@zoo.data[[1]])
- envPpr <- list()
- dY <- paste0("d",yuimaPpr at Ppr@var.dx)
+ if(!any(names(parLambda) %in% yuimaPPR at PPR@allparamPPR)){yuima.stop("1 ...")}
+ if(!any(yuimaPPR at PPR@allparamPPR %in% names(parLambda))){yuima.stop("2 ...")}
+ Time <- index(yuimaPPR at data@zoo.data[[1]])
+ envPPR <- list()
+ dY <- paste0("d",yuimaPPR at PPR@var.dx)
for(i in (c(1:(length(Time)-1)))){
- envPpr[[i]]<-new.env()
- assign(yuimaPpr at gFun@param at time.var,rep(Time[i+1],i),envir=envPpr[[i]])
- assign(yuimaPpr at Ppr@var.dt,Time[1:i],envir=envPpr[[i]])
- if(length(yuimaPpr at Ppr@covariates)>0){
- for(j in c(1:length(yuimaPpr at Ppr@covariates))){
- cond<-colnames(yuimaPpr at data@original.data)%in%yuimaPpr at Ppr@covariates[[j]]
- assign(yuimaPpr at Ppr@covariates[[j]],
- as.numeric(yuimaPpr at data@original.data[1:(i+1),cond]),
- envir=envPpr[[i]])
+ envPPR[[i]]<-new.env()
+ assign(yuimaPPR at gFun@param at time.var,rep(Time[i+1],i),envir=envPPR[[i]])
+ assign(yuimaPPR at PPR@var.dt,Time[1:i],envir=envPPR[[i]])
+ if(length(yuimaPPR at PPR@covariates)>0){
+ for(j in c(1:length(yuimaPPR at PPR@covariates))){
+ cond<-colnames(yuimaPPR at data@original.data)%in%yuimaPPR at PPR@covariates[[j]]
+ assign(yuimaPPR at PPR@covariates[[j]],
+ as.numeric(yuimaPPR at data@original.data[1:(i+1),cond]),
+ envir=envPPR[[i]])
}
}
- for(j in c(1:length(yuimaPpr at Ppr@counting.var))){
- cond<-colnames(yuimaPpr at data@original.data)%in%yuimaPpr at Ppr@counting.var[[j]]
- assign(yuimaPpr at Ppr@counting.var[[j]],
- as.numeric(yuimaPpr at data@original.data[1:(i+1),cond]),
- envir=envPpr[[i]])
+ for(j in c(1:length(yuimaPPR at PPR@counting.var))){
+ cond<-colnames(yuimaPPR at data@original.data)%in%yuimaPPR at PPR@counting.var[[j]]
+ assign(yuimaPPR at PPR@counting.var[[j]],
+ as.numeric(yuimaPPR at data@original.data[1:(i+1),cond]),
+ envir=envPPR[[i]])
}
- for(j in c(1:length(yuimaPpr at Ppr@var.dx))){
- cond<-c(colnames(yuimaPpr at data@original.data),yuimaPpr at Ppr@var.dt)%in%c(yuimaPpr at Ppr@var.dx,yuimaPpr at Ppr@var.dt)[[j]]
+ for(j in c(1:length(yuimaPPR at PPR@var.dx))){
+ cond<-c(colnames(yuimaPPR at data@original.data),yuimaPPR at PPR@var.dt)%in%c(yuimaPPR at PPR@var.dx,yuimaPPR at PPR@var.dt)[[j]]
if(any(cond[-length(cond)])){
- assign(paste0("d",yuimaPpr at Ppr@var.dx[[j]]),
- diff(as.numeric(yuimaPpr at data@original.data[1:(i+1),cond[-length(cond)]])),
- envir=envPpr[[i]])
+ assign(paste0("d",yuimaPPR at PPR@var.dx[[j]]),
+ diff(as.numeric(yuimaPPR at data@original.data[1:(i+1),cond[-length(cond)]])),
+ envir=envPPR[[i]])
}
if(tail(cond,n=1L)){
- assign(paste0("d",yuimaPpr at Ppr@var.dx[[j]]),
+ assign(paste0("d",yuimaPPR at PPR@var.dx[[j]]),
as.numeric(diff(Time[1:(i+1),cond[-length(cond)]])),
- envir=envPpr[[i]])
+ envir=envPPR[[i]])
}
}
}
@@ -510,19 +510,19 @@
return(parse(text = dum))
}
- IntegKern <- lapply(yuimaPpr at Kernel@Integrand at IntegrandList,IntKernExpr,dY)
- Integrator <- t(as.matrix(eval(parse(text=dY[1]),envir=envPpr[[length(envPpr)]])))
+ IntegKern <- lapply(yuimaPPR at Kernel@Integrand at IntegrandList,IntKernExpr,dY)
+ Integrator <- t(as.matrix(eval(parse(text=dY[1]),envir=envPPR[[length(envPPR)]])))
if(length(dY)>1){
for(i in c(2:length(dY))){
Integrator <- rbind(Integrator,
- t(as.matrix(eval(parse(text=dY[1]),envir=envPpr[[length(envPpr)]]))))
+ t(as.matrix(eval(parse(text=dY[1]),envir=envPPR[[length(envPPR)]]))))
}
}
- assign("Integrator",Integrator,envir=envPpr[[length(envPpr)]])
- assign("Nlamb",length(yuimaPpr at Ppr@counting.var),envir=envPpr[[length(envPpr)]])
- res<-aux.lambdaFromData(param = unlist(parLambda), gFun=yuimaPpr at gFun,
- Kern =IntegKern, intensityParm = yuimaPpr at Ppr@allparamPpr,
- envPpr)
+ assign("Integrator",Integrator,envir=envPPR[[length(envPPR)]])
+ assign("Nlamb",length(yuimaPPR at PPR@counting.var),envir=envPPR[[length(envPPR)]])
+ res<-aux.lambdaFromData(param = unlist(parLambda), gFun=yuimaPPR at gFun,
+ Kern =IntegKern, intensityParm = yuimaPPR at PPR@allparamPPR,
+ envPPR)
return(res)
}
# my.lapply <- function (X, FUN, ...){
@@ -534,26 +534,26 @@
Y = X), higher = (TRUE == "array")))}
dumFun2<-function(X,Y){list2env(Y,envir=X)}
-aux.lambdaFromData <-function(param, gFun, Kern, intensityParm, envPpr,logLikelihood = FALSE){
- lapply(envPpr,FUN=dumFun2,Y=as.list(param))
- lastEnv <- tail(envPpr,n=1L)[[1]]
+aux.lambdaFromData <-function(param, gFun, Kern, intensityParm, envPPR,logLikelihood = FALSE){
+ lapply(envPPR,FUN=dumFun2,Y=as.list(param))
+ lastEnv <- tail(envPPR,n=1L)[[1]]
# gFunVect<- t(simplify2array(my.lapply(gFun at formula, FUN=DumFun,
# Y = lastEnv), higher = (TRUE == "array")))
gFunVect<- matrix(unlist(lapply(gFun at formula, FUN=DumFun,
Y = lastEnv)),nrow=lastEnv$Nlamb,byrow=TRUE)
- # IntKer<- simplify2array(my.lapply(envPpr,function(my.env){
+ # IntKer<- simplify2array(my.lapply(envPPR,function(my.env){
# t(simplify2array(my.lapply(Kern, FUN=DumFun,
# Y = my.env), higher = (TRUE == "array")))}),
# higher = (TRUE == "array")
# )
- # IntKer<- simplify2array(my.lapply(envPpr,myfun3,Kern=Kern),
+ # IntKer<- simplify2array(my.lapply(envPPR,myfun3,Kern=Kern),
# higher = (TRUE == "array")
# )
- # IntKer<- matrix(unlist(my.lapply(envPpr,myfun3,Kern=Kern)),
+ # IntKer<- matrix(unlist(my.lapply(envPPR,myfun3,Kern=Kern)),
# nrow=1,byrow=TRUE)
- IntKer<- matrix(unlist(lapply(envPpr,myfun3,Kern=Kern)),
+ IntKer<- matrix(unlist(lapply(envPPR,myfun3,Kern=Kern)),
nrow=lastEnv$Nlamb)
# lambda <- gFunVect+cbind(0,IntKer)
lambda <- gFunVect+IntKer
Modified: pkg/yuima/R/DataPPR.R
===================================================================
--- pkg/yuima/R/DataPPR.R 2018-05-14 12:46:28 UTC (rev 642)
+++ pkg/yuima/R/DataPPR.R 2018-05-16 02:56:27 UTC (rev 643)
@@ -11,7 +11,7 @@
# y1 at data@original.data
# simprvKern->yuimaPPR
get.counting.data<-function(yuimaPPR,type="zoo"){
- count <- yuimaPPR at Ppr@counting.var
+ count <- yuimaPPR at PPR@counting.var
dimCount <- length(count)
Time_Arrivals_Grid <- index(yuimaPPR at data@zoo.data[[1]])
if(dimCount==1){
@@ -37,7 +37,7 @@
Data <- Data
return(Data)
}
- if(type=="yuima.Ppr"){
+ if(type=="yuima.PPR"){
yuimaPPR at data@original.data <- Data
return(yuimaPPR)
}
@@ -48,8 +48,8 @@
yuima.stop("type is not supported.")
}
-DataPpr <- function(CountVar, yuimaPPR, samp){
- if(!is(yuimaPPR,"yuima.Ppr")){
+DataPPR <- function(CountVar, yuimaPPR, samp){
+ if(!is(yuimaPPR,"yuima.PPR")){
yuima.stop("...")
}
if(!is(samp,"yuima.sampling")){
Modified: pkg/yuima/R/PointProcessClasses.R
===================================================================
--- pkg/yuima/R/PointProcessClasses.R 2018-05-14 12:46:28 UTC (rev 642)
+++ pkg/yuima/R/PointProcessClasses.R 2018-05-16 02:56:27 UTC (rev 643)
@@ -1,6 +1,6 @@
-setClass("info.Ppr",
+setClass("info.PPR",
representation(allparam = "character",
- allparamPpr = "character",
+ allparamPPR = "character",
common ="character",
counting.var = "character",
var.dx = "character",
@@ -14,18 +14,18 @@
IntensWithCount = "logical")
)
-setClass("yuima.Ppr",
- representation(Ppr = "info.Ppr",
+setClass("yuima.PPR",
+ representation(PPR = "info.PPR",
gFun = "info.Map",
Kernel = "Integral.sde"),
contains="yuima"
)
setMethod("initialize",
- "info.Ppr",
+ "info.PPR",
function(.Object,
allparam = character(),
- allparamPpr = character(),
+ allparamPPR = character(),
common = character(),
counting.var = character(),
var.dx = character(),
@@ -38,7 +38,7 @@
RegressWithCount = FALSE,
IntensWithCount = TRUE){
.Object at allparam <- allparam
- .Object at allparamPpr <- allparamPpr
+ .Object at allparamPPR <- allparamPPR
.Object at common <- common
.Object at counting.var <- counting.var
.Object at var.dx <- var.dx
@@ -55,14 +55,14 @@
)
setMethod("initialize",
- "yuima.Ppr",
+ "yuima.PPR",
function(.Object,
- Ppr = new("info.Ppr"),
+ PPR = new("info.PPR"),
gFun = new("info.Map"),
Kernel = new("Integral.sde"),
yuima = new("yuima")){
#.Object at param <- param
- .Object at Ppr <- Ppr
+ .Object at PPR <- PPR
.Object at gFun <- gFun
.Object at Kernel <- Kernel
.Object at data <- yuima at data
@@ -75,5 +75,5 @@
)
setClass("yuima.Hawkes",
- contains="yuima.Ppr"
+ contains="yuima.PPR"
)
Modified: pkg/yuima/R/lambdaPPR.R
===================================================================
--- pkg/yuima/R/lambdaPPR.R 2018-05-14 12:46:28 UTC (rev 642)
+++ pkg/yuima/R/lambdaPPR.R 2018-05-16 02:56:27 UTC (rev 643)
@@ -1,5 +1,5 @@
# auxiliar function for the evaluation of g(t,X_t,N_t, theta)
-internalGfunFromPPrModel <- function(gfun,my.envd3, univariate=TRUE){
+internalGfunFromPPRModel <- function(gfun,my.envd3, univariate=TRUE){
if(univariate){
res<-as.numeric(eval(gfun, envir=my.envd3))
}else{res<-NULL}
@@ -7,7 +7,7 @@
}
# auxiliar function for the evaluation of Kernel
-InternalKernelFromPPrModel<-function(Integrand2,Integrand2expr,my.envd1=NULL,my.envd2=NULL,
+InternalKernelFromPPRModel<-function(Integrand2,Integrand2expr,my.envd1=NULL,my.envd2=NULL,
Univariate=TRUE, ExistdN, ExistdX, gridTime){
if(Univariate){
if(ExistdN){
@@ -37,7 +37,7 @@
# auxiliar function for the evaluation of Intensity
InternalConstractionIntensity<-function(param,my.envd1=NULL,
my.envd2=NULL,my.envd3=NULL){
- paramPPr <- my.envd3$YUIMA.PPR at Ppr@allparamPpr
+ paramPPR <- my.envd3$YUIMA.PPR at PPR@allparamPPR
namesparam <-my.envd3$namesparam
@@ -51,42 +51,42 @@
Integrand2expr<-my.envd3$Integrand2expr
if(ExistdN){
- for(i in c(1:length(paramPPr))){
- cond<-namesparam %in% paramPPr[i]
- assign(paramPPr[i], param[cond], envir = my.envd1 )
+ for(i in c(1:length(paramPPR))){
+ cond<-namesparam %in% paramPPR[i]
+ assign(paramPPR[i], param[cond], envir = my.envd1 )
}
}
if(ExistdX){
- for(i in c(1:length(paramPPr))){
- cond<-namesparam %in% paramPPr[i]
- assign(paramPPr[i], param[cond], envir = my.envd2)
+ for(i in c(1:length(paramPPR))){
+ cond<-namesparam %in% paramPPR[i]
+ assign(paramPPR[i], param[cond], envir = my.envd2)
}
}
#param
- for(i in c(1:length(paramPPr))){
- cond<-namesparam %in% paramPPr[i]
- assign(paramPPr[i], param[cond], envir = my.envd3)
+ for(i in c(1:length(paramPPR))){
+ cond<-namesparam %in% paramPPR[i]
+ assign(paramPPR[i], param[cond], envir = my.envd3)
}
KerneldN<- numeric(length=length(gridTime))
for(i in c(1:length(gridTime))){
- KerneldN[i] <- InternalKernelFromPPrModel(Integrand2,Integrand2expr,my.envd1=my.envd1,my.envd2=my.envd2,
+ KerneldN[i] <- InternalKernelFromPPRModel(Integrand2,Integrand2expr,my.envd1=my.envd1,my.envd2=my.envd2,
Univariate=Univariate, ExistdN, ExistdX, gridTime=gridTime[i])
}
- # KerneldN <- sapply(X=as.numeric(gridTime),FUN = InternalKernelFromPPrModel,
+ # KerneldN <- sapply(X=as.numeric(gridTime),FUN = InternalKernelFromPPRModel,
# Integrand2=Integrand2, Integrand2expr = Integrand2expr,my.envd1=my.envd1,my.envd2=my.envd2,
# Univariate=Univariate, ExistdN =ExistdN, ExistdX=ExistdX )
KerneldCov<- numeric(length=length(gridTime))
- Evalgfun <- internalGfunFromPPrModel(gfun,my.envd3, univariate=Univariate)
+ Evalgfun <- internalGfunFromPPRModel(gfun,my.envd3, univariate=Univariate)
result<-KerneldN+KerneldCov+Evalgfun
}
-InternalKernelFromPPrModel2<-function(Integrand2,Integrand2expr,my.envd1=NULL,my.envd2=NULL,
+InternalKernelFromPPRModel2<-function(Integrand2,Integrand2expr,my.envd1=NULL,my.envd2=NULL,
Univariate=TRUE, ExistdN, ExistdX, gridTime){
if(Univariate){
if(ExistdN){
@@ -118,7 +118,7 @@
InternalConstractionIntensity2<-function(param,my.envd1=NULL,
my.envd2=NULL,my.envd3=NULL){
- paramPPr <- my.envd3$YUIMA.PPR at Ppr@allparamPpr
+ paramPPR <- my.envd3$YUIMA.PPR at PPR@allparamPPR
namesparam <-my.envd3$namesparam
@@ -132,81 +132,81 @@
Integrand2expr<-my.envd3$Integrand2expr
if(ExistdN){
- for(i in c(1:length(paramPPr))){
- cond<-namesparam %in% paramPPr[i]
- assign(paramPPr[i], param[cond], envir = my.envd1 )
+ for(i in c(1:length(paramPPR))){
+ cond<-namesparam %in% paramPPR[i]
+ assign(paramPPR[i], param[cond], envir = my.envd1 )
}
}
if(ExistdX){
- for(i in c(1:length(paramPPr))){
- cond<-namesparam %in% paramPPr[i]
- assign(paramPPr[i], param[cond], envir = my.envd2)
+ for(i in c(1:length(paramPPR))){
+ cond<-namesparam %in% paramPPR[i]
+ assign(paramPPR[i], param[cond], envir = my.envd2)
}
}
#param
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/yuima -r 643
More information about the Yuima-commits
mailing list