initial_est: Commpute initial state probabilites

View source: R/hmm_estimates.R

initial_estR Documentation

Commpute initial state probabilites

Description

Commpute initial state probabilites

Usage

initial_est(state_prob, by_factor, subset = NULL)

Arguments

state_prob

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

by_factor

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

subset

A vector indexing the rows of state_prob for which states probabilities are computed using only this subset, defualt is NULL

Value

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

References

Woodard, D., Nogin, G., Koch, P., Racz, D., Goldszmidt, M., Horvitz, E., 2017. Predicting travel time reliability using mobile phone GPS data. Transportation Research Part C, 75, 30-44.

Examples

## Not run: 
x = runif(10)
x = cbind(x, 1-x)
initial_est(x, factor(sample(c("A", "B"), 10, replace=TRUE)))

## End(Not run)

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