Robinlovelace / simodels

https://robinlovelace.github.io/simodels
GNU Affero General Public License v3.0
15 stars 4 forks source link

Extend to incorporate models in a GLMM framework #23

Open fcorowe opened 2 years ago

fcorowe commented 2 years ago

There are at least two advantages of enabling this approach:

  1. Poisson models are often used to deal the skeness nature of flow count data, but these data tend to overdispersion which violates the equidispersion assumption of the Poisson model. Negative binomial models can handle this issue.
  2. GLMMs provide flexibility to capture heterogeneity across population groups, origins and destinations.

A short discussion of existing packages that could be used here

Robinlovelace commented 2 years ago

Just had a quick look at this and agree: it would be great to add functions for calculating generalised linear mixed models (GLMM) to capture the skewed nature of OD data. Looking at your examples/discussion, it seems the glmmTMB package is a solid framework for that and allows zero-inflated models. Happy to discuss how to add functionality for that. First we should add support for basic linear models and non-linear models for calculating optimal values in gravity models, right? Then we can add more advanced functions including for GLMMs. I'm also interested in GLMMs implemented in the brms package: https://oliviergimenez.github.io/blog/glmm-brms/

fcorowe commented 2 years ago

Yes, let's enhance the support for linear and non-linear models and then turn our efforts to more advanced techniques. Agree - it would be excellent to do this in the brms framework. I think it will be a main approach going forward.

Robinlovelace commented 1 month ago

Heads-up @fcorowe discussing this with @sebnemEr, a statistician based at University of Cape Town and doing a research visit now, she's made good progress. One for the paper and to discuss later in September!

Robinlovelace commented 1 month ago

Some relevant code here: https://github.com/Robinlovelace/simodels/issues/40