Performs likelihood ratio tests comparing nested models. When given a single model, reports the log-likelihood and degrees of freedom. When given multiple models, performs sequential likelihood ratio tests.
Usage
# S3 method for class 'femtofit'
anova(object, ...)Details
Models should be provided in order from simplest (fewest parameters) to most complex. The likelihood ratio test compares each model to the previous one.
Examples
if (FALSE) { # \dontrun{
# Compare nested models
m1 <- fit(function(mu) loglik_normal(mu, 1, x), c(mu = 0))
m2 <- fit(function(mu, sigma) loglik_normal(mu, sigma, x), c(mu = 0, sigma = 1))
anova(m1, m2) # LRT comparing m1 vs m2
} # }