Hi,
I have a question regarding plotting solutions for different time periods. After solving a model, say IndShockConsumerType, how do I extract the consumption functions for different periods?
Take the example:
import numpy as np
from copy import deepcopy
from HARK.ConsumptionSaving.ConsIndShockModel import IndShockConsumerType, ConsumerSolution, init_idiosyncratic_shocks
import time # to time
from HARK.utilities import plot_funcs_der, plot_funcs
import matplotlib.pyplot as plt
init_indshock = dict(
init_idiosyncratic_shocks,
**{
### No income shocks
"PermGroFac": [1.0],
"PermShkCount": 7,
"PermShkStd": [0.0],
"TranShkStd": [0.0],
"UnempPrb": 0.0,
"UnempPrbRet": 0.0,
"LivPrb": [1.0],
### For simulation
"aNrmInitMean": 0.0,
"aNrmInitStd": 0.0,
"T_sim": 5,
"AgentCount": 10,
### Others
"BoroCnstArt": 0,
}
)
IndShockExample = IndShockConsumerType(**init_indshock)
IndShockExample.update_income_process()
IndShockExample.solve()
To get the consumption Function, I use:
IndShockExample.solution[0].cFunc
But how do I get the cFunc for different periods? Say t=0, 1, 2, 3, 4
LifecycleExample
you should be able to do what Mateo suggested