DNFOptim.dynamicsSVM {SVDNF} | R Documentation |
Discrete Nonlinear Filter Maximum Likelihood Estimation Function
Description
The DNFOptim
function finds maximum likelihood estimates for stochastic volatility models parameters using the DNF
function.
Usage
## S3 method for class 'dynamicsSVM'
DNFOptim(dynamics, data, N = 50, K = 20, R = 1,
grids = 'Default',
rho = 0, delta = 0, alpha = 0, rho_z = 0, nu = 0, jump_params_list = "dummy",
...)
Arguments
dynamics |
A dynamicsSVM object representing the model dynamics to be used by the optimizer to find maximum likelihood parameter estimates. |
data |
A series of asset returns for which we want to find maximum likelihood estimates. |
N |
Number of nodes in the variance grid. |
K |
Number of nodes in the jump size grid. |
grids |
Grids to be used for numerical integration by the |
R |
Maximum number of jumps used in the numerical integration at each timestep. |
rho , delta , alpha , rho_z , nu |
See |
jump_params_list |
List of the names of the arguments in the jump parameter distribution is the order that thye are used by the |
... |
Further arguments to be passed to the |
Value
optim |
Returns a list obtained from R's |
SVDNF |
Returns a SVDNF object obtained from running the |
rho , delta , alpha , rho_z , nu |
See |
Note
When passing the initial parameter vector par
to the optim
function (via ...
), the parameters should follow a specific order.
For the PittMalikDoucet
model, the parameters should be in the following order: phi
, theta
, sigma
, rho
, delta
, alpha
, and p
.
For the DuffiePanSingleton
model, the parameters should be in the following order: mu
, alpha
, delta
, rho_z
, nu
, omega
, kappa
, theta
, sigma
, and rho
.
All other built-in models can be seen as being nested within these two models (i.e., Heston
and Bates
models are nested in the DuffiePanSingleton
model, while Taylor
and
TaylorWithLeverage
are nested in the PittMalikDoucet
model). Their parameters should be passed in the same order as those in the more general models, minus the parameters not found in these nested models.
For example, the Taylor
model contains neither jumps nor correlation between volatility and returns innovations. Thus, its three parameters are passed in the order: phi
, theta
, and sigma
.
When models = "Custom"
, parameters should be passed in the following order: mu_y_params
, sigma_y_params
, mu_x_params
, sigma_x_params
, rho
, delta
, alpha
, rho_z
, nu
, and jump_params
. If an argument is repeated (e.g., both mu_y_params
and sigma_y_params
use the same parameter), write it only when it first appears in the custom model order.
References
R Core Team (2019). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.
Examples
set.seed(1)
# Generating return data
Taylor_mod <- dynamicsSVM(model = "Taylor", phi = 0.9,
theta = -7.36, sigma = 0.363)
Taylor_sim <- modelSim(t = 30, dynamics = Taylor_mod, init_vol = -7.36)
plot(Taylor_sim$volatility_factor, type = 'l')
plot(Taylor_sim$returns, type = 'l')
# Initial values and optimization bounds
init_par <- c( 0.7, -5, 0.3)
lower <- c(0.01, -20, 0.1); upper <- c(0.99, 0, 1)
# Running DNFOptim to get MLEs
optim_test <- DNFOptim(data = Taylor_sim$returns,
dynamics = Taylor_mod,
par = init_par, lower = lower, upper = upper, method = "L-BFGS-B")
# Parameter estimates
summary(optim_test)
# Plot prediction and filtering distributions
plot(optim_test, type = 'l')