sample_p: Sample transition matrices of state process

Description Usage Arguments Value

Description

Produce a Gibbs sample of transition matrices of state process under all environments of a subject

Usage

1
sample_p(p_all, q, prior_mat, et, st, ntrial, nstate, nenv)

Arguments

p_all

a matrix of current update of transition matrices of state process, transition matrices under different environments are stacked vertically

q

a matrix of current update of transition matrix of environment process

prior_mat

a matrix of concentration parameters of Dirichlet priors, each row corresponds to a row of transition matrix

et

a vector of current update of environment process of a subject

st

a vector of current update of state process of a subject

ntrial

total number of trials

nstate

total number of states

nenv

total number of environments

Value

A list with the following components:

p

a Gibbs sample of transition matrices of state process

accept

a binary indicator vector of acceptance or rejection of proposed sample of each row of transition matrices in the independent Metropolis–Hastings algorithm


zhifeiyan/WeibullHM documentation built on May 4, 2019, 11:21 p.m.