Semi-exogenous shocks with permanent types

Thanks for the tip!

I’m a bit wary of hardcoding

alreadygridvals_semiexo=0

though.
In my example I set semiz_grid as a stacked column grid, with size [sum(n_semiz),1], so it is ok to tell the code that semiz is not already in gridvals format.
But if I set semiz_grid as joint grid, with size [prod(n_semiz),length(n_semiz)]?

At line 79 we are filling in defaults. If you are doing non-default things, it’s on you to tell the toolkit what you are doing. My $0.02.

1 Like

I think we should do something like this:

  • Check if user’s provided semiz_grid is stacked column grid or joint grids.
  • If it is joint grids, set alreadygridvals_semiexo=1, otherwise equal to 0.

The only problem is that I didn’t find where options.alreadygridvals_semiexo is first set in the code. Maybe I should just see how this is done for the related variable alreadygridvals.

I solved the problem by adding the following code in LifeCycleProfiles_FHorz_Case1_PType around lines 163-165:

if ~isfield(simoptions,'alreadygridvals_semiexo')
    simoptions.alreadygridvals_semiexo=0; 
end

This is exactly the same logic as the existing

if ~isfield(simoptions,'alreadygridvals')
    simoptions.alreadygridvals=0;
end

Thanks @MichaelTiemann for your suggestions.
@robertdkirkby Can you confirm that this change is correct?

1 Like

Just merged @aledinola pull request

Pretty sure this solve all of this.

Everything looked right to me around setting the alreadygridvals_semiexo defaults.

Tell me if anything is still outstanding here, my impression is that pull request covers everything being discussed in this thread.

1 Like