De Nardi, Pashchenko & Porapakkarm (2025) - The Lifetime Costs of Bad Health
Short answer: They have two sub-periods, in the first sub-period you buy health insurance and choose labor supply, in the second you do everything else. Toolkit doesn’t really have ability to handle subperiods (conceptually would be easy to code, but has not been done). You could however lump everything together in one period, and just make is so that instead of choosing insurance purchase this period, you switch it to an endogenous state you chose last period, and you would get much the same model. You then get something toolkit can solve easy enough. [Not really clear in model why you would want labor supply chosen without knowing medical expense shocks, seems more plausible that people choose their current work amount based on their current health? Obvs this is an empirical question.]
Section 4.6 on page 211: The state space for the first sub-period is:
(a,h,tau,upsilon,g;j,p1,p2,p3)
where a is assets a standard endogenous state, h is health status a 3-valued markov, tau is current-health duration a 3-valued markov, upsilon is markov (AR(1) on labor productivity), g is binary valued for ‘insurance offer’ and is a markov (explained below).
j is age, p1,p2,p3 are three dimensions of permanent type (explained below, there are 3x2x3=18 ptypes)
While state-space for the second sub-period also includes:
(i_H, l, x^H)
where i_H is four-valued (essentially a standard endogenous state), l is binary labor supply decision, x^H is an medical expense shock that depends on age and health, so essentially it is an extra dimension to the markov on (h,tau).
Retirees have a simplified version of this.
Health-status, h, is a (permanent-type dependent) markov process. There are three health levels (poor, bad, fair) but you also have to allow the transition probabilities to depend on ‘length of time in current health state’ and they allow up to three periods for this [this is my reading of eqns (2), (4) and (7) together with first paragraph in section 2.4.2, where they say “In our life-cycle model, we use our estimated health process with T = 3, which means 4 years of lagged dependence.”]. They implement this as markov h with 3 states (poor,fair,good health) and a markov tau with 3 states (1,2,3 years in current health). This part is easy enough (although the exact equations to create them are quite complex, they are easy enough from a compute perspective).
g is a markov for ‘can buy insurance’. It depends on age (j), labor producitivity (upsilon) and health (h). This is trivial as just means treating all the markovs (g,upsilon,h,tau) as one big age-dependent markov, but will take a lot care to set it up correctly.
Medical expense shocks x^H are a markov that depends on age, and health. So yet another dimension on our big markov which is now (g,upsilon,h,tau,x^h).
Model period is two-years.
Permanent-type has three dimensions, health type, discount factor and labour productivity, and these are correlated (this is easy for toolkit). They have 3x2x3=18 permanent types total.
Labor supply is 0 or 1.
Earnings has deterministic age component, and AR(1) component, and a permanent type. All easy.
There is standard consumption-savings decision.
Survival probabilities depend on age and health, this won’t be trivial but is do-able (add a state to joint-markov on (h,tau) that is ‘dead’, then use simoptions.conditionalrestrictions so it is omitted from all the model stats).
Summing up: This is a very complicated version of a very simple model. You have one standard endogenous state (two if you count i_H, but the second is just 4-values), and then a big age-dependent markov (g,upsilon,h,tau,x^H), and one decision variable (l), together with permanent types (p1,p2,p3). If it wasn’t for the two-subperiods the toolkit would solve this easily enough, as it is you could ‘merge’ the subperiods and get a very similar model the toolkit would solve just fine (by making i_H something chosen previous period so it becomes a second endogenous state, and allowing choice of l to depend on medical expense shock so it becomes a decision variable). That said, the complexity of setting up the markov correctly should not be underestimated, in principle it is trivial (you are just creating a grid and transition matrix for a discrete first-order markov process), but in practice it involves keeping track of a large number of equations and writing everything out very carefully.
PS. I guess the issue with merging sub-periods and making i_H an endogenous state is that it then depends on previous period upsilon and h rather than this period. But seems unlikely to be an important difference. Not a priori obvious that sub-periods is better/worse than merging the periods. Empirical fit is only thing that would distinguish the two and hard to know whether that would be better or worse.