Sommer (2016), and how to go to a different value fn on 'death'?

[Before reading Sommer (2016) I had written the following as I was simply guessing from how the question was posed that it was going to look, in the relevant mathematical aspect, like Borella, De Nardi & Yang (2018) - The Aggregate Implications of Gender and Marriage. What I said does not apply to Sommer (2016) but I leave it here as it may still be of interest.]

I expect you mean something like a model in which there are two types of agents, ‘married couple’ and ‘single female’.

With some probability s1, a single female survives and so with 1-s1 they die and get zero utility (or a warm glow of bequest). This is a standard exogenous survival probability.

What you refer to (if I understand correctly) would be that a ‘married couple’ has a survival probability s2, and with probability 1-s2 the husband dies and the household therefore becomes a single female and gets the value function of the single female from then on.

VFI Toolkit cannot quite handle this. Specifically it cannot handle that you have different parameters for different types, but that these types are not permanent. VFI Toolkit can handle different parameters (and much more) for different permanent types. These kind of ‘evolving types’ can easily be done as a markov state, but then you cannot easily make the parameters different as toolkit does not permit parameters to depend on exogenous states.

Note that you could actually ‘fool’ the toolkit to solve this, just it gets really messy (you would have to put all parameters for both married and single into the return function, and then use an if statement for them).

[BDY2018 allow married to single female or to single male, but conceptually this is much the same thing from coding perspective.]