nppois: Class 'nppois'

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/nppois.R

Description

Class nppois is used to store data that will be processed as those of a nonparametric Poisson mixture.

Usage

1
2
3
4
5
6
nppois(v, w=1)
rnppois(n, mix=disc(1))
## S3 method for class 'nppois'
plot(x, mix, beta, col="red", add=FALSE,
    components=TRUE, main="nppois", lwd=1, lty=1, xlab="Data",
    ylab="Density", ...)

Arguments

v

a numeric vector that stores the values of a sample.

w

a numeric vector that stores the corresponding weights/frequencies of the observations.

n

the sample size.

x

an object of class nppois.

mix

an object of class disc.

beta

the structural parameter, which is not really needed for the Poisson 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.

main, lwd, lty, xlab, ylab

arguments for graphical parameters (see par).

...

arguments passed on to function plot.

Details

Function nppois creates an object of class nppois, given values and weights/frequencies.

Function rnppois generates a random sample from a Poisson mixture and saves the data as an object of class nppois.

Function plot.nppois plots the Poisson mixture.

When components=TRUE, the support points are shown on the horizontal line of density 0. The component density curves, weighted appropriately, are also shown.

Author(s)

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

1
2
3
mix = disc(pt=c(1,4), pr=c(0.3,0.7))
x = rnppois(200, mix)
plot(x, mix)

nspmix documentation built on Oct. 23, 2020, 6:46 p.m.

Related to nppois in nspmix...