| sdeAIC {sde} | R Documentation |
Implementation of the AIC statistics for diffusion processes.
sdeAIC(X, theta, b, s, b.x, s.x, s.xx, B, B.x, H, S, guess, ...)
X |
a ts object containg a sample path of a sde. |
theta |
a vector or estimates of the parameters. |
b |
drift coefficient of the model as a function of x and theta. |
s |
diffusion coefficient of the model as a function of x and theta. |
b.x |
partial derivative of b as a function of x and theta. |
s.x |
partial derivative of s as a function of x and theta. |
s.xx |
second order partial derivative of s as a function of x and theta. |
B |
initial value of the parameters. See details. |
B.x |
partial deriivative of B as a function of x and theta. |
H |
function of (x,y). It is the integral of B/s. Optional. |
S |
function of (x,y). It is the integral of 1/s. Optional. |
guess |
intial value for the parameters to be estimated. Optional. |
... |
passed to the optim function. Optional. |
the sdeAIC evaluates the AIC statistics for diffusion processes using
Dacunha-Castelle and Florens-Zmirou approximation of the likelihood.
The parameter theta is supposed to be the value oftrue mle estimator
or the minimum contrast estimator of the parameters in the model. If missing
or NULL and guess is specified, theta is estimated using
minimum contrast estimator derived from the locally gaussian approximation
of the density. If both theta and guess are missing, nothing can
be calculated.
If missing, B is calculated as b/s - 0.5*s.x provided that s.x
is not missing.
If missing, B.x is calculated as b.x/s - b*s.x/(s^2)-0.5*s.xx provided
that b.x, s.x and s.xx are not missing.
If missing, both H and S are evaluated numerically.
x |
the value of the AIC statistics |
Stefano Maria Iacus
Dacunha-Castelle, D., Florens-Zmirou, D. (1986) Estimation of the coefficients of a diffusion from discrete observations, Stochastics, 19, 263-284.
Uchida, M., Yoshida, N. (2005) AIC for ergodic diffusion processes from discrete observations, preprint MHF 2005-12, march 2005, Faculty of Mathematics, Kyushu University, Fukuoka, Japan.
set.seed(123)
# true model generating data
dri <- expression(-(x-10))
dif <- expression(2*sqrt(x))
sde.sim(X0=10,drift=dri, sigma=dif,N=1000,delta=0.1) -> X
# we test the true model against two competing models
b <- function(x,theta) -theta[1]*(x-theta[2])
b.x <- function(x,theta) -theta[1]+0*x
s <- function(x,theta) theta[3]*sqrt(x)
s.x <- function(x,theta) theta[3]/(2*sqrt(x))
s.xx <- function(x,theta) -theta[3]/(4*x^1.5)
# AIC for the true model
sdeAIC(X, NULL, b, s, b.x, s.x, s.xx, guess=c(1,1,1),
lower=rep(1e-3,3), method="L-BFGS-B")
s <- function(x,theta) sqrt(theta[3]*+theta[4]*x)
s.x <- function(x,theta) theta[4]/(2*sqrt(theta[3]+theta[4]*x))
s.xx <- function(x,theta) -theta[4]^2/(4*(theta[3]+theta[4]*x)^1.5)
# AIC for competing model 1
sdeAIC(X, NULL, b, s, b.x, s.x, s.xx, guess=c(1,1,1,1),
lower=rep(1e-3,4), method="L-BFGS-B")
s <- function(x,theta) (theta[3]+theta[4]*x)^theta[5]
s.x <- function(x,theta) theta[4]*theta[5]*(theta[3]+theta[4]*x)^(-1+theta[5])
s.xx <- function(x,theta) (theta[4]^2*theta[5]*(theta[5]-1)
*(theta[3]+theta[4]*x)^(-2+theta[5]))
# AIC for competing model 2
sdeAIC(X, NULL, b, s, b.x, s.x, s.xx, guess=c(1,1,1,1,1),
lower=rep(1e-3,5), method="L-BFGS-B")