View source: R/recurrence_time_pmf.R
recurrence_time_pmf | R Documentation |
Computes the p.m.f of the recurrence time T i.e., number of iterations to come back to state 0 in a two-state Markov chain if on X_0 = 0. Result is given in page 83 of Cox & Miller (1965).
recurrence_time_pmf(x, alpha, beta, log = FALSE)
x |
number greater than 0 of iterations until hitting 0 again. |
alpha |
a transition probability (between 0 and 1). |
beta |
a transition probability (between 0 and 1). |
log |
logical if TRUE, probabilities p are given as log(p). |
(log) p, where p = Pr(T = x).
Cox, D. R., & Miller, H. D. (1977). The Theory of Stochastic Processes (Vol. 134). CRC press.
occupation_time_pmf
, max_transitions_pmf
times <- 1:50
timeprobs <- recurrence_time_pmf(x = times, alpha = .02, beta = .2)
plot(times, timeprobs, type = "h", lwd = 3,
ylab = "Probability", xlab = expression(T), main = "Recurrence time")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.