anova.hmm.discnp: Anova for hmm.discnp models

View source: R/anova.hmm.discnp.R

anova.hmm.discnpR Documentation

Anova for hmm.discnp models

Description

Performs a likelihood ratio test to compare two discrete non-parametric hidden Markov models.

Usage

## S3 method for class 'hmm.discnp'
anova(object, ...)

Arguments

object

An object of class “hmm.discnp” as returned by the function hmm().

...

A second object of class “hmm.discnp”. There must be only one such object.

Value

A list with entries

stat

The likelihood ratio statistic.

df

The degrees of freedom.

pvalue

The p-value of the test.

This list has an attribute “details” which is a vector consisting of the first and second log likelihoods and the associated numbers of parameters, in order of these numbers of parameters. (See Warning.)

Warning

Hidden Markov models can be numerically delicate and the fitting algorithm can converge to a local maximum of the likelihood surface which is not the global maximum. Thus it is entirely possible for the log likelihood of the model with the greater number of parameters to be smaller than that of the model with the lesser number of parameters.

Author(s)

Rolf Turner r.turner@auckland.ac.nz

See Also

hmm()

Examples

xxx  <- with(SydColDisc,split(y,f=list(locn,depth)))
fit1 <- hmm(xxx,K=1,itmax=10)
fit2 <- hmm(xxx,K=2,itmax=10)
anova(fit1,fit2)

hmm.discnp documentation built on Sept. 26, 2022, 5:05 p.m.