anova.eglhmm {eglhmm}R Documentation

Test for a difference between two fitted eglhmm models.

Description

Apply a likelihood ratio test to determine whether the difference, between the log likelihood statistics of two fitted eglhmm models, is statistically significant.

Usage

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

Arguments

object

An object of class "eglhmm" as returned by eglhmm().

...

Precisely one more object of class "eglhmm", to be compared with object.

Details

This anova method handles only comparisons between two models.) The order of the arguments (i.e. which object is passed as “object” and which is passed as the sole entry of the ... argument) is immaterial.

Value

A list with components

This list has an attribute "details" consisting of a numeric vector of length four with entries ll1 (the smaller of the log likelihoods), ll2 (the larger of the log likelihoods), np1 (the smaller of the parameter counts) and np2 (the larger of the parameter counts).

Author(s)

Rolf Turner rolfturner@posteo.net

Examples

fit1 <- eglhmm(formula=y~locn+depth,data=SydColCount,
               cells=c("locn","depth"),distr="P",K=2,
               method="em",verb=TRUE)
fit2 <- eglhmm(formula=y~locn+depth+ma.com+nh.com+bo.com,data=SydColCount,
               cells=c("locn","depth"),distr="P",K=2,
               method="em",verb=TRUE)
anova(fit1,fit2)

[Package eglhmm version 0.1-3 Index]