Sensitivity analysis using R

Problems with modeling
Post Reply
Nonem
User
User
Posts: 1
Joined: 4 years ago

Sensitivity analysis using R

Post by Nonem »

Hey,

I am trying to set up a flexible sensitivity for a large CGE model using R. Or rather, I am considering whether it would be worth doing in R. Specifically, I want to draw a series of parameters (around 10) from a ND thousands of times and observe the results of the model (Monte-Carlo). However, as well as the parameters I wish the "shock" the model inputs, in order to better understand the sensitivity of the model to the parameters.

I am much better in R than I am in GAMS and there I wonder whether it would be easier to wrap the model in some R code instead. Of is it easy enough to do that in GAMS. If anyone has done this (or worked with GAMS and R) I would appreciate all the input you have :)

Best,
User avatar
Renger
Posts: 639
Joined: 7 years ago

Re: Sensitivity analysis using R

Post by Renger »

Hi
I would do all the computation in Gams, save the results in gdx and use R to do the analysis and graphs.
You can generate random numbers in Gams and use loops (for each parameter you are changing one loop).
See also this post.

Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Post Reply