Functions & Formulae

Each applied formula has its own function page, with a signature, implementations, and tests.

Discounted and episode-level occupancy of a time-homogeneous absorbing Markov chain

N_disc = sum_(k=0)^inf (Q / (1 + r)^Delta)^k = (I - Q / (1 + r)^Delta)^(-1)

Maps the transient block Q of a time-homogeneous absorbing Markov chain to the expected number of cycles spent in each transient state, either with each cycle discounted at a constant rate or split into separate episodes of a state that can be left and re-entered. The undiscounted fundamental matrix N, the expected cycles before absorption t = Nc and the absorption probabilities B = NR are HE-FM-ABS-001 and HE-FM-ABS-002, the cohort update s_(t+1) = s_t P is HE-FM-MM-001 and a cohort trace with counting weights and discounting is HE-FM-CSIM-001. Notation follows the Markov Chain article.

  • Discounted fundamental matrix of a time-homogeneous Markov chain at a constant discount rate

    N_disc = (I - Q / (1 + r)^Delta)^(-1); t_disc = N_disc * c

    Discounting membership at the start of cycle k by (1 + r) to the power minus k Delta multiplies every cycle by the same factor, so the discount folds into Q and the series of discounted powers of Q sums to a matrix inverse. Entry i, j of N_disc is the expected discounted number of cycles spent in transient state j by a person starting in transient state i, with the starting cycle counted in full and undiscounted. The row sums t_disc are the discounted expected cycles before absorption, which with death as the only absorbing state is discounted life expectancy in cycles. With r equal to zero the formula returns the fundamental matrix of HE-FM-ABS-001.

  • Episode decomposition of time in a re-enterable state of a Markov chain

    e_ij = n_ii * p_ij; L_j = 1 / (1 - p_jj); T_ij = e_ij * L_j; h_ij = p_ij / (1 - p_ii)

    Splits the expected time that a person starting in transient state i spends in another transient state j into the expected number of separate episodes in j and the mean length of each episode, and gives the probability of ever entering j. Each cycle begun in i leads into j with probability p_ij, so the expected number of entries is n_ii, the expected cycles in i from the fundamental matrix of HE-FM-ABS-001, times p_ij; n_ii already includes the cycles spent in i after each return from j. Each episode lasts a geometric number of cycles with mean 1 divided by 1 minus p_jj.