View source: R/get_alpha_map.R
get_alpha_map | R Documentation |
Maximum a posteriori estimate of the alpha transition probability
get_alpha_map(dmat, k = 1, v = 1, p)
dmat |
a 2 x 2 matrix with observed transitions. |
k |
shape1 parameter of Beta prior on alpha (k > 0). Default is |
v |
shape2 parameter of Beta prior on alpha (v > 0). Default is |
p |
marginal success probability. |
MAP estimate of alpha
library(markovchain)
X <- sample(c(0, 1), 10000, replace = TRUE)
obs.trans <- createSequenceMatrix(X, sanitize = FALSE, possibleStates = c("0", "1"))
get_alpha_map(dmat = obs.trans, p = 1/2) ## should be close to 1/2 because of independent sampling
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.