Simulating Life Paths
Expected values are easily derived from the transition probabilities, but some form of simulation is required to analyse variance of risks. Simulation can be performed by using the transition probability matrices.
Everyone starts in a certain health state, and we sample movements according to the probabilities given at each age. Death state, -1, is absorbing. The other states are:
3-state model:
-
0: healthy
-
1: disabled
5-state model:
-
0: healthy
-
1: ill health but not functionally disabled
-
2: good health but functionally disabled
-
3: ill health and functionally disabled
Simulating State Paths for Individuals
simulate_health_state_paths(trans_probs, init_age, init_state = 0, cohort = 10000)
Parameters:
trans_probs : list
list of transition probability matrices; typically generated by 'get_trans_probs'
init_age : numeric
integer denoting initial age of individual
init_state : numeric
for 3-state model: integer value of 0 or 1, where 0 for healthy state, 1 for disabled state
for 5-state model: 0 for H state, 1 for M state, 2 for D state, 3 for MD state
cohort : numeric
integer denoting number of people in the simulation
Returns:
Matrix (see below for details)
Usage:
# simulation for 10000 males aged 65, initially healthy under the static model
trans_probs <- get_trans_probs(n_states=5, model_type='S', param_file=US_HRS_5, init_age=65, female=0, year = 2012, wave_index = 8, latent = 0)
simulated_path <- simulate_health_state_paths(trans_probs, init_age=65, init_state = 0, cohort = 10000)
The output is a matrix where each row represents one individual's transition into different states at each year of their life.
An example looks like:
Note
The first column of the matrix will always be initial state provided in the parameters.