replicas model

Problems with syntax of GAMS
Post Reply
chidia
User
User
Posts: 5
Joined: 4 years ago

replicas model

Post by chidia »

Hi,
after generating from a normal distribution a vector of random variables I solve a model. Now I need to replicate the generation and the resulting model 20000 times. how can I do?
Thanks for your help

Diana
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: replicas model

Post by Renger »

Hi Diana
You can use a loop to do this:

Code: Select all

set l Loops /l1*l20000/;

parameter results(l,*);
loop(l, 
    assign the random variable
    solve your model
    save the results in results(l,*)  results(l,"MyResult") = X.L;
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
chidia
User
User
Posts: 5
Joined: 4 years ago

Re: replicas model

Post by chidia »

Thank you for reply!

I did as you said but the model generates the same random variables. So, I have a matrix with 20000 equal results. How can i make generate different variables for each l?
Thanks so much.
Diana
Post Reply