Tools to enable flexible and efficient hierarchical nowcasting of epidemiological time-series using a semi-mechanistic Bayesian model with support for a range of reporting and generative processes.
Splines are often useful for fitting non-linear relationships and can be more efficient than AR processes etc. It would be nice if epinowcast was able to support them.
Potential solution
There are many tools that support splines in R. The most obvious are the splines package, mgcv, and brms. brms offers this support using functionality from mgcv which indicates that also depending on mgcv may be the way to go (potentially via brms). This would preferred to implementing from scratch as mgcv has wide adoption, a flexible formula interface for its splines, and the functionality in brms works well.
A potential approach that may pay off is to transform the s(..) splines as defined by mgcv into a random effect formulation using this. I think this is also what brms does but this would need to be checked (and again if we can make use of brms to do this we really should.
Feature request
Splines are often useful for fitting non-linear relationships and can be more efficient than AR processes etc. It would be nice if
epinowcast
was able to support them.Potential solution
There are many tools that support splines in R. The most obvious are the
splines
package,mgcv
, andbrms
.brms
offers this support using functionality frommgcv
which indicates that also depending onmgcv
may be the way to go (potentially viabrms
). This would preferred to implementing from scratch asmgcv
has wide adoption, a flexible formula interface for its splines, and the functionality inbrms
works well.A potential approach that may pay off is to transform the
s(..)
splines as defined bymgcv
into a random effect formulation using this. I think this is also whatbrms
does but this would need to be checked (and again if we can make use ofbrms
to do this we really should.