Good afternoon,
I run a simulation through -simulate-. Pseudo code looks something like this:
prog define myprog
generate data
estimation command 1
return sca B1=_b[]
estimation command 2
return scalar B2=_b[]
end
simulate B1 B2: myprog
I do not have any -capture- statements in my code. Some estimation rounds go wrong (ill conditioned data, it is not a problem of the program, the program is fine), and I see red Xs in the dots. Then I see that I have some missing values of the estimators that I am collecting through -simulate-. The simulation completes right through the errors, which probably is a good default behaviour.
How can I break the simulation when something is wrong, so that I can inspect manually what went wrong? When I press the BREAK button, the simulation stops and I can see the data generated and used for the particular simulation round. How can I do the same with a line of code?
I tried inserting below each estimation command in my simulation program statements such as
if _rc!=0 exit
if _rc!=0 break
e.g.,
prog define myprog
generate data
estimation command 1
if _rc!=0 exit
return sca B1=_b[]
estimation command 2
if _rc!=0 exit
return scalar B2=_b[]
end
simulate B1 B2: myprog
the simulation goes right through them, it seems that they do not make any difference.
Do you have any suggestions?
I run a simulation through -simulate-. Pseudo code looks something like this:
prog define myprog
generate data
estimation command 1
return sca B1=_b[]
estimation command 2
return scalar B2=_b[]
end
simulate B1 B2: myprog
I do not have any -capture- statements in my code. Some estimation rounds go wrong (ill conditioned data, it is not a problem of the program, the program is fine), and I see red Xs in the dots. Then I see that I have some missing values of the estimators that I am collecting through -simulate-. The simulation completes right through the errors, which probably is a good default behaviour.
How can I break the simulation when something is wrong, so that I can inspect manually what went wrong? When I press the BREAK button, the simulation stops and I can see the data generated and used for the particular simulation round. How can I do the same with a line of code?
I tried inserting below each estimation command in my simulation program statements such as
if _rc!=0 exit
if _rc!=0 break
e.g.,
prog define myprog
generate data
estimation command 1
if _rc!=0 exit
return sca B1=_b[]
estimation command 2
if _rc!=0 exit
return scalar B2=_b[]
end
simulate B1 B2: myprog
the simulation goes right through them, it seems that they do not make any difference.
Do you have any suggestions?
Comment