CIreal: Confidence intervals for the natural (i.e., real) parameters

Description Usage Arguments Details Value Examples

View source: R/CIreal.R

Description

Computes the standard errors and confidence intervals on the real (i.e., natural) scale of the data stream probability distribution parameters, as well as for the transition probabilities parameters. If covariates are included in the probability distributions or TPM formula, the mean values of non-factor covariates are used for calculating the natural parameters. For any covariate(s) of class 'factor', then the value(s) from the first observation in the data are used.

Usage

1
2
3
4
5
6
7
CIreal(m, alpha = 0.95, covs = NULL, parms = NULL)

## Default S3 method:
CIreal(m, alpha = 0.95, covs = NULL, parms = NULL)

## S3 method for class 'hierarchical'
CIreal(m, alpha = 0.95, covs = NULL, parms = NULL)

Arguments

m

A momentuHMM, momentuHierHMM, or miSum object

alpha

Significance level of the confidence intervals. Default: 0.95 (i.e. 95% CIs).

covs

Data frame consisting of a single row indicating the covariate values to be used in the calculations. By default, no covariates are specified.

parms

Optional character vector indicating which groups of real parameters to calculate confidence intervals for (e.g., 'step', 'angle', 'gamma', 'delta', etc.). Default: NULL, in which case confidence intervals are calculated for all groups of parameters in the model.

Details

For any covariates that are not specified using covs, the means of the covariate(s) are used (unless the covariate is a factor, in which case the first factor in the data is used).

Value

A list of the following objects:

...

List(s) of estimates ('est'), standard errors ('se'), and confidence intervals ('lower', 'upper') for the natural parameters of the data streams

gamma

List of estimates ('est'), standard errors ('se'), and confidence intervals ('lower', 'upper') for the transition probabilities

delta

List of estimates ('est'), standard errors ('se'), and confidence intervals ('lower', 'upper') for the initial state probabilities

hierGamma

A hierarchical data structure Node including a list of estimates ('est'), standard errors ('se'), and confidence intervals ('lower', 'upper') for the transition probabilities for each level of the hierarchy (only applies if m is a hierarchical model object)

hierDelta

A hierarchical data structure Node including a list of estimates ('est'), standard errors ('se'), and confidence intervals ('lower', 'upper') for the initial state probabilities for each level of the hierarchy (only applies if m is a hierarchical model object)

Examples

1
2
3
4
5
6
7
8
9
# m is a momentuHMM object (as returned by fitHMM), automatically loaded with the package
m <- example$m

ci1<-CIreal(m)

# specify 'covs'
ci2<-CIreal(m,covs=data.frame(cov1=mean(m$data$cov1),cov2=mean(m$data$cov2)))

all.equal(ci1,ci2)

momentuHMM documentation built on July 7, 2021, 9:06 a.m.