getModelTable: Summarize Model Statistics for a List of corHMM Objects

View source: R/fitCorrelationTest.R

getModelTableR Documentation

Summarize Model Statistics for a List of corHMM Objects

Description

getModelTable extracts key statistics from a list of fitted corHMM models and returns a summary table. The table includes the number of parameters, log-likelihood, and model selection criteria such as AIC, delta AIC, and AIC weights.

Usage

getModelTable(model_list, type = "AIC")

Arguments

model_list

A list of corHMM objects, each representing a fitted hidden Markov model to phylogenetic and character data.

type

The type of model selection criterion to use. Options are "AIC", "AICc", or "BIC". Default is "AIC".

Details

This function takes a list of models fitted using corHMM and calculates key statistics for comparison across models. Specifically, it calculates the number of parameters, log-likelihood, the chosen model selection criterion (e.g., AIC), the difference in the criterion relative to the best model (delta AIC), and the relative model weight based on the criterion.

getModelTable can handle different model selection criteria such as AIC, AICc, and BIC by specifying the type argument.

Value

A data frame with the following columns:

  • np: The number of parameters in the model.

  • lnLik: The log-likelihood of the model.

  • AIC (or the value of type): The model selection criterion value.

  • dAIC: The difference in the criterion between the model and the best model (i.e., the model with the minimum criterion value).

  • AICwt: The Akaike weights, representing the relative likelihood of the model given the data.

Author(s)

James D. Boyko

See Also

corHMM for fitting hidden Markov models to phylogenetic data.

Examples


# Assuming you have a list of fitted corHMM models:
#models <- list(model1, model2, model3)
#getModelTable(models)
# To use BIC instead of AIC:
#getModelTable(models, type = "BIC")


thej022214/corHMM documentation built on April 13, 2025, 9:37 a.m.