npgeom: Class 'npgeom'

View source: R/npgeom.R

npgeomR Documentation

Class npgeom

Description

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

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

Function rnpgeom generates a random sample from a geometric mixture and saves the data as an object of class npgeom.

Function dnpgeom is the density function of a Poisson mixture.

Function pnpgeom is the distribution function of a Poisson mixture.

Usage

npgeom(v, w=1, grouping=FALSE)
rnpgeom(n, mix=disc(0.5))
dnpgeom(x, mix=disc(0.5), log=FALSE)
pnpgeom(x, mix=disc(0.5), 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, whether or not use frequencies (w) for identical values.

n

the sample size.

x

an object of class npgeom.

mix

an object of class disc.

log

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

lower.tail

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

log.p

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

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.2,0.5), pr=c(0.3,0.7))
(x = rnpgeom(200, mix))
dnpgeom(x, mix)
pnpgeom(x, mix)


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

Related to npgeom in nspmix...