tweedie (version 2.1.1)

dtweedie.dldphi: Tweedie Distributions

Description

Derivatives of the log-likelihood with respect to $\phi$

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$

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.

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.

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.

Dunn, Peter K and Smyth, Gordon K (2005). Series evaluation of Tweedie exponential dispersion model densities Statistics and Computing, 15(4). 267--280. 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. Sidi, Avram (1988). A user-friendly extrapolation method for oscillatory infinite integrals. Mathematics of Computation 51(183), 249--266. 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

dtweedie.saddle, dtweedie, tweedie.profile, tweedie

Examples

Run this code
### 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!

Run the code above in your browser using DataCamp Workspace