npnbinom | R Documentation |
npnbinom
Class npnbinom
is used to store data that will be
processed as those of a nonparametric negative binomial mixture.
Function npnbinom
creates an object of class
npnbinom
, given values and weights/frequencies.
Function rnpnbinom
generates a random sample from a
negative binomial mixture and saves the data as an object of class
npnbinom
.
npnbinom(v, w=1, size, grouping=TRUE)
rnpnbinom(n, size, mix=disc(0.5))
dnpnbinom(x, mix=disc(0.5), size=NULL, log=FALSE)
pnpnbinom(x, mix=disc(0.5), size=NULL, lower.tail=TRUE, log.p=FALSE)
v |
a numeric vector that stores the values of a sample. |
w |
a numeric vector that stores the corresponding weights/frequencies of the observations. |
size |
number of successful trials (ignored if |
grouping |
logical, to use frequencies (w) for identical values |
n |
the sample size. |
x |
an object of class |
mix |
an object of class |
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. |
Yong Wang <yongwang@auckland.ac.nz>
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.
nnls
, cnm
,
cnmms
, plot.nspmix
.
mix = disc(pt=c(0.2,0.5), pr=c(0.3,0.7))
(x = rnpnbinom(200, size=10, mix))
dnpnbinom(x, mix, size=10)
pnpnbinom(x, mix, size=10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.