Description Usage Arguments Value Examples
Specifies the observed SDE data, interobservation times, initial parameter and missing data values to be supplied to sde.post()
.
1 |
model |
An |
x |
An |
dt |
A scalar or length |
m |
Positive integer, such that |
nvar.obs |
A scalar or length |
theta |
A length |
An sde.init
object, corresponding to a list with elements:
data
An ncomp x ndims
matrix of complete data, where ncomp = 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 that nvar.obs.m[(i-1)*m+1] == nvar.obs[ii]
, and that nvar.obs.m[i-1] == 0
if i
is not a multiple of m
.
params
Parameter initial values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.