If I want to compute the average of a variable, for example assets, for working age people, I can write
FnsToEval.assets = @(aprime,a,z) a;
simoptions.conditionalrestrictions.working = @(aprime,a,z,agej,Jr) (agej<=Jr-1);
But say I have a more complicated setup where for some variables I want to compute the average conditional on z (z=0,1) and on working age (i.e. j<=Jr-1) but for other variables I want to compute simply the average conditional on health. Then I have to define multiple conditional restrictions, like
simoptions.conditionalrestrictions.z1 = @(aprime,a,z) (z==1);
simoptions.conditionalrestrictions.z2 = @(aprime,a,z) (z==2);
simoptions.conditionalrestrictions.working_z1 = @(aprime,a,z,agej,Jr) (agej<=Jr-1 && z==1);
simoptions.conditionalrestrictions.working_z2 = @(aprime,a,z,agej,Jr) (agej<=Jr-1 && z==2);
Is there a simpler method of doing this with the toolkit? Problem is that adding conditional restrictions slows down the computation quite a bit.