covariate_ci: Compute transition probability matrices for plotting

Description Usage Arguments Value

View source: R/covariate_analysis.R

Description

This function computes the transition probability matrix entries with their confidence intervals for different covariate values in order to plot how they change. THIS FUNCTION DOES NOT SUPPORT UNPOOLED TRANSITION PROBABILITY MATRICES.

Usage

1
2
3
4
5
6
7
8
covariate_ci(
  hmm,
  len_covariates,
  design,
  n = 100,
  level = 0.975,
  state_dep_dist_pooled = FALSE
)

Arguments

len_covariates

A value indicating how many covariate values will be used.

design

A list of design matrices, one for each subject which indicate the values of the each of the covariates (column) at each point in time (row).

num_states

The number of states in the desired HMM.

num_subjects

The number of subjects/trials that generated the data.

num_covariates

The number of covariates in the data that the transition probability matrix depends on.

conf_intervals

A list of the confidence intervals for each fitted parameter of the HMM as outputted by the functions norm_ci, gam_ci, or gam0_ci.

Value

A list of 3 matrices, one for the estimate and the upper, and lower confidence interval, with the rows of the matrices containing the entries of the transition probability matrices at each covariate value.


simonecollier/lizardHMM documentation built on Dec. 23, 2021, 2:24 a.m.