nicholasjclark / mvgam

{mvgam} R 📦 to fit Dynamic Bayesian Generalized Additive Models for time series analysis and forecasting
https://nicholasjclark.github.io/mvgam/
Other
91 stars 11 forks source link

Allow linear predictors for the latent states #14

Closed nicholasjclark closed 11 months ago

nicholasjclark commented 1 year ago

Possibly the best way to do this would be:

  1. Set up the GAM component for the observation model as usual, using dynamic factors for the trends (number of factors specified by the user when supplying the loading matrix)
  2. Set up a second model using dynamic factors with simple observation model that can be easily stripped from the code
  3. Replace names for trend model penalty matrices and Xp so they can be added to the data in the original observation model
  4. Replace b with b_trend in model code so they can be separated; same for lambda etc....
  5. Pull the trend GAM component Stan code into the observation model Stan code and make final changes to the trend models
  6. Return the trend mgcv model for easier prediction
  7. Think about how to visualise smooths etc...
nicholasjclark commented 11 months ago

This has been completed in the latest dev version