Checks whether input SDE data and parameters are valid.
sde.valid.data(model, x, theta) sde.valid.params(model, theta)
model | An |
---|---|
x | A length- |
theta | A length- |
A logical scalar or vector indicating whether the given data/parameter pair is valid.
# Heston's model # valid data is: Z > 0 # valid parameters are: gamma, sigma > 0, |rho| < 1, beta > .5 * sigma^2 hmod <- sde.examples("hest") # load model theta <- c(alpha = 0.1, gamma = 1, beta = 0.8, sigma = 0.6, rho = -0.8) # valid data x0 <- c(X = log(1000), Z = 0.1) sde.valid.data(model = hmod, x = x0, theta = theta)#> [1] TRUE#> [1] FALSE# valid parameters theta <- c(alpha = 0.1, gamma = 1, beta = 0.8, sigma = 0.6, rho = -0.8) sde.valid.params(model = hmod, theta = theta)#> [1] TRUE# invalid parameters theta <- c(alpha = 0.1, gamma = -4, beta = 0.8, sigma = 0.6, rho = -0.8) sde.valid.params(model = hmod, theta = theta)#> [1] FALSE