Learn R Programming

nspmix (version 2.0-0)

plot.npgeom: Plotting a nonparametric geometric mixture

Description

Function plot.npgeom plots a geometric mixture, along with data.

Usage

# S3 method for npgeom
plot(
  x,
  mix,
  beta,
  col = "red",
  add = FALSE,
  components = TRUE,
  main = "npgeom",
  lwd = 1,
  lty = 1,
  xlab = "Data",
  ylab = "Density",
  ...
)

Arguments

x

an object of class npgeom.

mix

an object of class disc.

beta

the structural parameter (not used for a geometric mixture).

col

the color of the density curve to be plotted.

add

if FALSE, creates a new plot; if TRUE, adds the plot to the existing one.

components

if TRUE, also show the support points and mixing proportions (with vertical lines in proportion).

main, lwd, lty, xlab, ylab

arguments for graphical parameters (see par).

...

arguments passed on to function plot.

Author

Yong Wang <yongwang@auckland.ac.nz>

References

Wang, Y. (2007). On fast computation of the non-parametric maximum likelihood estimate of a mixing distribution. Journal of the Royal Statistical Society, Ser. B, 69, 185-198.

See Also

nnls, cnm, cnmms, plot.nspmix.

Examples

Run this code

mix = disc(pt=c(0.2,0.6), pr=c(0.3,0.7))  # a discrete distribution
x = rnpgeom(200, mix)
plot(x, mix)
 

Run the code above in your browser using DataLab