get_alpha_map: Maximum _a posteriori_ estimate of the alpha transition...

View source: R/get_alpha_map.R

get_alpha_mapR Documentation

Maximum a posteriori estimate of the alpha transition probability

Description

Maximum a posteriori estimate of the alpha transition probability

Usage

get_alpha_map(dmat, k = 1, v = 1, p)

Arguments

dmat

a 2 x 2 matrix with observed transitions.

k

shape1 parameter of Beta prior on alpha (k > 0). Default is k = 1.

v

shape2 parameter of Beta prior on alpha (v > 0). Default is v = 1.

p

marginal success probability.

Value

MAP estimate of alpha

Examples

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

maxbiostat/BinaryMarkovChains documentation built on Dec. 11, 2023, 4:29 a.m.