Suppose I have a life-cycle model with dual-earners and I would like to compute the mean earnings of male, female and total. I was doing the following:
FnsToEvaluate.ym_coh=@(l_f,aprime,a,zm,zf,eff_j,w_m) w_m*eff_j*z_m;
FnsToEvaluate.yf_coh=@(l_f,aprime,a,zm,zf,eff_j,w_m) w_f*eff_j*z_f*l_f;
FnsToEvaluate.y_coh = @(l_f,aprime,a,zm,zf) ym_coh+yf_coh;
where the static choice is l_f
(female labor supply can be either 0 or 1), the state variables are (a,zm,zf)
and the terms (eff_j,w_m,w_f)
are model parameters. I would like to compute the sum of male and female income, denoted as y_coh
. However, this doesnât work: the toolkit returns an error message saying that it does not find the parameters ym_coh and yf_coh
FAILED TO FIND PARAMETER ym_cohFAILED TO FIND PARAMETER yf_coh
This is of course true, strictly speaking, since ym_coh and yf_coh are not parameters but names in FnsToEvaluate. So it seems that is not possible to pass names of FnsToEvaluate to other FnsToEvaluate, correct? The right way of doing things is then a bit more verbose:
FnsToEvaluate.ym_coh=@(l_f,aprime,a,zm,zf,eff_j,w_m) w_m*eff_j*z_m;
FnsToEvaluate.yf_coh=@(l_f,aprime,a,zm,zf,eff_j,w_m) w_f*eff_j*z_f*l_f;
FnsToEvaluate.y_coh = @(l_f,aprime,a,zm,zf,eff_j,w_m,w_f) w_m*eff_j*z_m+w_f*eff_j*z_f*l_f;
I am asking this since when it comes to GE conditions I think the user is allowed to pass GE names as inputs, if I remember correctly.