# ldhmm.mle: Computing the MLEs In ldhmm: Hidden Markov Model for Financial Time-Series Based on Lambda Distribution

## 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

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

### Example output

```An object of class "ldhmm"
Slot "call":
ldhmm(m = m, param = param, gamma = gamma, delta = delta, stationary = stationary,
mle.optimizer = object@mle.optimizer)

Slot "m":
 2

Slot "param.nbr":
 3

Slot "param":
mu      sigma   lambda
[1,]  0.002661158 0.01955254 1.088500
[2,] -0.001015295 0.03596224 1.332212

Slot "gamma":
[,1]       [,2]
[1,] 0.98632919 0.01367081
[2,] 0.03369705 0.96630295

Slot "delta":
 0.7113905 0.2886095

Slot "stationary":
 TRUE

Slot "mle.optimizer":
 "nlm"

Slot "return.code":
 1

Slot "iterations":
 33

Slot "mllk":
 -8831.681

Slot "AIC":
 -17647.36

Slot "BIC":
 -17598.21

Slot "observations":
numeric(0)

Slot "states.prob":
<0 x 0 matrix>

Slot "states.local":
numeric(0)

Slot "states.global":
numeric(0)

Slot "states.local.stats":
<0 x 0 matrix>

Slot "states.global.stats":
<0 x 0 matrix>
```

ldhmm documentation built on Jan. 11, 2020, 9:16 a.m.