# dtweedie.dldphi

##### Tweedie Distributions

Derivatives of the log-likelihood with respect to \(\phi\)

- Keywords
- models

##### Usage

```
dtweedie.dldphi(phi, mu, power, y )
dtweedie.dldphi.saddle(phi, mu, power, y )
```

##### Arguments

- y
vector of quantiles

- mu
the mean

- phi
the dispersion

- power
the value of \(p\) such that the variance is \(\mbox{var}[Y]=\phi\mu^p\)

##### Details

The Tweedie family of distributions belong to the class
of exponential dispersion models (EDMs),
famous for their role in generalized linear models.
The Tweedie distributions are the EDMs with a variance of the form
\(\mbox{var}[Y]=\phi\mu^p\)
where \(p\) is greater than or equal to one, or less than or equal to zero.
**This function only evaluates for \(p\)
greater than or equal to one.**
Special cases include the
normal (\(p=0\)),
Poisson (\(p=1\) with \(\phi=1\)),
gamma (\(p=2\))
and
inverse Gaussian (\(p=3\))
distributions.
For other values of `power`

,
the distributions are still defined but cannot be written in closed form,
and hence evaluation is very difficult.

##### Value

the value of the derivative
\(\partial\ell/\partial\phi\)
where \(\ell\) is the log-likelihood for the specified
Tweedie distribution.
`dtweedie.dldphi.saddle`

uses the saddlepoint approximation to determine the derivative;
`dtweedie.dldphi`

uses an infinite series expansion.

##### References

Dunn, P. K. and Smyth, G. K. (2008).
Evaluation of Tweedie exponential dispersion model densities by Fourier inversion.
*Statistics and Computing*,
**18**, 73--86.
10.1007/s11222-007-9039-6

Dunn, Peter K and Smyth, Gordon K (2005).
Series evaluation of Tweedie exponential dispersion model densities
*Statistics and Computing*,
**15**(4). 267--280.
10.1007/s11222-005-4070-y

Dunn, Peter K and Smyth, Gordon K (2001).
Tweedie family densities: methods of evaluation.
*Proceedings of the 16th International Workshop on Statistical Modelling*,
Odense, Denmark, 2--6 July

Jorgensen, B. (1987).
Exponential dispersion models.
*Journal of the Royal Statistical Society*, B,
**49**, 127--162.

Jorgensen, B. (1997).
*Theory of Dispersion Models*.
Chapman and Hall, London.

Sidi, Avram (1982).
The numerical evaluation of very oscillatory infinite integrals by
extrapolation.
*Mathematics of Computation*
**38**(158), 517--529.
10.1090/S0025-5718-1982-0645667-5

Sidi, Avram (1988).
A user-friendly extrapolation method for
oscillatory infinite integrals.
*Mathematics of Computation*
**51**(183), 249--266.
10.1090/S0025-5718-1988-0942153-5

Tweedie, M. C. K. (1984).
An index which distinguishes between some important exponential families.
*Statistics: Applications and New Directions.
Proceedings of the Indian Statistical Institute Golden Jubilee International Conference*
(Eds. J. K. Ghosh and J. Roy), pp. 579-604. Calcutta: Indian Statistical Institute.

##### See Also

##### Examples

```
# NOT RUN {
### Plot dl/dphi against candidate values of phi
power <- 2
mu <- 1
phi <- seq(2, 8, by=0.1)
set.seed(10000) # For reproducability
y <- rtweedie( 100, mu=mu, power=power, phi=3)
# So we expect the maximum to occur at phi=3
dldphi <- dldphi.saddle <- array( dim=length(phi))
for (i in (1:length(phi))) {
dldphi[i] <- dtweedie.dldphi( y=y, power=power, mu=mu, phi=phi[i])
dldphi.saddle[i] <- dtweedie.dldphi.saddle( y=y, power=power, mu=mu, phi=phi[i])
}
plot( dldphi ~ phi, lwd=2, type="l",
ylab=expression(phi), xlab=expression(paste("dl / d",phi) ) )
lines( dldphi.saddle ~ phi, lwd=2, col=2, lty=2)
legend( "bottomright", lwd=c(2,2), lty=c(1,2), col=c(1,2),
legend=c("'Exact' (using series)","Saddlepoint") )
# Neither are very good in this case!
# }
```

*Documentation reproduced from package tweedie, version 2.3.2, License: GPL (>= 2)*