Loop Intial Values over MAXIMIZE Instruction

Econometrics questions and discussions

Re: Loop Intial Values over MAXIMIZE Instruction

Postby TomDoan » Tue Mar 05, 2013 12:09 pm

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?
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Loop Intial Values over MAXIMIZE Instruction

Postby rbelhach95 » Tue Mar 05, 2013 12:46 pm

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

Re: Loop Intial Values over MAXIMIZE Instruction

Postby rbelhach95 » Thu Mar 07, 2013 12:02 pm

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 14 times
rbelhach95
 
Posts: 15
Joined: Sat Feb 09, 2013 10:30 am

Re: Loop Intial Values over MAXIMIZE Instruction

Postby TomDoan » Fri Mar 08, 2013 7:53 am

It generates 1000 because you keep going until you get that many that work. Work through the logic of the WHILE loop.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Loop Intial Values over MAXIMIZE Instruction

Postby rbelhach95 » Sun Mar 10, 2013 3:01 pm

Thanks a lot Tom for you help
Rachid
rbelhach95
 
Posts: 15
Joined: Sat Feb 09, 2013 10:30 am

Previous

Return to General Econometrics

Who is online

Users browsing this forum: No registered users and 1 guest