Loop Intial Values over MAXIMIZE Instruction

Econometrics questions and discussions
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Loop Intial Values over MAXIMIZE Instruction

Unread post by TomDoan »

Sorry. With that logic, the test should be k<N not k<=N

compute k=0
while k<N {

It seems to generate one table with five rows and eight columns. Isn't that what you want?
rbelhach95
Posts: 115
Joined: Sat Feb 09, 2013 9:30 am

Re: Loop Intial Values over MAXIMIZE Instruction

Unread post by rbelhach95 »

Thanks soooooooo much Tom, it works beautifully.
Rachid
rbelhach95
Posts: 115
Joined: Sat Feb 09, 2013 9:30 am

Re: Loop Intial Values over MAXIMIZE Instruction

Unread post by rbelhach95 »

Dear Tom,

Sorry to bother you again with this, but I did the simulation (please see the attached code) and I successfully generate the xls table , but the code generates all the 1000 simulated values i.e even when the estimation does not converge and as I understand it the" while loop" should have eliminated those cases. Is there a way to fix this problem or may be do some kind of loop to regenerate the data again until convergence is attained? Your help is appreciated and thank you.
Rachid
Attachments
code_test.PRG
(4.52 KiB) Downloaded 915 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Loop Intial Values over MAXIMIZE Instruction

Unread post by TomDoan »

It generates 1000 because you keep going until you get that many that work. Work through the logic of the WHILE loop.
rbelhach95
Posts: 115
Joined: Sat Feb 09, 2013 9:30 am

Re: Loop Intial Values over MAXIMIZE Instruction

Unread post by rbelhach95 »

Thanks a lot Tom for you help
Rachid
Post Reply