| dirichletChain | R Documentation |
Generates a Markov chain whose rows are drawn from a truncated Dirichlet
process with the stick-breaking (GEM) construction, as
MarkovChain.dirichlet_process() of PyDTMC does.
dirichletChain(
n,
diffusion,
states = NULL,
diagonalBias = NULL,
shiftConcentration = FALSE,
byrow = TRUE,
seed = NULL,
name = "Dirichlet process chain"
)
n |
The number of states, at least 2. It can be omitted when
|
diffusion |
The concentration parameter |
states |
An optional character vector of |
diagonalBias |
An optional positive number |
shiftConcentration |
If |
byrow |
Whether the transition matrix of the result is stored by rows (the default) or by columns. |
seed |
An optional whole number, as in
|
name |
The |
For each row, b_1, \ldots, b_n are independent
\mathrm{Beta}(1, \alpha) draws and the weights are
w_j = b_j \prod_{k < j} (1 - b_k),
normalised to sum to one (the truncation at n states leaves out the
mass \prod_k (1 - b_k)). PyDTMC only accepts whole values of
\alpha between 1 and n; any positive value is accepted here,
since the construction is defined for every \alpha > 0.
A markovchain object with n states.
Sethuraman, J. (1994). A constructive definition of Dirichlet priors. Statistica Sinica, 4(2), 639-650.
randomMarkovChain
dirichletChain(5, diffusion = 2, seed = 1)
# a chain that tends to stay in its current state
dirichletChain(5, diffusion = 2, diagonalBias = 5, seed = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.