Loop over parameters to find maximized welfare

@MichelleHuang wants to do a grid search here. I just want to point out for future reference that the conditional welfare measure mentioned in the two previous posts is not general. It is conditional welfare in the deterministic steady. If you want to compute conditional welfare in other points, you have to use the simult_-function as in


Now to the questions I did not yet answer above:

  1. Iacoviello did only do a first order approximation as he did not conduct a welfare analysis. At first order, there is certainty equivalence so that he could multiply all shocks by 100. That is not allowed at second order. 1% is 0.01.
  2. I don’t understand the question about stoppping. The code is designed to filter out error codes.
  3. The code for displaying you pasted cannot work, because rho is not known. You want to have
    num2str(rhogrid(i)).