powered by
Class disc is used to represent an arbitrary univariate discrete distribution with a finite number of support points.
disc
Function disc creates an object of class disc, given the support points and probability values at these points.
Function plot.disc plots the discrete distribution.
plot.disc
# S3 method for disc plot( x, type = c("pdf", "cdf"), add = FALSE, col = 4, lwd = 1, ylim, xlab = "", ylab = "Probability", ... )
an object of class disc.
plot its pdf or cdf.
add the plot or not.
colour to be used.
graphical parameters.
arguments passed on to function plot.
plot
Yong Wang <yongwang@auckland.ac.nz>
disc, cnm, cnmms.
cnm
cnmms
plot(disc(pt=c(0,4), pr=c(0.3,0.7))) plot(disc(rnorm(5), 1:5)) for(i in 1:5) plot(disc(rnorm(5), 1:5), type="cdf", add=(i>1), xlim=c(-3,3))
Run the code above in your browser using DataLab