nppois: Class 'nppois'

View source: R/nppois.R

nppoisR Documentation

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(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

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)
 

nspmix documentation built on June 8, 2025, 12:29 p.m.

Related to nppois in nspmix...