Skip to content

Transition Probability Matrix

The Cox Hazard model produces continuous hazard rates that will be discretized to produce piecewise constant rates.

The process is repeated for each of the transition rates (4 transitions for 3-state model, and 12 transitions for 5-state model). The rates at each age are combined into transition rate matrices for that age. Taking the matrix exponential changes that to transition probability matrices.

Note

The transition probability matrices are deterministic for each individual with the Static and Trend models, but stochastic with the Frailty model.


Get a List of Transition Probability Matrices from Initial Age to Age 110

get_trans_probs(n_states, model_type, param_file, init_age, female, year = 2012, wave_index = 8, latent = 0)

   Parameters

     n_states : numeric

       take values 3 or 5, use 3 for 3-state model, and 5 for 5-state model

     model_type : character

       'S' for static model, 'T' for trend model, 'F' for frailty model

     param_file : dataframe

       File path, or dataframe/tibble of parameters (generally, use US_HRS or china_CLHLS for the 3-state model, and use US_HRS_5 for the 5-state-model)

     init_age : numeric

       integer denoting the initial age

     female : numeric

       0 for male, 1 for female

     year : numeric

       integer denoting current year, required in 3-state model and ignored in 5-state model

     wave_index : numeric

       integer for the wave index = (interview year - 1998)/2 + 1, required in 5-state model and ignored in 3-state model

     latent : numeric

       initial value of latent factor, normally take the value 0

   Returns:

     List of 3x3 or 5x5 transition probability matrices, from the initial age to age 110.

   Usage:

# for male aged 65 at wave index i, using the 5-state frailty model with US_HRS_5 parameters
trans_probs=get_trans_probs(n_states=5, model_type='F', param_file=US_HRS_5, init_age=65, female=0, year = 2012, wave_index = 8, latent = 0)