tmat_est: Compute transition matrix probabilities

View source: R/hmm_estimates.R

tmat_estR Documentation

Compute transition matrix probabilities

Description

Compute transition matrix probabilities

Usage

tmat_est(joint_prob, state_prob, init_ids, by_factor)

Arguments

joint_prob

An n-1 x Q^2 matrix of joint state probabilities for n observations and Q states

state_prob

An n-1 x Q matrix of initial state probabilities for n observations and Q states

init_ids

A vector of indices of the initial state observation for each trip

by_factor

A vector of factors (link + time bin) of size n (a factor for each row of state_prob).

Value

An m x Q matrix of probabilites for the m levels of by_factor.


melmasri/traveltimeHMM documentation built on Jan. 6, 2023, 10:30 p.m.