SCM

Forum: gecon

Monitor Forum | Start New Thread Start New Thread
Solve Differential Equations or Discrete Difference Equations [ Reply ]
By: L Bogaardt on 2021-07-28 10:58
[forum:49482]
I realise the gEcon package is not intended to solve difference equations, but perhaps it is possible.

What I would like to do is to create a simple SIR model, used in epidemiology. This consists of consumers which may be split into 3 categories: susceptible (S), infected (I) and recovered (R).

The difference equations (see also https://cran.r-project.org/web/packages/odin/vignettes/discrete.html) are:
N[] = S[] + I[] + R[];
S[] = S[-1] - beta * S[-1] * I[-1] / N[-1];
I[] = I[-1] + beta * S[-1] * I[-1] / N[-1] - gamma * I[-1];
R[] = R[-1] + gamma * I[-1];

There is no objective function, and also no concept of 'steady-state'. So would something like this be possible within the gEcon framework?

Ultimately, I want to extend this simple model by combining it with the RBC model. This is also described in this article: https://www.nber.org/papers/w26882. But I would like to start at the most basic level with only an SIR model.

Thanks to:
Vienna University of Economics and Business Powered By FusionForge