sde.init {msde} | R Documentation |
MCMC initialization.
Description
Specifies the observed SDE data, interobservation times, initial parameter and missing data values to be supplied to sde.post()
.
Usage
sde.init(model, x, dt, m = 1, nvar.obs, theta)
Arguments
model |
An |
x |
An |
dt |
A scalar or length |
m |
Positive integer, such that |
nvar.obs |
A scalar or length |
theta |
A length |
Value
An sde.init
object, corresponding to a list with elements:
data
An
ncomp x ndims
matrix of complete data, wherencomp = N_m = m * (nobs-1)+1
.dt.m
The complete data interobservation time,
dt_m = dt/m
.nvar.obs.m
The number of variables observed per row of
data
. Note thatnvar.obs.m[(i-1)*m+1] == nvar.obs[ii]
, and thatnvar.obs.m[i-1] == 0
ifi
is not a multiple ofm
.params
Parameter initial values.
Examples
# load Heston's model
hmod <- sde.examples("hest")
# generate some observed data
nObs <- 5
x0 <- c(X = log(1000), Z = 0.1)
X0 <- apply(t(replicate(nObs, x0)), 2, jitter)
dT <- .6
theta <- c(alpha = 0.1, gamma = 1, beta = 0.8, sigma = 0.6, rho = -0.8)
# no missing data
sde.init(model = hmod, x = X0, dt = dT, theta = theta)
# all but endpoint volatilities are missing
sde.init(model = hmod, x = X0, dt = dT, m = 1,
nvar.obs = c(2, rep(1, nObs-2), 2), theta = theta)
# all volatilities missing,
# two completely missing SDE timepoints between observations
m <- 3 # divide each observation interval into m equally spaced timepoints
sde.init(model = hmod, x = X0, dt = dT,
m = m, nvar.obs = 1, theta = theta)