Learn R Programming

LaMa - Latent Markov model toolbox

Copy Link

Version

Install

install.packages('LaMa')

Version

2.0.5

License

GPL-3

Maintainer

Jan-Ole Koslik

Last Published

June 15th, 2025

Functions in LaMa (2.0.5)

make_matrices_dens

Build a standardised P-Spline design matrix and the associated P-Spline penalty matrix
forward_s

Forward algorithm for hidden semi-Markov models with homogeneous transition probability matrix
logLik.qremlModel

Extract log-likelihood from qremlModel object
gamma2

Reparametrised gamma distribution
forward_sp

Forward algorithm for hidden semi-Markov models with periodically varying transition probability matrices
pseudo_res_discrete

Calculate pseudo-residuals for discrete-valued observations
forward_p

Forward algorithm with for periodically varying transition probability matrices
pseudo_res

Calculate pseudo-residuals
qreml

Quasi restricted maximum likelihood (qREML) algorithm for models with penalised splines or simple i.i.d. random effects
predict.LaMa_matrices

Build the prediction design matrix based on new data and model_matrices object created by make_matrices
penalty

Computes penalty based on quadratic form
penalty2

Computes generalised quadratic-form penalties
minmax

AD-compatible minimum and maximum functions
nessi

Loch Ness Monster Acceleration Data
forward_phsmm

Forward algorithm for hidden semi-Markov models with periodically inhomogeneous state durations and/ or conditional transition probabilities
smooth_dens_construct

Build the design and penalty matrices for smooth density estimation
stateprobs

Calculate conditional local state probabilities for homogeneous HMMs
stationary

Compute the stationary distribution of a homogeneous Markov chain
stationary_cont

Compute the stationary distribution of a continuous-time Markov chain
stateprobs_g

Calculate conditional local state probabilities for inhomogeneous HMMs
stateprobs_p

Calculate conditional local state probabilities for periodically inhomogeneous HMMs
qreml_old

Quasi restricted maximum likelihood (qREML) algorithm for models with penalised splines or simple i.i.d. random effects
sdreportMC

Monte Carlo version of sdreport
tpm_g

Build all transition probability matrices of an inhomogeneous HMM
tpm_hsmm

Builds the transition probability matrix of an HSMM-approximating HMM
tpm

Build the transition probability matrix from unconstrained parameter vector
tpm_cont

Calculate continuous time transition probabilities
tpm_emb

Build the embedded transition probability matrix of an HSMM from unconstrained parameter vector
plot.LaMaResiduals

Plot pseudo-residuals
sdreport_outer

Report uncertainty of the estimated smoothing parameters or variances
pred_matrix

Build the prediction design matrix based on new data and model_matrices object created by make_matrices
skewnorm

Skew normal distribution
stationary_p_sparse

Sparse version of stationary_p
tpm_thinned

Compute the transition probability matrix of a thinned periodically inhomogeneous Markov chain.
tpm_phsmm2

Build all transition probability matrices of an periodic-HSMM-approximating HMM
stationary_p

Periodically stationary distribution of a periodically inhomogeneous Markov chain
stationary_sparse

Sparse version of stationary
trex

T-Rex Movement Data
summary.qremlModel

Summary method for qremlModel objects
trigBasisExp

Compute the design matrix for a trigonometric basis expansion
tpm_ihsmm

Builds all transition probability matrices of an inhomogeneous-HSMM-approximating HMM
wrpcauchy

wrapped Cauchy distribution
tpm_hsmm2

Build the transition probability matrix of an HSMM-approximating HMM
tpm_p

Build all transition probability matrices of a periodically inhomogeneous HMM
tpm_phsmm

Builds all transition probability matrices of an periodic-HSMM-approximating HMM
zero_inflate

Zero-inflated density constructer
viterbi

Viterbi algorithm for state decoding in homogeneous HMMs
tpm_emb_g

Build all embedded transition probability matrices of an inhomogeneous HSMM
vm

von Mises distribution
viterbi_p

Viterbi algorithm for state decoding in periodically inhomogeneous HMMs
viterbi_g

Viterbi algorithm for state decoding in inhomogeneous HMMs
cosinor

Evaluate trigonometric basis expansion
forward_ihsmm

Forward algorithm for hidden semi-Markov models with inhomogeneous state durations and/ or conditional transition probabilities
calc_trackInd

Calculate the index of the first observation of each track based on an ID variable
ddwell

State dwell-time distributions of periodically inhomogeneous Markov chains
forward

Forward algorithm with homogeneous transition probability matrix
forward_hsmm

Forward algorithm for homogeneous hidden semi-Markov models
LaMa-package

LaMa: Fast Numerical Maximum Likelihood Estimation for Latent Markov Models
dirichlet

Dirichlet distribution
generator

Build the generator matrix of a continuous-time Markov chain
dgmrf2

Reparametrised multivariate Gaussian distribution
forward_g

General forward algorithm with time-varying transition probability matrix
make_matrices

Build the design and the penalty matrix for models involving penalised splines based on a formula and a data set
gdeterminant

Computes generalised determinant