recurrence_time_pmf: Probability mass function of the recurrence time.

View source: R/recurrence_time_pmf.R

recurrence_time_pmfR Documentation

Probability mass function of the recurrence time.

Description

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).

Usage

recurrence_time_pmf(x, alpha, beta, log = FALSE)

Arguments

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).

Value

(log) p, where p = Pr(T = x).

References

Cox, D. R., & Miller, H. D. (1977). The Theory of Stochastic Processes (Vol. 134). CRC press.

See Also

occupation_time_pmf, max_transitions_pmf

Examples

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")

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