ldhmm.mle {ldhmm} | R Documentation |
Computing the MLEs
Description
Computing the MLEs using nlm
package
Usage
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 |
decode |
logical, run decoding after optimization, default is |
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 |
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 |
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
## 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)