plot.nspmix: Class 'nspmix'

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

View source: R/cnm.R

Description

Class nspmix is an object returned by function cnm, cnmms, cnmpl or cnmap.

Usage

1
2
## S3 method for class 'nspmix'
plot(x, data, type=c("probability","gradient"), ...)

Arguments

x

an object of a mixture model class

data

a data set from the mixture model

type

the type of function to be plotted: the probability model of the mixture family (probability), or the gradient function (gradient).

...

arguments passed on to the plot function called.

Details

Function plot.nspmix plots either the mixture model, if the family of the mixture provides an implementation of the generic plot function, or the gradient function.

data must belong to a mixture family, as specified by its class.

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.

Wang, Y. (2010). Maximum likelihood computation for fitting semiparametric mixture models. Statistics and Computing, 20, 75-86

See Also

nnls, cnm, cnmms, cnmpl, cnmap, npnorm, nppois.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Poisson mixture
x = rnppois(200, disc(c(1,4), c(0.7,0.3)))
r = cnm(x)
plot(r, x, "p")
plot(r, x, "g")

## Normal mixture
x = rnpnorm(200, mix=disc(c(0,4), c(0.3,0.7)), sd=1)
r = cnm(x, init=list(beta=0.5))   # sd = 0.5
plot(r, x, "p")
plot(r, x, "g")

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

Related to plot.nspmix in nspmix...