timeInStates: Calculate proportion of time steps assigned to each state...

View source: R/timeInStates.R

timeInStatesR Documentation

Calculate proportion of time steps assigned to each state (i.e. “activity budgets”)

Description

Calculate proportion of time steps assigned to each state (i.e. “activity budgets”)

Usage

timeInStates(m, by = NULL, alpha = 0.95, ncores = 1)

## S3 method for class 'momentuHMM'
timeInStates(m, by = NULL, alpha = 0.95, ncores = 1)

## S3 method for class 'HMMfits'
timeInStates(m, by = NULL, alpha = 0.95, ncores = 1)

## S3 method for class 'miHMM'
timeInStates(m, by = NULL, alpha = 0.95, ncores = 1)

Arguments

m

A momentuHMM, miHMM, or HMMfits object.

by

A character vector indicating any groupings by which to calculate the proportions, such as individual (“ID”) or group-level (e.g. sex or age class) covariates. Default is NULL (no groupings are used).

alpha

Significance level for calculating confidence intervals of pooled estimates. Default: 0.95. Ignored unless m is a miHMM or HMMfits object.

ncores

Number of cores to use for parallel processing. Default: 1 (no parallel processing). Ignored unless m is a miHMM or HMMfits object.

Value

If m is a momentuHMM object, a data frame containing the estimated activity budgets for each state (grouped according to by). If m is a miHMM or HMMfits object, a list containing the activity budget estimates, standard errors, lower bounds, and upper bounds across all imputations.

Examples

# m is a momentuHMM object (as returned by fitHMM), automatically loaded with the package
m <- example$m
timeInStates(m)
timeInStates(m, by = "ID")


momentuHMM documentation built on Oct. 19, 2022, 1:07 a.m.