ldhmm.mle: Computing the MLEs

Description Usage Arguments Value Author(s) Examples

View source: R/ldhmm-mle.R

Description

Computing the MLEs using nlm package

Usage

1
2
3
ldhmm.mle(object, x, min.gamma = 1e-06, decode = FALSE, plot.fn = NULL,
  plot.interval = 200, ssm.fn = NULL, print.level = 0, iterlim = 1000,
  ...)

Arguments

object

an ldhmm object that can supply m, param.nbr and stationary.

x

numeric, the observations.

min.gamma

numeric, a minimum transition probability added to gamma to avoid singularity, default is 1e-6.

decode

logical, run decoding after optimization, default is FALSE.

plot.fn

name of the function that takes ldhmm object. It will be called occasionally to track the progress of the fit, mainly by plotting the time series and states. E.g. When one fits the SPX index, the function ldhmm.oxford_man_plot_obs can be used to show the expected volatility vs Oxford-Man realized volatility. Default is NULL.

plot.interval

a positive integer, specifying how often to invoke plot function, default is 200 iterations.

ssm.fn

name of the function that takes ldhmm object. This function is called after the MLLK call. The purpose is to generate an additional score for optimization. E.g. It can be used to separate the states into predefined intervals, modeling a state space model. Default is NULL.

print.level

numeric, this argument determines the level of printing which is done during the minimization process. The default value of 0 means that no printing occurs, a value of 1 means that initial and final details are printed and a value of 2 means that full tracing information is printed.

iterlim

numeric, a positive integer specifying the maximum number of iterations to be performed before the program is terminated.

...

additional parameters passed to the MLE optimizer

Value

an ldhmm object containg results of MLE optimization

Author(s)

Stephen H. Lihn

Examples

1
2
3
4
5
6
7
8
## Not run: 
    param0 <- matrix(c(0.003, 0.02, 1, -0.006, 0.03, 1.3), 2, 3, byrow=TRUE)
    gamma0 <- ldhmm.gamma_init(m=2, prob=c(0.9, 0.1, 0.1, 0.9))
    h <- ldhmm(m=2, param=param0, gamma=gamma0)
    spx <- ldhmm.ts_log_rtn()
    ldhmm.mle(h, spx$x)

## End(Not run)

ldhmm documentation built on March 18, 2018, 1:51 p.m.