Scale sensitivity of Tweedie models in INLA (kg vs tonnes)

28 views
Skip to first unread message

Marcelo Soeth

unread,
Oct 25, 2025, 12:55:50 AM (5 days ago) Oct 25
to R-inla discussion group

Dear members,

I’m relatively new to INLA and am fitting spatial models with the Tweedie family using INLA / inlabru / INLAspacetime. I’ve found that changing only the units of the response (kilograms vs tonnes) leads to noticeably different posterior predictions, whereas Gaussian models give nearly identical predictions after rescaling.

I’m trying to understand whether this Tweedie behaviour is due to the mean–variance relationship (parameters p and φ), prior/parameterization choices, or something about how predictions are formed on the response scale (e.g., using ~ exp(…) vs a family-provided inverse link).

Attached is a minimal, reproducible example.

What I observe

  • Tweedie: predictions from the kg fit and the tonnes fit (converted ×1000 to kg) do not align; correlations are < 1 and there are systematic differences.
  • Gaussian: predictions do align closely between kg vs tonnes (after ×1000), consistent with scale invariance of a linear/identity link model.

 

What I’ve tried

  • Same model structure across units: spatial field via barrierModel.define + single fsbt effect.
  • Matching priors as best I can across unit systems; also tested several alternative priors.

 

Questions

  1. Is it expected/theoretically correct that Tweedie predictions are sensitive to the response scale (kg vs tonnes) in INLA?
  2. Is ~ exp(…) the recommended way in INLA/inlabru to obtain Tweedie response-scale means, analogous to mgcv::predict(type="response")?
  3. Any guidance on scale-consistent priors (for observation precision in Gaussian and for Tweedie hyperparameters) to improve comparability when only units change?

Many thanks for any clarification or best-practice advice!

Best regards,

Marcelo

INLA_tweedie_response_scale.R

Helpdesk (Haavard Rue)

unread,
Oct 26, 2025, 12:45:19 PM (4 days ago) Oct 26
to Marcelo Soeth, R-inla discussion group
Hi

I think your issue is that the variance for data y from the tweedie, scales like
(see inla.doc("tweedie"))

mu^p

where 1 < p < 2

so you if you scale data y by 'a', then you would expect var(y) to scale with
a^2 and the mean with 'a', but for the tweedie model the variance scales with
a^p, where p<2, and by default p is estimated from data. so unless you fix (or
estimate) p close to 2, the results will not be invariant to scale.

this is not an error but a feature of the model.

you may also check that the other prior does not depend on this scaling, but I
guess the above is the main reason

Best
Havard





On Fri, 2025-10-24 at 18:03 -0700, Marcelo Soeth wrote:
> Dear members,
> I’m relatively new to INLA and am fitting spatial models with the Tweedie
> family using INLA / inlabru / INLAspacetime. I’ve found that changing only the
> units of the response (kilograms vs tonnes) leads to noticeably different
> posterior predictions, whereas Gaussian models give nearly identical
> predictions after rescaling.
> I’m trying to understand whether this Tweedie behaviour is due to the
> mean–variance relationship (parameters p and φ), prior/parameterization
> choices, or something about how predictions are formed on the response scale
> (e.g., using ~ exp(…) vs a family-provided inverse link).
> Attached is a minimal, reproducible example.
> What I observe
>  * Tweedie: predictions from the kg fit and the tonnes fit (converted ×1000 to
> kg) do not align; correlations are < 1 and there are systematic differences.
>  * Gaussian: predictions do align closely between kg vs tonnes (after ×1000),
> consistent with scale invariance of a linear/identity link model.
>  
> What I’ve tried
>  * Same model structure across units: spatial field via barrierModel.define +
> single fsbt effect.
>  * Matching priors as best I can across unit systems; also tested several
> alternative priors.
>  
> Questions
>    1. Is it expected/theoretically correct that Tweedie predictions are
> sensitive to the response scale (kg vs tonnes) in INLA?
>    2. Is ~ exp(…) the recommended way in INLA/inlabru to obtain Tweedie
> response-scale means, analogous to mgcv::predict(type="response")?
>    3. Any guidance on scale-consistent priors (for observation precision in
> Gaussian and for Tweedie hyperparameters) to improve comparability when only
> units change?
>
> Many thanks for any clarification or best-practice advice!
> Best regards,
> Marcelo
> --
> You received this message because you are subscribed to the Google Groups "R-
> inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to r-inla-discussion...@googlegroups.com.
> To view this discussion, visit
> https://groups.google.com/d/msgid/r-inla-discussion-group/2cac7148-4b86-4895-ab42-141ab719c6a0n%40googlegroups.com
> .

--
Håvard Rue
he...@r-inla.org

Marcelo Soeth

unread,
Oct 27, 2025, 10:04:06 PM (2 days ago) Oct 27
to R-inla discussion group
Dear Haavard,

Thank you very much for the clarification. That makes perfect sense. I tried fixing p at 1.99, which indeed made the model almost scale-invariant, though at the cost of some flexibility.

Since I’m fitting the same model for different species, I’ve been experimenting with applying a per-species unit scale (density_std) before fitting, then back-transforming predictions afterward. For example:

# Density standardized unit  
target <- 50 

# Reference scale per species  
df %>% summarise(scale_ref = quantile(density_kg, 0.99) / target) %>%  mutate(density_std = density_kg / scale_ref)

This seems to work well in practice. The model outputs and back-transformations look consistent but I’m not sure whether this approach could have any hidden side effects or theoretical limitations. Would this kind of per-species scaling be appropriate in your view?

Out of curiosity, is there any plan (or technical possibility) to make the Tweedie family scale-invariant in INLA in the future? That would be a really useful feature!

Many thanks again for your time and helpful explanation.

Best regards,

Marcelo

Reply all
Reply to author
Forward
0 new messages