I want to save each parameter vector that the trace option of ml max shows. The code below saves all the `b' vectors that the maximization process tries, but I only want to keep the parameter vectors that match with the iterations (the ones that the trace option displays, and not the ones in between each iteration). A program like the one below may have 10 iterations to the convergence but thousands of EST matrices get created till convergence. I just want the EST matrices that are associated with each displayed iterations (the parameter vectors displayed by the trace option). How should I edit the code to get that?
Code:
program mlprog args todo b lnf tempvar xb lnsigu2 lnsigw2 mleval `xb' = `b', eq(1) mleval `lnsigu2' = `b', eq(2) mleval `lnsigw2' = `b', eq(3) ..... mat EST$i = `b' global i = $i + 1 ..... end use data, clear global i = 1 ml model ..... mlprog ..... ml max, trace
Comment