I would like to propose a small change to the display of iterations in HeteroAgentStationaryEqm_Case1.
Currently, all values are shown with only 4 digits after the comma. For GE prices and GE conditions this is not very informative: quite often you would like to have a precise value for the GE conditions and the prices. For example, if I stop the iterations with Ctrl+C, I get
Current GE prices:
r: 0.0250
tau_s: 0.0438
Current aggregate variables:
K_entre: 1.5303
N_entre: 0.4343
A: 7.0485
L: 1.1633
Y_entre: 1.1621
Entre: 0.0711
Income: 2.3467
IncomeTaxRevenue: 0.3637
ConsTaxRevenue: 0.1965
PensionSpending: 0.1858
Current intermediateEqn variables:
N_corp: 0.7290
K_corp: 5.5182
Current GeneralEqmEqns:
CapitalMarket: -0.0000
GovBudget: 0.0000
and I don’t really see if the GE conditions are very close to zero or not. Moreover, maybe I would like to copy and paste the intermediate results for the GE prices so I can restart the algorithm with better initial conditions later on, but with only 4 digits after the comman, they are very imprecise.
Now the only way of getting precise values for GE prices and GE conditions is to let the GE routine finish, and then one can easily inspect, say p_eqm.r, etc., but this can take quite a long time.
My small suggestion is therefore to display 6 digits after the comman for (i) GE prices and (ii) GE conditions.
Thanks!
You can pause execution, then Step Out (in the debugger) until you reach HeteroAgentStationaryEqm_Case1. You can then examine a variety of conditions there. As you step out of the inner loops you can also see where you are on iteration counts, tolerances (tolX and tolF), etc. Then you can continue without wasting the run.
1 Like
I’ve set it so that the (ii) GE conditions display 6 decimal places.
I didn’t change the GE prices, which still show 4.
Should make it easier to see how close you are to a solution, but also hopefully not over-feedbacking with too many decimal places everywhere.
1 Like
Hi Rob, can I please insist on requesting the 6 decimals after the comma also for the GE prices? 
Sometimes the GE price is the interest rate and something like 0.0254 is 2.54% which is not very precise. There are at least two instances where I think displaying GE prices with more precision helps:
- When I am doing a quick GE/calibration, I typically never let the GE routine complete: at some point when I am in a good direction I cut it and I want to see the precise values for the GE prices.
- I am stress-testing my code for Howard sparse with grid interpolation and I found an instance where the VFI does not converge (I get the warning) but the default grid interpolation command works well. This means my sparse routine may have some problem. The lack of convergence happens while doing GE. So when it happens I cut the GE, copy the values of GE prices displayed on the screen and run again only the value function command. But then it converges successfully, probably because the GE prices are not exactly those which create the lack of convergence.
There are now options:
heteroagentoptions.verboseaccuracy1=4;
heteroagentoptions.verboseaccuracy2=6;
The default of 4 is the number of decimal places used for GEPrices (and AggVars, etc). The default of 6 is for the GECondns. You can set them as you want.
1 Like
Btw, you can also set heteroagentoptions.verbose=2. With =1 it prints the GEPrices after each iteration finishes, along with all the other info like AggVars and GECondns. If you set =2 it instead prints GEPrices at the beginning of each iteration, which helps you see the parameters being attempted and is useful if it is erroring for some parameter settings (is not default just because the timing ‘looks weird’).
1 Like
This is really great, it helps a lot. I am testing it on on inf horizon model