Skip to content

Commit

Permalink
version 1.7.10
Browse files Browse the repository at this point in the history
  • Loading branch information
siacus authored and cran-robot committed Apr 12, 2018
1 parent d9288e3 commit bda44a7
Show file tree
Hide file tree
Showing 32 changed files with 3,964 additions and 3,118 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Package: yuima
Type: Package
Title: The YUIMA Project Package for SDEs
Version: 1.6.8
Version: 1.7.10
Depends: R(>= 2.10.0), methods, zoo, stats4, utils, expm, cubature,
mvtnorm
Imports: Rcpp (>= 0.12.1)
Imports: Rcpp (>= 0.12.1), boot (>= 1.3-2)
Author: YUIMA Project Team
Maintainer: Stefano M. Iacus <stefano.iacus@unimi.it>
Description: Simulation and Inference for SDEs and Other Stochastic Processes.
License: GPL-2
URL: http://www.yuima-project.com
LinkingTo: Rcpp, RcppArmadillo
NeedsCompilation: yes
Packaged: 2017-08-11 22:06:38 UTC; jago
Packaged: 2018-04-12 14:11:58 UTC; jago
Repository: CRAN
Date/Publication: 2017-08-16 08:20:11 UTC
Date/Publication: 2018-04-12 15:04:12 UTC
57 changes: 31 additions & 26 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
94d55d512a9ba36caa9b7df079bae19f *COPYING
9a63af0c31973543a4402742616e8b34 *DESCRIPTION
9b8ab1f55b9c292514762c56a21e27ee *NAMESPACE
52d732c1f3eca935acf88ec0f5995de6 *NEWS
28dc9bef0212b7dc999312209e4448ba *DESCRIPTION
8a28e04ffaf289e9990b9d394fe75c47 *NAMESPACE
4631e9abb5c8d825c40d2f84736c9295 *NEWS
778e4b1f228bb32472ce4604c098b304 *R/AllClasses.R
eee3644e6d8be56074eb21822d3210f8 *R/AuxMethodforPPR.R
96f6fe0474453484c238f0970e8038b3 *R/CPoint.R
34a7adc22503022a35452eeb12f5a2ce *R/AuxMethodforPPR.R
4b22fa1f5201199bc7d2afc39b2f41e7 *R/CPoint.R
308eca8353e72a4734ef454719aaf209 *R/CarmaNoise.R
4b3325c594164c1ef9e617555903b7ec *R/CholeskyfGn.R
38e16a8c4997f1af3714ff2af56541c2 *R/ClassCogarch.R
839d2b2310e454330c6cbaff0b51406f *R/DataPPR.R
6176779119bb0e1a7260ead2443e9dff *R/DiagnosticCarma.R
f644bc8c155a88c94b56ecb1e0f6830f *R/DiagnosticCogarch.R
dfe64a7e6dfa0aaabcc0b00eb7a70ffa *R/DiagnosticCogarch.R
01a3e835c0cfd35dce4d34d6763b5fa8 *R/FunctionAndOperators.R
710e193dcd36ab4085d2b3791424c34b *R/IC.R
9f604491f19766f60c180f2dacb746b6 *R/MM.COGARCH.R
Expand All @@ -24,13 +25,14 @@ ac2ace50f9d723532f8e95b44f62fd8c *R/adaBayes.R
ce7188b6122aed3cc988f68aa4425098 *R/asymptotic_term_third.R
c84cc727acac73a45493ff22b55a78a4 *R/asymptotic_term_third_function.R
3878b53ad6b45165671e6992e19bcced *R/bns.test.R
cdaae861c947a38f8189cfc12d18c5db *R/cce.R
c7a3bb80e0a4c609c1b096fd4b067eed *R/cogarchNoise.R
e833f5de3f1c135d087f39478914c3f2 *R/cce.R
c6af79d39ac50ef1575a856db86b183f *R/cogarchNoise.R
81109b8c6aa4eed3435772af607b114e *R/hyavar.R
b08e054f9de744817c7e310b6d4df4a4 *R/lambdaPPR.R
08c716d1769f9a005dceb91274738c31 *R/lambdaPPR.R
febfb56c6f3c5e1d41854337c9ec5e00 *R/lasso.R
80a34e4a1f572dd2115686cee71be223 *R/limiting.gamma.R
99c610684d1fa3c10881eca07c10f7a5 *R/llag.R
0236c9a43acba0806257aee50e7e067d *R/llag.R
ac5c60fa42bbe086b1527a9d796d1043 *R/llag.test.R
461a01b4c243bf315b46950ecb3dcad7 *R/lse.R
5c8ee589ff3f3cb103826124a69e31e3 *R/lseBayes.R
3c152bbf124cced20749e24eee5c6d31 *R/mllag.R
Expand All @@ -39,10 +41,10 @@ febfb56c6f3c5e1d41854337c9ec5e00 *R/lasso.R
ee94a80376999cb09d7a5c984b520687 *R/noisy.sampling.R
e920d4330c561d82faa6695675da2d3b *R/phi.test.R
197ae3a057ce2b8309af7c30a30f3337 *R/poisson.random.sampling.R
dccb8679a411fb8e915736c8510f710e *R/qgv.R
06b3f01286b1bbd25c70c790541d9795 *R/qgv.R
844b55799c23bcb8a771f5c1251a495b *R/qmle.R
55fbbcc961ed77a544a4fe0ae02f7c0c *R/qmleLevy.R
7658b39c1b3cedd74ad3e11b558edd71 *R/rng.R
c9b6711c9495e2f4175e819996a764d2 *R/rng.R
1f567847cf9c65fa085f2f9a50d3e8e6 *R/sampling2grid.R
738c1edcc284afdb385274d952665fbf *R/setCarma.R
5426f7206ebb290a6d3fc11729dbb6c7 *R/setCogarch.R
Expand All @@ -56,7 +58,7 @@ d6d8dbbbeb5b8950787d890e953d38ed *R/sim.euler.space.discretized.R
8085cc8546d7bc91626fbf170354256e *R/simFunctional.R
c8ea28ab1ecee6862b3fb3c00655e21b *R/simulate.R
54dd8c8c84b3fdb70c22b81b0d30a0e3 *R/simulateForMapsIntegralAndOperator.R
c20f7b1d33de51cc14499bfc050a56d8 *R/simulateForPpr.R
5005c5a5cd1b7031f32a1cc9ce0a9ff3 *R/simulateForPpr.R
acd1736734d6d8488ac381687d385676 *R/simulateMultiProcess.R
8ef695059bbac2781e15d7dd3bc69db2 *R/spectralcov.R
f506cf2d30a5f912b5221112d7ae8965 *R/subsampling.R
Expand All @@ -68,21 +70,22 @@ edfabacecae0ebb9b40324f1d499b4b9 *R/yuima.characteristic.R
5a05c5e9259cf78fb32f2a492200d55d *R/yuima.law.r
8c6f372886fa153a017702a331f0077e *R/yuima.model.R
e3c164669a627b3f16fc6da48e714da5 *R/yuima.sampling.R
c1ee1ff8bddedff2f1dd24eeb10782c3 *R/zzz.R
48a7ba9f63b106e188f6c3dc19d836eb *R/zzz.R
b516711f126a8aafd4aae9b758da7824 *data/LogSPX.rda
bce7107dc324a66a94865b56f9e3bbf3 *data/MWK151.rda
ba391af8d40ef453c6d0a726d4170ffa *inst/AUTHORS
19ce1f93b82c4947aba99fe2db1b75ae *inst/CITATION
cd8687c920284fc3afb12b9638fa70d2 *inst/COPYRIGHTS
a06ac359c45cf261f8cf4133be85a14d *inst/ybook/chapter1.R
658aa88d53c02333989cd5984bb70bc0 *inst/ybook/chapter2.R
82e98f36d5111951996837c03c9ece14 *inst/ybook/chapter3.R
ef0d657b58590c9beeb2ead935d0843c *inst/ybook/chapter4.R
dd063c475754f73319b88bc42fbb531a *inst/ybook/chapter1.R
25c2126c4a09e9b0a045980722d9bf07 *inst/ybook/chapter2.R
e81873495abf015d170a3a8e542cfb57 *inst/ybook/chapter3.R
61cf2dd4d1e23c6dd2660e6a88ce4aaf *inst/ybook/chapter4.R
b8ef9ee6ce88d58b1a10067e58f3d277 *inst/ybook/chapter5.R
785a3a52e7086bfb769756a6500eeebf *inst/ybook/chapter6.R
5e1c7aeab1b1a713e6a44e58b41ad1af *inst/ybook/chapter7.R
1c61255f47e28af617c8eee89bc652b3 *man/CPoint.Rd
2ff567959c3646587b4eea7855f3fd40 *man/CarmaNoise.Rd
9ba9fd60ed8ba68c6443500a0708b942 *man/DataPpr.Rd
7d14ee06f14e3f17a0b0f338d58840e5 *man/Diagnostic.Carma.Rd
36a70b3f4695317597d6e0a5ead614f9 *man/Diagnostic.Cogarch.Rd
7efca8f83dbda1691d7d6197bb9468d8 *man/IC.Rd
Expand All @@ -94,23 +97,25 @@ b8ef9ee6ce88d58b1a10067e58f3d277 *inst/ybook/chapter5.R
33b5307defeed5658299f5aec563673e *man/MWK151.Rd
58b1e7a92cf13faf3a1a38ae0b4fd17f *man/adaBayes.Rd
246cfd2ae45d70a7082f4ca558a946a3 *man/asymptotic_term.Rd
cd4c530aef0469d9b86787b2dd843bcd *man/bns.test.Rd
89d505062e1bcda766e5907f67cd6e4f *man/bns.test.Rd
d3a8b9c61dcbd7bba509401886329b9c *man/carma.info-class.Rd
7a733600a5a369bd41c0a0b8cb72243d *man/cce.Rd
d0b7096e4c023eb960131874fa774670 *man/cce.Rd
66d9893fcc3f99afadfb0285fff7ecaf *man/cogarch.est.incr.rd
9a8ac5d2c7a8925aebf561fb96b06f72 *man/cogarch.est.rd
eae56a5cb6a4dce72101ebd9afe3a572 *man/cogarch.info-class.Rd
bd8202a738aeedfafa15fd891d7275bf *man/cogarchNoise.Rd
84580ec56f29e13ab76c7a531bed550b *man/get.counting.data.Rd
fcaeb71b9c9285267d393b0622c2dc63 *man/gmm.rd
4abad16109cdbcba47618b3eafd0b1d8 *man/hyavar.Rd
c8ca3f58a24b8a3cfe9fe60606fac88e *man/hyavar.Rd
1c4e78ccd1e4a859b30ed7600d758644 *man/info.Map.Rd
3ec0b37a2448f49407b55a66f4dc9663 *man/info.Ppr.Rd
e1dd71fad0445b450cb04135cf4d3fb0 *man/lambdaFromData.Rd
bc7cde41c45c90f70d5e39e4363ebbb3 *man/lasso.Rd
83b71e10610d8835a34015fafd55363c *man/limiting.gamma.Rd
61a7c3dc7c72315182c11b9a8f12ba6b *man/llag.Rd
8d62897348883bde29e2e57a2acc4c3d *man/llag.Rd
44e40c5e345965806f965dcd0d599056 *man/llag.test.Rd
3e552e0ee1669b3f39df711f054fae2e *man/lseBayes.Rd
24eb0f714b100f182a0e5d92d874779d *man/mllag.Rd
dbbbbb38cda438a21c5f51ac058051c1 *man/mllag.Rd
569c693d7c318a71b2da6969f4ea0052 *man/mmfrac.Rd
854eef2bdc9e5c4fbe61e78c5f671843 *man/model.parameter-class.Rd
db5127cc4b6ee0cd2ab9f40e52341477 *man/mpv.Rd
Expand Down Expand Up @@ -169,10 +174,10 @@ ffbff0dc3f384712fe20d939c8c9bd84 *man/yuima.sampling-class.Rd
d526b452d20f043cf4f3e85be8345a32 *src/PseudoLoglikCOGARCH.c
3219698b88038e1e387f379bf3b5df2d *src/RcppExports.cpp
9bf5144dbaa6f7c01b99307463cdee07 *src/carmafilter.c
35dad51d480042ba175c1461f7c44f84 *src/cce_functions.c
9a0949594da84284dc11344b72c63950 *src/euler.c
d741728bfa91609fe064b30541ae1cc1 *src/cce_functions.c
92ec12d038970a3a4df5b30443b2db5b *src/euler.c
4c06820c7b26b2f4dae030676c8343f1 *src/minusquasilogl_W1andW2.cpp
fee76cbf3ef99e0b1108c34f536ae0a8 *src/pseudoLogLikCogarchIrregularGrid.cpp
e6bb05e4b4e54b75f046f52469949dd0 *src/qmlecpp.cpp
e07e760a18ac1c05273de1e2aac2b51d *src/rng.c
17426422d8958a7ea2e8d5513c7a8db1 *src/yuima_init.c
667654565119ded208b1697d83cc7eb5 *src/yuima_init.c
9 changes: 6 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ importFrom("graphics", "lines")
importFrom("stats", "qchisq")
importFrom("utils", "relist")

importFrom(boot, boot) # added by YK on Sep. 9, 2017
#08/07/2016
#exportPattern("^[[:alpha:]]+") # NEVER DO THIS AGAIN PLEASE!
#cimport(RcppArmadillo)
Expand Down Expand Up @@ -60,6 +61,7 @@ importFrom(stats, end)
importFrom(stats, start)
importFrom(utils, str)
importFrom(stats, sd)
importFrom("stats", cov2cor) # added by YK on Apr. 12, 2018


exportClasses("yuima",
Expand Down Expand Up @@ -166,6 +168,7 @@ export(bns.test)
export(hyavar) # asymptotic variance estimator for the Hayashi-Yoshida estimator
export(lmm) # Oct. 10, 2015: local methods of moment estimator
export(mllag) # Oct. 10, 2015: multiple lead-lag detector
export(llag.test) # Sep. 9, 2017: testing the absence of lead-lag effects

export(get.zoo.data)

Expand Down Expand Up @@ -194,6 +197,7 @@ export(asymptotic_term)
export(lse)

export(qmle)
export(get.counting.data)
export(quasilogl)
export(phi.test)
export(lasso)
Expand All @@ -202,6 +206,7 @@ export(qmleR)
export(qmleL)
export(qmleLevy)
export(IC)
export(DataPpr)


export(Intensity.PPR)
Expand Down Expand Up @@ -244,8 +249,6 @@ S3method(cbind, yuima)

S3method(plot, yuima.llag) # Oct. 10, 2015
S3method(plot, yuima.mllag) # Oct. 10, 2015

useDynLib(yuima) #,.registration = TRUE)

useDynLib(yuima)


9 changes: 8 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,11 @@
2017/03/27: added IC.R and qmleLevy.R
2017/04/12: fix a bug in sim.euler.R
(re-)added euler.c
2017/04/27: modified qmleLevy.R, qmleLevy.Rd, IC.Rd
2017/04/27: modified qmleLevy.R, qmleLevy.Rd, IC.Rd
2017/09/09: boot package is imported
added llag.test.R, llag.test.Rd
modified llag.R, bns.test.Rd, llag.Rd, mllag.Rd, hyavar.Rd, cce.Rd, cce_functions.c
2018/01/16: a bug in computation of asymptotic variances in llag is fixed
the default value of tol of llag is changed to 1e-7
modified llag.R, llag.Rd, cce_functions.c
2018/04/12: a bug in cce is fixed
57 changes: 43 additions & 14 deletions R/AuxMethodforPPR.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,36 @@ Internal.LogLikPPR <- function(param,my.envd1=NULL,
# IntLambda<-InternalConstractionIntensity(param,my.envd1,
# my.envd2,my.envd3)
Index<-my.envd3$gridTime
Integr1 <- -sum(IntLambda[-length(IntLambda)]*diff(Index),na.rm=TRUE)
Integr1a <- -sum(IntLambda[-length(IntLambda)]*diff(Index),na.rm=TRUE)
Integr1b <- -sum(IntLambda[-1]*diff(Index),na.rm=TRUE)
Integr1 <- (Integr1a+Integr1b)/2
# if(is.nan(Integr1)){
# Integr1 <- -10^6
# }
cond2 <- diff(as.numeric(my.envd3$YUIMA.PPR@data@original.data))
Integr2<- sum(log(IntLambda[-1][cond2>0]),na.rm=TRUE)
if(length(my.envd3$YUIMA.PPR@Ppr@counting.var)>0){
cond1 <- my.envd3$YUIMA.PPR@model@solve.variable %in% my.envd3$YUIMA.PPR@Ppr@counting.var
cond2 <- diff(as.numeric(my.envd3$YUIMA.PPR@data@original.data[,cond1]))
#Integr2<- sum(log(IntLambda[-1][cond2!=0]),na.rm=TRUE)
Integr2 <- sum(log(IntLambda[cond2!=0]),na.rm=TRUE)
#Integr2 <- (Integr2a+Integr2b)/2
}else{
yuima.stop("Spal")
}
# if(is.nan(Integr2)){
# Integr2 <- -10^6
# }
logLik <- Integr1+Integr2
if(is.null(my.envd1$oldpar)){
oldpar <- param
}else{
oldpar <- my.envd1$oldpar
}
ret <- -logLik/sum(cond2,na.rm=TRUE)#+sum((param-oldpar)^2*param^2)/2
cat("\n ",logLik, param)
return(-logLik)

#assign("oldpar",param,envir = my.envd1)

return(ret)
}


Expand Down Expand Up @@ -86,9 +104,9 @@ quasiLogLik.Ppr <- function(yuimaPpr, parLambda=list(), method=method, fixed = l

#CountingVariable
for(i in c(1:length(yuimaPPr@Ppr@counting.var))){
cond <- yuimaPPr@Ppr@counting.var[i] %in% yuimaPPr@model@solve.variable
cond <- yuimaPPr@model@solve.variable %in% yuimaPPr@Ppr@counting.var[i]
dummyData <-unique(yuimaPPr@data@original.data[,cond])[-1]
assign(yuimaPPr@Ppr@counting.var[i], dummyData,envir=my.envd1)
assign(yuimaPPr@Ppr@counting.var[i], rep(1,length(dummyData)),envir=my.envd1)
}
# Names expression
assign("NamesIntgra", NamesIntegrandExpr, envir=my.envd1)
Expand All @@ -101,10 +119,10 @@ quasiLogLik.Ppr <- function(yuimaPpr, parLambda=list(), method=method, fixed = l
namedX<-c(namedX,paste0("d",yuimaPPr@Kernel@variable.Integral@var.dx[i]))
namedJumpTimeX <-c(namedJumpTimeX,paste0("JumpTime.d",yuimaPPr@Kernel@variable.Integral@var.dx[i]))
dummyData <- diff(as.numeric(yuimaPPr@data@original.data[,cond]))# We consider only Jump
dummyJumpTime <- gridTime[-1][dummyData>0]
dummyJumpTime <- gridTime[-1][dummyData!=0]
dummyData2 <- diff(unique(cumsum(dummyData)))
#dummyData3 <- zoo(dummyData2,order.by = dummyJumpTime)
dummyData3 <- dummyData2
dummyData3 <- rep(1,length(dummyData2))
JumpTime <- dummyJumpTime
assign(paste0("d",yuimaPPr@Kernel@variable.Integral@var.dx[i]), dummyData3 ,envir=my.envd1)
assign(paste0("JumpTime.d",yuimaPPr@Kernel@variable.Integral@var.dx[i]), dummyJumpTime ,envir=my.envd1)
Expand All @@ -116,9 +134,13 @@ quasiLogLik.Ppr <- function(yuimaPpr, parLambda=list(), method=method, fixed = l
assign("t.time",yuimaPPr@Kernel@variable.Integral@upper.var,envir=my.envd1)

# Covariates
if(length(yuimaPPr@Ppr@covariates)>1){
if(length(yuimaPPr@Ppr@covariates)>0){
# Covariates should be identified at jump time
return(NULL)
for(i in c(1:length(yuimaPPr@Ppr@covariates))){
cond <- yuimaPPr@model@solve.variable %in% yuimaPPr@Ppr@covariates[i]
condTime <- gridTime %in% my.envd1$JumpTime.dN
assign(yuimaPPr@Ppr@covariates[i],yuimaPPr@data@original.data[condTime,cond],envir = my.envd1)
}
}

}
Expand All @@ -130,7 +152,7 @@ quasiLogLik.Ppr <- function(yuimaPpr, parLambda=list(), method=method, fixed = l

#CountingVariable
for(i in c(1:length(yuimaPPr@Ppr@counting.var))){
cond <- yuimaPPr@Ppr@counting.var[i] %in% yuimaPPr@model@solve.variable
cond <- yuimaPPr@model@solve.variable %in% yuimaPPr@Ppr@counting.var[i]
dummyData <-yuimaPPr@data@original.data[,cond]
assign(yuimaPPr@Ppr@counting.var[i], dummyData,envir=my.envd1)
}
Expand All @@ -145,11 +167,18 @@ quasiLogLik.Ppr <- function(yuimaPpr, parLambda=list(), method=method, fixed = l
# construction my.envd3

#Covariate

dimCov<-length(yuimaPPr@Ppr@covariates)
if(dimCov>0){
for(i in c(1:dimCov)){
cond <- yuimaPPr@model@solve.variable %in% yuimaPPr@Ppr@covariates[i]
dummyData <- yuimaPPr@data@original.data[,cond]
assign(yuimaPPr@Ppr@covariates[i], dummyData,envir=my.envd3)
}
}
#CountingVariable
for(i in c(1:length(yuimaPPr@Ppr@counting.var))){
cond <- yuimaPPr@Ppr@counting.var[i] %in% yuimaPPr@model@solve.variable
dummyData <-yuimaPPr@data@original.data[,cond]
cond <- yuimaPPr@model@solve.variable %in% yuimaPPr@Ppr@counting.var[i]
dummyData <-cumsum(c(as.numeric(yuimaPPr@data@original.data[1,cond]!=0),as.numeric(diff(yuimaPPr@data@original.data[,cond])!=0)))
assign(yuimaPPr@Ppr@counting.var[i], dummyData,envir=my.envd3)
}
#time
Expand Down
4 changes: 2 additions & 2 deletions R/CPoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ CPointOld <- function(yuima, param1, param2, print=FALSE, plot=FALSE){
D <- c(D[1], D, D[length(D)])
D <- ts(D, start=0, deltat=deltat(yuima@data@zoo.data[[1]]))
if(plot)
plot(D,type="l", main="change point statistics")
plot(D,type="l", main="change point statistic")
tau.hat <- index(yuima@data@zoo.data[[1]])[which.min(D)]

return(list(tau=tau.hat, param1=param1, param2=param2))
Expand Down Expand Up @@ -338,7 +338,7 @@ CPoint <- function(yuima, param1, param2, print=FALSE, symmetrized=FALSE, plot=F
else
D <- ts(D, start=0, deltat=deltat(yuima@data@zoo.data[[1]]))
if(plot)
plot(D,type="l", main="change point statistics")
plot(D,type="l", main="change point statistic")
# tau.hat <- index(yuima@data@zoo.data[[1]])[which.min(D)]
tau.hat <- index(D)[which.min(D)]

Expand Down

0 comments on commit bda44a7

Please sign in to comment.