Learn R Programming

sde (version 2.0.18)

cpoint: Volatility change-point estimator for diffusion processes

Description

Volatility change-point estimator for diffusion processes based on least squares.

Usage

cpoint(x, mu, sigma)

Value

X

a list

Arguments

x

a ts object.

mu

a function of x describing the drift coefficient.

sigma

a function of x describing the diffusion coefficient.

Author

Stefano Maria Iacus

Details

The function returns a list of elements containing the discrete k0 and continuous tau0 change-point instant, the estimated volatilities before (theta1) and after (theta2) the time change. The model is assumed to be of the form $${\rm d}X_t = b(X_t){\rm d}t + \theta \sigma(X_t){\rm d}W_t$$ where theta = theta1 for t<=tau0 and theta = theta2 otherwise.

If the drift coefficient is unknown, the model $${\rm d}X_t = b(X_t){\rm d}t + \theta {\rm d}W_t$$ is considered and b is estimated nonparametrically.

Examples

Run this code
tau0 <- 0.6
k0 <- ceiling(1000*tau0)
set.seed(123)
X1 <- sde.sim(X0=1, N=2*k0, t0=0, T=tau0, model="CIR", 
              theta=c(6,2,1))
X2 <- sde.sim(X0=X1[2*k0+1], N=2*(1000-k0), t0=tau0, 
   T=1, model="CIR", theta=c(6,2,3))

Y <- ts(c(X1,X2[-1]), start=0, deltat=deltat(X1))
X <- window(Y,deltat=0.01) 
DELTA <- deltat(X)
n <- length(X)

mu <- function(x) 6-2*x
sigma <- function(x) sqrt(x)

cp <- cpoint(X,mu,sigma)
cp
plot(X)
abline(v=tau0,lty=3)
abline(v=cp$tau0,col="red")

# nonparametric estimation
cpoint(X)

Run the code above in your browser using DataLab