fate-ewi / bayesdfa

Bayesian DFA with Stan
28 stars 13 forks source link

Add offset to fit_dfa() #19

Closed ericward-noaa closed 2 years ago

ericward-noaa commented 2 years ago

From Simon: I'm trying to model zero inflated count data using a DFA MARSS approach (with MARSS package), but I'm unable to build a model where I'm satisfied with the normality of residuals. Your new package bayesdfa seems like a great way around my issue, given the extensive number of distributional families to choose from, but in my model, I need to control for effort (as an offset variable) if I'm to use a Poisson or negative binomial model. Ideally, I would be looking for a Tweedie distribution. Anyways, I'm wondering if it's currently possible to add an offset variable in the fit_dfa() function.

ericward-noaa commented 2 years ago

Fixed with this commit, and added an "offset" argument

https://github.com/fate-ewi/bayesdfa/blob/c87a56c5f6bb445575936f51ec21f35190813629/R/fit_dfa.R#L157