gavinsimpson / gratia

ggplot-based graphics and useful functions for GAMs fitted using the mgcv package
https://gavinsimpson.github.io/gratia/
Other
206 stars 28 forks source link

Documentation for `gratia::posterior_samples()` behaviour with offsets #232

Closed gavinsimpson closed 1 year ago

gavinsimpson commented 1 year ago

Add a note to ?posterior_samples etc to indicate how offset terms in GAMs are handled.

Discussed in https://github.com/gavinsimpson/gratia/discussions/231

Originally posted by **jonathonmellor** August 11, 2023 Hi Gavin, Really appreciate the work in this package - hoping to move our code to using it as much as possible. Would it be possible to document (or happy to raise a PR if it's explained here) how `gratia::posterior_samples` behaves with predictions from models using an offset? I'm unclear on whether the offset is ignored, or whether the offset is used to convert back to, for example, counts, before sampling from the error distribution?