p term in Tweedie distribution-DSM

19 views
Skip to first unread message

Antonella Pane

unread,
Sep 12, 2021, 4:29:16 PM9/12/21
to distance-sampling
Hello everybody!

I ran a DSM to study the variables that influence the spatial distribution of territorial ungulates. My models are a mix of smooth terms and parametric (categorical) terms, for example, predation risk level (low/high).

I built base models using negative binomial and Tweedie distributions; then, selected the best model within each distribution and finally selected the best-fitting DSM considering q-q plots and residual diagnostic plots.

I have data from several seasons, so I have one DSM per season. In some cases,  the NB model provided the best fit, and in some other cases, the Tweedie model did.

In a revision, I was asked about how the p term in the Tweedie distribution is tuned. I know that this value is available in the DSM summary but I can't seem to find the math behind it to explain to the reviewer. Related to this, I read that depending on the p term chosen in the Tweedie model, it would be equivalent to the negative binomial (with p=2). In such a case, would the Tweedie model be actually better?

Any help related to this issue would be greatly appreciated!
Thank you! 

Eric Rexstad

unread,
Sep 13, 2021, 2:38:15 AM9/13/21
to Antonella Pane, distance-sampling
Antonella

A partial answer to your question about the estimation of p in the Tweedie can be found by consulting the documentation for the mgcv​ R package

https://cran.r-project.org/web/packages/mgcv/mgcv.pdf

The author of the mgcv​ package refers to the literature regarding the computations:

Dunn, P.K. and G.K. Smyth (2005) Series evaluation of Tweedie exponential dispersion model densities. Statistics and Computing 15:267-280

Perhaps others can provide a less clinical answer.
Package ‘tweedie’ January 20, 2021 Version 2.3.3 Date 2021-01-20 Title Evaluation of Tweedie Exponential Family Models Author Peter K. Dunn [cre, aut]


From: distance...@googlegroups.com <distance...@googlegroups.com> on behalf of Antonella Pane <anto...@gmail.com>
Sent: 12 September 2021 21:29
To: distance-sampling <distance...@googlegroups.com>
Subject: [distance-sampling] p term in Tweedie distribution-DSM
 
--
You received this message because you are subscribed to the Google Groups "distance-sampling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to distance-sampl...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distance-sampling/627c0846-c495-4955-af88-cf032d7af460n%40googlegroups.com.

Antonella Pane

unread,
Sep 13, 2021, 9:37:37 AM9/13/21
to distance-sampling
Eric, Thank you very much for your fast response. I will check these documents. 

To add more detail to my question (especially for the second part), the p terms of the Tweedie models I ran ranged between 1.01 and 1.11

David Lawrence Miller

unread,
Sep 13, 2021, 11:06:26 AM9/13/21
to Antonella Pane, distance-sampling
H Antonella, hi listfolk,

Probably a better (though quite technical) reference would be:

Wood, S. N., Pya, N., & Säfken, B. (2016). Smoothing Parameter and Model
Selection for General Smooth Models. Journal of the American Statistical
Association, 111(516), 1548–1563.
https://doi.org/10.1080/01621459.2016.1180986

In particular Appendix J shows the exact technical details for the
Tweedie, based on those in Section 3.3. In practice, mgcv (which does
the hard work inside dsm to fit models) will estimate the Tweedie
parameter while it estimates the other hyperparameters in the model
(like the smoothing parameters, scale parameter etc).

Hope that helps,
--dave



On 13/09/2021 14:37, Antonella Pane wrote:
> Eric, Thank you very much for your fast response. I will check these
> documents.
>
> To add more detail to my question (especially for the second part), the
> p terms of the Tweedie models I ran ranged between 1.01 and 1.11
>
> El lunes, 13 de septiembre de 2021 a las 3:38:15 UTC-3, Eric Rexstad
> escribió:
>
> Antonella
>
> A partial answer to your question about the estimation of p in the
> Tweedie can be found by consulting the documentation for the |mgcv|​
> R package
>
> https://cran.r-project.org/web/packages/mgcv/mgcv.pdf
> <https://cran.r-project.org/web/packages/mgcv/mgcv.pdf>
> <https://cran.r-project.org/web/packages/tweedie/tweedie.pdf>
> The author of the |mgcv|​ package refers to the literature regarding
> the computations:
>
> Dunn,P.K.andG.K.Smyth(2005)SeriesevaluationofTweedieexponentialdispersionmodel
> densities. Statistics and Computing 15:267-280
>
> Perhaps others can provide a less clinical answer.
> *MailScanner has detected a possible fraud attempt from
> "cran.r-project.org" claiming to be* Package ‘tweedie’ -
> cran.r-project.org
> <https://cran.r-project.org/web/packages/tweedie/tweedie.pdf>
> Package ‘tweedie’ January 20, 2021 Version 2.3.3 Date 2021-01-20
> Title Evaluation of Tweedie Exponential Family Models Author Peter
> K. Dunn [cre, aut]
> cran.r-project.org <http://cran.r-project.org>
>
> //
>
> ------------------------------------------------------------------------
> *From:* distance...@googlegroups.com <distance...@googlegroups.com>
> on behalf of Antonella Pane <anto...@gmail.com>
> *Sent:* 12 September 2021 21:29
> *To:* distance-sampling <distance...@googlegroups.com>
> *Subject:* [distance-sampling] p term in Tweedie distribution-DSM
> <https://groups.google.com/d/msgid/distance-sampling/627c0846-c495-4955-af88-cf032d7af460n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "distance-sampling" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to distance-sampl...@googlegroups.com
> <mailto:distance-sampl...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/distance-sampling/b631932d-1882-4e76-aa5e-8bf84663300cn%40googlegroups.com
> <https://groups.google.com/d/msgid/distance-sampling/b631932d-1882-4e76-aa5e-8bf84663300cn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Antonella Pane

unread,
Sep 13, 2021, 5:29:56 PM9/13/21
to distance-sampling
Hi David, 

Thank you very much for your reply. The first issue is much clearer now. 
What I still don't understand quite well is the relationship between Tweedie and negative binomial distributions, if any. Are these two distributions equivalent in any situation (e.g., when p=2 in Tweedie)?


Thank you very much in advance!

Antonella

David Lawrence Miller

unread,
Sep 16, 2021, 6:26:02 AM9/16/21
to Antonella Pane, distance-sampling
Hi Antonella, hi listfolk,

I find it easier to understand these two distributions in terms of their
mean-variance relationships. For Tweedie

var = scale * mean^p

where p is the "power" parameter and scale is the scale parameter, both
returned in the summary()

Whereas for the negative binomial

var = mean + kappa * mean^2

(I think actually dsm returns theta=1/kappa in summary() but the idea is
the same).

So, in terms of these mean-variance relationships, we can't say that
these are equivalent distributions.

Hope this helps!

cheers,
--dave
> > "cran.r-project.org <http://cran.r-project.org>" claiming to be*
> Package ‘tweedie’ -
> > cran.r-project.org <http://cran.r-project.org>
> > <https://cran.r-project.org/web/packages/tweedie/tweedie.pdf
> <https://cran.r-project.org/web/packages/tweedie/tweedie.pdf>>
> > Package ‘tweedie’ January 20, 2021 Version 2.3.3 Date 2021-01-20
> > Title Evaluation of Tweedie Exponential Family Models Author Peter
> > K. Dunn [cre, aut]
> > cran.r-project.org <http://cran.r-project.org>
> <http://cran.r-project.org <http://cran.r-project.org>>
> <https://groups.google.com/d/msgid/distance-sampling/627c0846-c495-4955-af88-cf032d7af460n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/distance-sampling/627c0846-c495-4955-af88-cf032d7af460n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "distance-sampling" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to distance-sampl...@googlegroups.com
> > <mailto:distance-sampl...@googlegroups.com>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/distance-sampling/b631932d-1882-4e76-aa5e-8bf84663300cn%40googlegroups.com
> <https://groups.google.com/d/msgid/distance-sampling/b631932d-1882-4e76-aa5e-8bf84663300cn%40googlegroups.com>
>
> >
> <https://groups.google.com/d/msgid/distance-sampling/b631932d-1882-4e76-aa5e-8bf84663300cn%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/distance-sampling/b631932d-1882-4e76-aa5e-8bf84663300cn%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "distance-sampling" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to distance-sampl...@googlegroups.com
> <mailto:distance-sampl...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/distance-sampling/016c9315-1585-4070-8222-905257118b71n%40googlegroups.com
> <https://groups.google.com/d/msgid/distance-sampling/016c9315-1585-4070-8222-905257118b71n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Antonella Pane

unread,
Sep 16, 2021, 10:53:39 AM9/16/21
to distance-sampling
Thank you very much David!
Reply all
Reply to author
Forward
0 new messages