Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future enhancement wishlist #38

Open
nicholasjclark opened this issue Dec 12, 2023 · 6 comments
Open

Future enhancement wishlist #38

nicholasjclark opened this issue Dec 12, 2023 · 6 comments

Comments

@nicholasjclark
Copy link
Owner

nicholasjclark commented Dec 12, 2023

  • Matern covariance functions for GP effects / trends
  • 2d FFT GPs (or even 1d) for complex but stationary GP effects (https://arxiv.org/pdf/2301.08836.pdf)
  • Multivariate normal observation models
  • Move all plots to ggplot2 for broader customisability
  • RW MRF basis for inclusion in dynamic terms and time-varying seasonality
  • Stepwise flat trends (https://github.com/facebook/prophet/pull/1794/files)
  • Linear predictors for other observation parameters (distributional regression)
  • Some easy to follow guidelines on hypothesis testing for ecological models
  • Correlated random effects (add cor option in bs = 're' smooths to estimate random intercepts or slopes from a noncentered mvnormal); handy for 'residual' correlations such as JSDMs
@jonathonmellor
Copy link

Apologies if this is the wrong place (happy to move) to ask this: would it be possible to add the binomial family into the supported families?

Example use case:

Given binary data [0, 1] of absence/presence of a disease, we expect the positivity to change in a sampled population over time, and would like to extract this from the logistic regression while taking the temporal trend into account (currently just doing an mgcv spline, but would prefer a GP, AR, RW).

Love the package, planning to dig more into the forecasting aspect now winter has ended in our northern hemisphere and considering whether we can nowcast as well.

@nicholasjclark
Copy link
Owner Author

Thanks @jonathonmellor, yes absolutely. I'm planning to include Binomial and Beta-Binomial. Happy to make that a first priority if it can be useful to you

@jonathonmellor
Copy link

That would be amazing thank you @nicholasjclark ! For awareness I am also exploring upgrading our RSV age-region stratified forecasting model to mvgam. Great to see how much progress has been made with the package, well done!

@nicholasjclark
Copy link
Owner Author

nicholasjclark commented Mar 22, 2024

Hi again @jonathonmellor, I've pushed a new release that brings support for Binomial, Bernoulli and Beta-Binomial. Still working on documentation to show how these work but you can try them out now if you like. The examples I use in the test script give an idea of how they should function: https://github.com/nicholasjclark/mvgam/blob/master/tests/testthat/test-binomial.R. Thanks again for the suggestion, and do let me know if I can be of help to upgrade your models

@jonathonmellor
Copy link

Amazing, thanks @nicholasjclark! I've had a look for my use case and got the modelling working on a subset of the data. I think I have an additional challenge as this is a survey cohort with irregular temporal sampling - as a result I needed to do 1 series per participant, which makes the majority of the data empty because of the time x series requirement. The end product would be an MRP, with a postratification to the whole population.

Model formula roughly:

is_positive ~ s(time) + s(time, by=age_group) + s(time, by=region), bernoulli family. Was hoping to do a GP instead of a cubic regression with mvgam. Each participant gives a survey response every month, with testing windows opening and closing. So multiple data points (survey responses) per time, the question of "what is a series in this case" became difficult due to the pooling used. I think due to the size of the data (400,000 records) this might not be the best use case, but I am still planning on upgrading our gam forecasting approaches away from smoother extrapolation to the more principled approaches in this package.

@nicholasjclark
Copy link
Owner Author

Thanks @jonathonmellor for the explanation. That does sound interesting and challenging. Would you mind sharing an example of what the data might look like so I can think about whether anything else could be done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants