Helper function to more easily plot a Matdist.

# 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.

Examples

if (FALSE) { # \dontrun{
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)")
} # }