plot.Matdist: Plotting Distribution Functions for a Matrix Distribution

View source: R/plot_matdistribution.R

plot.MatdistR Documentation

Plotting Distribution Functions for a Matrix Distribution

Description

Helper function to more easily plot a Matdist.

Usage

## S3 method for class 'Matdist'
plot(x, fun = c("pdf", "cdf", "survival", "hazard", "cumhazard"), ...)

Arguments

x

Matdist.

fun

function to plot, one of: "pdf","cdf", "survival", "hazard", "cumhazard".

...

Other parameters passed to matplot.

Details

Essentially just a wrapper around matplot.

See Also

plot.Distribution plot.VectorDistribution

Examples

## Not run: 
pdf <- runif(200)
mat <- matrix(pdf, 20, 10)
mat <- t(apply(mat, 1, function(x) x / sum(x)))
colnames(mat) <- 1:10
d <- as.Distribution(mat, fun = "pdf")
plot(d, "pdf", xlab = "x", ylab = "p(x)")
plot(d, "cdf", xlab = "x", ylab = "F(x)")
plot(d, "survival", xlab = "x", ylab = "S(x)")
plot(d, "hazard", xlab = "x", ylab = "h(x)")
plot(d, "cumhazard", xlab = "x", ylab = "H(x)")

## End(Not run)

distr6 documentation built on March 28, 2022, 1:05 a.m.