Learn R Programming

nspmix (version 2.0-0)

nppois: Class nppois

Description

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

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 dnppois is the density function of a Poisson mixture.

Function pnppois is the distribution function of a Poisson mixture.

Usage

nppois(v, w=1, grouping=TRUE)
rnppois(n, mix=disc(1), ...)
dnppois(x, mix=disc(1), log=FALSE)
pnppois(x, mix=disc(1), lower.tail=TRUE, log.p=FALSE)

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.

grouping

logical, to use frequencies (w) for identical values

n

the sample size.

x

an object of class nppois.

mix

an object of class disc.

log

logical, to compute the log-values or not.

lower.tail,

=FALSE, if lower.tail values are to be returned.

log.p,

=FALSE, if log probability values are to be returned.

...

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,4), pr=c(0.3,0.7))  # a discrete distribution
x = rnppois(200, mix)
dnppois(0:10, mix)
pnppois(0:10, mix)
dnppois(nppois(0:10), mix)
pnppois(nppois(0:10), mix)
 

Run the code above in your browser using DataLab