tweedie (version 2.1.3)

tweedie.plot: Tweedie Distributions: plotting

Description

Plotting Tweedie density and distribution functions

Usage

tweedie.plot(y, xi, mu, phi, type="pdf", power=NULL, add=FALSE, ...)

Arguments

y
vector of values at which to evaluate and plot
xi
the value of $\xi$ such that the variance is $\mbox{var}[Y]=\phi\mu^{\xi}$
power
a synonym for $\xi$
mu
the mean
phi
the dispersion
type
what to plot: pdf (the default) means the probability function, or cdf, the cumulative distribution function
add
if TRUE, the plot is added to the current device; if FALSE (the default), a new plot is produced
...
Arguments to be passed to the plotting method

Value

  • this function is usually called for side-effect of producing a plot of the specified Tweedie distribution, properly plotting the exact zero that occurs at $y=0$ when $1y and x respectively, such that plot(y~x) approximately reproduces the plot.

Details

For details, see dtweedie

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. Nolan, John P (1997). Numerical calculation of stable densities and distribution functions. Communication in Statistics---Stochastic models, 13(4). 759--774. 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

Examples

Run this code
### Plot a Tweedie density with 1<p<2
yy <- seq(0,5,length=100)
tweedie.plot( power=1.7, mu=1, phi=1, y=yy, lwd=2)
tweedie.plot( power=1.2, mu=1, phi=1, y=yy, add=TRUE, lwd=2, col="red")
legend("topright",lwd=c(2,2), col=c("black","red"), pch=c(19,19),
   legend=c("p=1.7","p=1.2") )

### Plot distribution functions
tweedie.plot( power=1.05, mu=1, phi=1, y=yy,
   lwd=2, type="cdf", ylim=c(0,1))
tweedie.plot( power=2, mu=1, phi=1, y=yy, 
   add=TRUE, lwd=2, type="cdf",col="red")
legend("bottomright",lwd=c(2,2), col=c("black","red"),
   legend=c("p=1.05","p=2") )

### Now, plot two densities, combining p>2 and 1<p<2
tweedie.plot( power=3.5, mu=1, phi=1, y=yy, lwd=2)
tweedie.plot( power=1.5, mu=1, phi=1, y=yy, lwd=2, col="red", add=TRUE)
legend("topright",lwd=c(2,2), col=c("black","red"), pch=c(NA,19),
   legend=c("p=3.5","p=1.5") )

Run the code above in your browser using DataCamp Workspace