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 DNF function. The DNF function creates grids for built-in models. However, this arguments must be provided for custom models. It should contain a list of three sequences: var_mid_points (variance mid-point sequence), j_nums (sequence for the number of jumps), and jump_mid_points (jump mid-point sequence). If there are no variance jumps in the model, set jump_mid_points equal to zero. If there are no jumps in the model, both j_nums and jump_mid_points should be set to zero.

R

Maximum number of jumps used in the numerical integration at each timestep.

rho, delta, alpha, rho_z, nu

See help(dynamicsSVM) for a description of each of these arguments individually. These arguments should be used only for custom models and can be fixed to a certain value (e.g., rho = -0.75). If they are estimated, they should be set to 'var' (e.g., to estimate rho set rho = 'var') and include it in the vector par to be passed to the optim function. See Note for more details on the order in which custom models should receive parameters.

jump_params_list

List of the names of the arguments in the jump parameter distribution is the order that thye are used by the jump_dist function. This is used by DNFOptim to check for parameters that occur both in the jump_dist function and as arguments in drift or diffusion functions.

...

Further arguments to be passed to the optim function. See Note.

Value

optim

Returns a list obtained from R's optim function. See help(optim) for details about the output.

SVDNF

Returns a SVDNF object obtained from running the DNF function at the MLE parameter values. See help(DNF) for details about the output

rho, delta, alpha, rho_z, nu

See help(dynamicsSVM) for a description of each of these arguments individually. If they are estimated, they are set to 'var'. If the parameters were fixed during the estimation, this will return the value at which they were fixed.

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')


[Package SVDNF version 0.1.8 Index]