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

Description Usage Arguments Value Examples

View source: R/timeInStates.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

1
2
3
4
# 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 Sept. 5, 2021, 5:17 p.m.