disc: Class 'disc'

View source: R/disc.R

discR Documentation

Class disc

Description

Class disc is used to represent an arbitrary univariate discrete distribution with a finite number of support points.

Usage

disc(pt, pr=1, sort=TRUE, collapse=FALSE)

Arguments

pt

a numeric vector for support points.

pr

a numeric vector for probability values at the support points.

sort

=TRUE, by default. If TRUE, support points are sorted (in increasing order).

collapse

=TRUE, by default. If TRUE, identical support points are collapsed, with their masses aggregated.

Details

Function disc creates an object of class disc, given the support points and probability values at these points.

Function print.disc prints the discrete distribution.

Author(s)

Yong Wang <yongwang@auckland.ac.nz>

See Also

cnm, cnmms.

Examples


(d = disc(pt=c(0,4), pr=c(0.3,0.7)))


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

Related to disc in nspmix...