[Yuima-commits] r732 - pkg/yuima/man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Apr 27 09:18:26 CEST 2020
Author: eguchi
Date: 2020-04-27 09:18:25 +0200 (Mon, 27 Apr 2020)
New Revision: 732
Modified:
pkg/yuima/man/IC.Rd
Log:
modified
Modified: pkg/yuima/man/IC.Rd
===================================================================
--- pkg/yuima/man/IC.Rd 2020-04-27 07:16:51 UTC (rev 731)
+++ pkg/yuima/man/IC.Rd 2020-04-27 07:18:25 UTC (rev 732)
@@ -6,20 +6,29 @@
}
\description{
-Calculate the information criteria BIC, Quasi-BIC (QBIC) and CIC for the stochastic differential equation.
+Information criteria BIC, Quasi-BIC (QBIC) and CIC for the stochastic differential equation.
}
\usage{
-IC(yuima, data = NULL, start, lower, upper, joint = FALSE, rcpp = FALSE, ...)
+IC(drif = NULL, diff = NULL, data = NULL, Terminal = 1, add.settings = list(), start, lower, upper, ergodic = TRUE, stepwise = FALSE, weight = FALSE, rcpp = FALSE, ...)
}
\arguments{
- \item{yuima}{
- a yuima object.
+ \item{drif}{
+ a character vector that each element presents the candidate drift coefficient.
}
+ \item{diff}{
+ a character vector that each element presents the candidate diffusion coefficient.
+ }
\item{data}{
the data to be used.
}
+ \item{Terminal}{
+ terminal time of the grid.
+ }
+ \item{add.settings}{
+ details of model settings(see \code{\link{setModel}}).
+ }
\item{start}{
a named list of the initial values of the parameters for optimization.
}
@@ -29,10 +38,15 @@
\item{upper}{
a named list for specifying upper bounds of the parameters.
}
- \item{joint}{
- perform joint parameter estimation or two stage parameter estimation? (default \code{joint=FALSE})
- If \code{two.step=TRUE}, this argument is not used.
+ \item{ergodic}{
+ whether the candidate models are ergodic SDEs or not(default \code{ergodic=TRUE}).
}
+ \item{stepwise}{
+ specifies joint procedure or stepwise procedure(default \code{stepwise=FALSE}).
+ }
+ \item{weight}{
+ calculate model weight? (default \code{weight=FALSE})
+ }
\item{rcpp}{
use C++ code? (default \code{rcpp=FALSE})
}
@@ -42,22 +56,33 @@
}
\details{
-Please see specifications in \href{https://sites.google.com/site/shoichieguchi90en/specification}{https://sites.google.com/site/shoichieguchi90en/specification}
+Calculate the information criteria BIC, QBIC, and CIC for stochastic processes.
+The calculation and model selection are performed by joint procedure or stepwise procedure.
}
\value{
- \item{par}{
- the estimators of the parameters.
- }
\item{BIC}{
- a value of BIC.
+ values of BIC for all candidates.
}
\item{QBIC}{
- a value of QBIC.
+ values of QBIC for all candidates.
}
\item{CIC}{
- a value of CIC.
+ values of CIC for all candidates.
}
+ \item{model}{
+ information of all candidate models.
+ }
+ \item{par}{
+ quasi-maximum likelihood estimator for each candidate.
+ }
+ \item{weight}{
+ model weights for all candidates.
+ }
+ \item{selected}{
+ selected model number and selected drift and diffusion coefficients
+ }
+
}
\references{
@@ -70,11 +95,15 @@
## BIC, Quasi-BIC
-Eguchi, S. and Masuda, H. (2016). Schwarz type model comparison for LAQ models. \href{https://arxiv.org/abs/1606.01627v2}{arXiv:1606.01627v2}.
+Eguchi, S. and Masuda, H. (2018). Schwarz type model comparison for LAQ models. Bernoulli, 24(3), 2278-2327. \href{https://projecteuclid.org/euclid.bj/1517540475}{https://projecteuclid.org/euclid.bj/1517540475}.
## CIC
Uchida, M. (2010). Contrast-based information criterion for ergodic diffusion processes from discrete observations. Annals of the Institute of Statistical Mathematics, 62(1), 161-187. \href{http://link.springer.com/article/10.1007/s10463-009-0245-1}{http://link.springer.com/article/10.1007/s10463-009-0245-1}
+
+## Model weight
+
+Burnham, K. P. and Anderson, D. R. (2002). Model Selection and Multimodel Inference. Springer-Verlag, New York.
}
\author{
@@ -111,24 +140,26 @@
Xt <- c(Xt, simu.yuima at data@original.data[50*(i-1)+1])
}
+## Candidate coefficients
+diffusion <- c("exp((theta11*cos(x)+theta12*sin(x)+theta13)/2)", "exp((theta11*cos(x)+theta12*sin(x))/2)",
+ "exp((theta11*cos(x)+theta13)/2)", "exp((theta12*sin(x)+theta13)/2)")
+drift <- c("theta21*x + theta22", "theta21*x")
+
## Parameter settings
-para.init <- list(theta11=runif(1,max=-1.5,min=-2.5), theta12=runif(1,max=1.5,min=0.5),
- theta21=runif(1,max=-0.5,min=-1.5))
-para.low <- list(theta11=-7, theta12=-4, theta21=-6)
-para.upp <- list(theta11=3, theta12=6, theta21=4)
+para.init <- list(theta11=runif(1,max=5,min=-5), theta12=runif(1,max=5,min=-5),
+ theta13=runif(1,max=5,min=-5), theta21=runif(1,max=-0.5,min=-1.5),
+ theta22=runif(1,max=-0.5,min=-1.5))
+para.low <- list(theta11=-10, theta12=-10, theta13=-10, theta21=-5, theta22=-5)
+para.upp <- list(theta11=10, theta12=10, theta13=10, theta21=-0.001, theta22=-0.001)
-## Ex.1.1 (dXt = (theta21*x)*dt + exp((theta11*cos(x)+theta12)/2)*dWt)
-mod1 <- setModel(drift="theta21*x", diffusion="exp((theta11*cos(x)+theta12)/2)")
-samp1 <- setSampling(Terminal=Ter, n = N)
-yuima1 <- setYuima(model=mod1, sampling=samp1)
-ic1 <- IC(yuima1, data=Xt, start=para.init, upper=para.upp, lower=para.low, rcpp=TRUE)
+## Ex.1.1 Joint
+ic1 <- IC(drif=drift, diff=diffusion, data=Xt, Terminal=Ter, start=para.init, lower=para.low,
+ upper=para.upp, stepwise = FALSE, weight = FALSE, rcpp = TRUE)
ic1
-## Ex.1.2 (dXt = (theta21*x)*dt + exp(theta11*cos(x)/2)*dWt)
-mod2 <- setModel(drift="theta21*x", diffusion="exp(theta11*cos(x)/2)")
-samp2 <- setSampling(Terminal=Ter, n = N)
-yuima2 <- setYuima(model=mod2, sampling=samp2)
-ic2 <- IC(yuima2, data=Xt, start=para.init, upper=para.upp, lower=para.low, rcpp=TRUE)
+## Ex.1.2 Stepwise
+ic2 <- IC(drif=drift, diff=diffusion, data=Xt, Terminal=Ter, start=para.init, lower=para.low,
+ upper=para.upp, stepwise = TRUE, weight = FALSE, rcpp = TRUE)
ic2
\dontrun{
@@ -140,49 +171,49 @@
Ter <- N*h # terminal sampling time
## Data generate
-diff.coef.matrix <- matrix(c("beta1+1", "beta3*x1", "-beta2*x1", "beta4+1"), 2, 2)
+diff.coef.matrix <- matrix(c("beta1*x1+beta3", "1", "-1", "beta1*x1+beta3"), 2, 2)
drif.coef.vec <- c("alpha1*x1", "alpha2*x2")
mod <- setModel(drift = drif.coef.vec, diffusion = diff.coef.matrix,
state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
samp <- setSampling(Terminal = Ter, n = N)
-yuima <- setYuima(model = mod, sampling = setSampling(Terminal = Ter, n = 50*N))
+yuima <- setYuima(model = mod, sampling = setSampling(Terminal = N^(1/3), n = 50*N))
simu.yuima <- simulate(yuima, xinit = c(1,1), true.parameter = list(alpha1=-2, alpha2=-1,
- beta1=1, beta2=1, beta3=1, beta4=2), subsampling = samp)
+ beta1=-1, beta3=2), subsampling = samp)
Xt <- matrix(0,(N+1),2)
for(i in 1:(N+1)){
Xt[i,] <- simu.yuima at data@original.data[50*(i-1)+1,]
}
+## Candidate coefficients
+diffusion <- list(matrix(c("beta1*x1+beta2*x2+beta3", "1", "-1", "beta1*x1+beta2*x2+beta3"), 2, 2),
+ matrix(c("beta1*x1+beta2*x2", "1", "-1", "beta1*x1+beta2*x2"), 2, 2),
+ matrix(c("beta1*x1+beta3", "1", "-1", "beta1*x1+beta3"), 2, 2),
+ matrix(c("beta2*x2+beta3", "1", "-1", "beta2*x2+beta3"), 2, 2),
+ matrix(c("beta1*x1", "1", "-1", "beta1*x1"), 2, 2),
+ matrix(c("beta2*x2", "1", "-1", "beta2*x2"), 2, 2),
+ matrix(c("beta3", "1", "-1", "beta3"), 2, 2))
+drift <- list(c("alpha1*x1", "alpha2*x2"), c("alpha1*x2", "alpha2*x1"))
+modsettings <- list(state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
+
## Parameter settings
-para.init <- list(alpha1 = runif(1,min=-3,max=-1), alpha2 = runif(1,min=-2,max=0),
- alpha3 = runif(1,min=-1,max=1), beta1 = runif(1,min=0,max=2),
- beta2 = runif(1,min=0,max=2), beta3 = runif(1,min=0,max=2),
- beta4 = runif(1,min=1,max=3))
-para.low <- list(alpha1 = -5, alpha2 = -5, alpha3 = -5, beta1 = 0, beta2 = 0, beta3 = 0, beta4 = 0)
-para.upp <- list(alpha1 = 5, alpha2 = 5, alpha3 = 5, beta1 = 5, beta2 = 5, beta3 = 5, beta4 = 5)
+para.init <- list(alpha1 = runif(1,min=-3,max=-1), alpha2 = runif(1,min=-2,max=0),
+ beta1 = runif(1,min=-2,max=0), beta2 = runif(1,min=0,max=2),
+ beta3 = runif(1,min=1,max=3))
+para.low <- list(alpha1 = -5, alpha2 = -5, beta1 = -5, beta2 = -5, beta3 = 1)
+para.upp <- list(alpha1 = 0.01, alpha2 = -0.01, beta1 = 5, beta2 = 5, beta3 = 10)
-## Ex.2.1
-diff.coef.matrix1 <- matrix(c("beta1+1", "beta3*x1", "-beta2*x1", "beta4+1"), 2, 2)
-drif.coef.vec1 <- c("alpha1*x1", "alpha2*x2+alpha3")
-mod1 <- setModel(drift = drif.coef.vec1, diffusion = diff.coef.matrix1,
- state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
-samp1 <- setSampling(Terminal=Ter, n = N)
-yuima1 <- setYuima(model=mod1, sampling=samp1)
-ic1 <- IC(yuima1, data=Xt, start=para.init, upper=para.upp, lower=para.low, rcpp=TRUE)
-ic1
+## Ex.2.1 Joint
+ic3 <- IC(drif=drift, diff=diffusion, data=Xt, Terminal=Ter, add.settings=modsettings,
+ start=para.init, lower=para.low, upper=para.upp, weight=FALSE, rcpp=FALSE)
+ic3
-## Ex.2.2
-diff.coef.matrix2 <- matrix(c("beta1+1", "beta3*x1", "-beta2*x1", "beta4+1"), 2, 2)
-drif.coef.vec2 <- c("alpha1*x1", "alpha2*x2")
-mod2 <- setModel(drift = drif.coef.vec2, diffusion = diff.coef.matrix2,
- state.variable = c("x1", "x2"), solve.variable = c("x1", "x2"))
-samp2 <- setSampling(Terminal=Ter, n = N)
-yuima2 <- setYuima(model=mod2, sampling=samp2)
-ic2 <- IC(yuima2, data=Xt, start=para.init, upper=para.upp, lower=para.low, rcpp=TRUE)
-ic2
-}
+## Ex.2.2 Stepwise
+ic4 <- IC(drif=drift, diff=diffusion, data=Xt, Terminal=Ter, add.settings=modsettings,
+ start=para.init, lower=para.low, upper=para.upp, stepwise = TRUE, weight=FALSE, rcpp=FALSE)
+ic4
}
+}
\keyword{Information criteria}
More information about the Yuima-commits
mailing list