## How do I run sensitivity Analysis for a stochastic model

Problems with modeling
Chinwendu
User
Posts: 2
Joined: 1 year ago

### How do I run sensitivity Analysis for a stochastic model

I am trying to conduct a sensitivity analysis for my model by changing all the parameters and gauging the sensitivity of each change relative to the optimal solution.

I have attached the GAMS model here-in
Attachments
Pre and Post Disaster Resource Allocation (Latest).gms
A two-Stage Stochastic Model

Chinwendu
User
Posts: 2
Joined: 1 year ago

### Re: How do I run sensitivity Analysis for a stochastic model

Please can anyone help me with this?

Renger
Posts: 588
Joined: 4 years ago

### Re: How do I run sensitivity Analysis for a stochastic model

Hi
You could use a nested loop for every parameter you want to do sensitivity analysis. Assume you use P1 and P2 for this and assume they can take the following three values 0.005, 0.01, and 0.0015.

Code: Select all

``````set n /1*3/ Set for the number of values;

parameter
P1s(n) Possible values P1,
P2s(n)  Possible values P2;

* assign the values
P1s("1") = 0.005;
...
alias(n,n2)
loop(n,
P1 = P1s(n);
loop(n2,
P2 = P2s(n);
solve your model, grab the solutions and save them,
);
);
``````

Hope this helps
Renger

[/code]
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist