Distribution_autoplot {mistr} | R Documentation |
Autoplot of Distributions
Description
The functions plot the CDF and PDF of a given distribution object.
Usage
## S3 method for class 'compdist'
plot(x, which = "all", only_mix = FALSE, pp1 = 1000, pp2 = 1000, col = "#122e94",
xlim1 = q(x, c(0.01, 0.99)), ylim1 = NULL, xlim2 = xlim1, ylim2 = NULL,
xlab1 = "x", ylab1 = expression(P(X <= x)), xlab2 = "x", ylab2 = "P(X = x)",
main1 = "CDF", main2 = "PDF", type1 = "l", type2 = "l",
lty1 = 1, lty2 = 1, lwd1 = 2, lwd2 = 2, lty_abline = 3, mtext_cex = 1, ...)
## S3 method for class 'trans_compdist'
plot(x, which = "all", only_mix = FALSE, pp1 = 1000, pp2 = 1000, col = "#122e94",
xlim1 = q(x, c(0.01, 0.99)), ylim1 = NULL, xlim2 = xlim1, ylim2 = NULL,
xlab1 = "x", ylab1 = expression(P(X <= x)), xlab2 = "x", ylab2 = "P(X = x)",
main1 = "CDF", main2 = "PDF", type1 = "l", type2 = "l",
lty1 = 1, lty2 = 1, lwd1 = 2, lwd2 = 2, lty_abline = 3, mtext_cex = 1, ...)
## S3 method for class 'contdist'
plot(x, which = "all", pp1 = 1000, pp2 = 1000, col = "#122e94",
xlim1 = q(x, c(0.01, 0.99)), ylim1 = NULL, xlim2 = xlim1, ylim2 = NULL,
xlab1 = "x", ylab1 = expression(P(X <= x)), xlab2 = "x", ylab2 = "P(X = x)",
main1 = "CDF", main2 = "PDF", type1 = "l", type2 = "l",
lty1 = NULL, lty2 = NULL, lwd1 = NULL, lwd2 = NULL, ...)
## S3 method for class 'trans_contdist'
plot(x, which = "all", pp1 = 1000, pp2 = 1000, col = "#122e94",
xlim1 = q(x, c(0.01, 0.99)), ylim1 = NULL, xlim2 = xlim1, ylim2 = NULL,
xlab1 = "x", ylab1 = expression(P(X <= x)), xlab2 = "x", ylab2 = "P(X = x)",
main1 = "CDF", main2 = "PDF", type1 = "l", type2 = "l",
lty1 = NULL, lty2 = NULL, lwd1 = NULL, lwd2 = NULL, ...)
## S3 method for class 'discrdist'
plot(x, which = "all", col = "#122e94",
xlim1 = q(x,c(0.01, 0.99)), ylim1 = NULL, xlim2 = xlim1, ylim2 = NULL,
xlab1 = "x", ylab1 = expression(P(X <= x)), xlab2 = "x", ylab2 = "P(X = x)",
main1 = "CDF", main2 = "PMF", type1 = NULL, type2 = NULL,
lty1 = NULL, lty2 = NULL, lwd1 = NULL, lwd2 = NULL, ...)
## S3 method for class 'trans_discrdist'
plot(x, which = "all", col = "#122e94",
xlim1 = q(x, c(0.01, 0.99)), ylim1 = NULL, xlim2 = xlim1, ylim2 = NULL,
xlab1 = "x", ylab1 = expression(P(X <= x)), xlab2 = "x", ylab2 = "P(X = x)",
main1 = "CDF", main2 = "PMF", type1 = "p", type2 = "p",
lty1 = NULL, lty2 = NULL, lwd1 = NULL, lwd2 = NULL, ...)
## S3 method for class 'contmixdist'
plot(x, which = "all", only_mix = FALSE, pp1 = 1000, pp2 = 1000, col = "#122e94",
xlim1 = q(x, c(0.01, 0.99)), ylim1 = NULL, xlim2 = xlim1, ylim2 = NULL,
xlab1 = "x", ylab1 = expression(P(X <= x)), xlab2 = "x", ylab2 = "P(X = x)",
main1 = "CDF", main2 = "PDF", type1 = "l", type2 = "l",
lty1 = 3, lty2 = 3, lwd1 = 2, lwd2 = 2, ...)
## S3 method for class 'trans_contmixdist'
plot(x, which = "all", only_mix = FALSE, pp1 = 1000, pp2 = 1000, col = "#122e94",
xlim1 = q(x, c(0.01, 0.99)), ylim1 = NULL, xlim2 = xlim1, ylim2 = NULL,
xlab1 = "x", ylab1 = expression(P(X <= x)), xlab2 = "x", ylab2 = "P(X = x)",
main1 = "CDF", main2 = "PDF", type1 = "l", type2 = "l",
lty1 = 3, lty2 = 3, lwd1 = 2, lwd2 = 2, ...)
## S3 method for class 'discrmixdist'
plot(x, which = "all", only_mix = FALSE,
pp1 = 1000, pp2 = 2 * (diff(xlim2)), col = "#122e94",
xlim1 = q(x,c(0.01, 0.99)), ylim1 = c(0, 1), xlim2 = xlim1, ylim2 = NULL,
xlab1 = "x", ylab1 = expression(P(X <= x)), xlab2 = "x", ylab2 = "P(X = x)",
main1 = "CDF", main2 = "PMF", type1 = "l", type2 = "l",
lty1 = 3, lty2 = 3, lwd1 = 3, lwd2 = 3, ...)
## S3 method for class 'trans_discrmixdist'
plot(x, which = "all", only_mix = FALSE,
pp1 = 1000, pp2 = 2 * (diff(xlim2)), col = "#122e94",
xlim1 = q(x,c(0.01, 0.99)), ylim1 = c(0, 1), xlim2 = xlim1, ylim2 = NULL,
xlab1 = "x", ylab1 = expression(P(X <= x)), xlab2 = "x", ylab2 = "P(X = x)",
main1 = "CDF", main2 = "PMF", type1 = "l", type2 = "l",
lty1 = 3, lty2 = 3, lwd1 = 3, lwd2 = 3, ...)
## S3 method for class 'contdiscrmixdist'
plot(x, which = "all", only_mix = FALSE, pp1 = 1000, pp2 = 1000, col = "#122e94",
xlim1 = q(x, c(0.01, 0.99)), ylim1 = c(0, 1), xlim2 = xlim1, ylim2 = NULL,
xlab1 = "x", ylab1 = expression(P(X <= x)), xlab2 = "x", ylab2 = "P(X = x)",
main1 = "CDF", main2 = "PDF", type1 = "l", type2 = "l",
lty1 = 3, lty2 = 3, lwd1 = 2, lwd2 = 2, ...)
## S3 method for class 'trans_contdiscrmixdist'
plot(x, which = "all", only_mix = FALSE, pp1 = 1000, pp2 = 1000, col = "#122e94",
xlim1 = q(x, c(0.01, 0.99)), ylim1 = c(0, 1), xlim2 = xlim1, ylim2 = NULL,
xlab1 = "x", ylab1 = expression(P(X <= x)), xlab2 = "x", ylab2 = "P(X = x)",
main1 = "CDF", main2 = "PDF", type1 = "l", type2 = "l",
lty1 = 3, lty2 = 3, lwd1 = 2, lwd2 = 2, ...)
Arguments
x |
distribution object. |
which |
whether to plot only CDF, PDF or both, default: 'all'. |
only_mix |
whether to plot only mixture/composite model and not also the components, default: FALSE. |
pp1 |
number of points at which CDF is evaluated, default: 1000. |
pp2 |
number of points at which PDF is evaluated, default: 1000. |
col |
color used in plot, default: '#122e94'. |
xlim1 |
xlim of CDF plot, default: q(x, c(0.01, 0.99)). |
ylim1 |
ylim of CDF plot, default: NULL. |
xlim2 |
xlim of PDF plot, default: xlim1. |
ylim2 |
ylim of PDF plot, default: NULL. |
xlab1 |
xlab of CDF plot, default: 'x'. |
ylab1 |
ylab of CDF plot, default: expression(P(X <= x)). |
xlab2 |
xlab of PDF plot, default: 'x'. |
ylab2 |
ylab of PDF plot, default: 'P(X = x)'. |
main1 |
title of CDF plot, default: 'CDF'. |
main2 |
title of PDF plot, default: 'PDF'/'PMF'. |
type1 |
type of CDF plot. |
type2 |
type of PDF plot. |
lty1 |
lty used in CDF plot. |
lty2 |
lty used in PDF plot. |
lwd1 |
lwd used in CDF plot. |
lwd2 |
lwd used in PDF plot. |
lty_abline |
lty of abline if ablines are part of plot (composite and discrete distributions). |
mtext_cex |
cex parameter for mtexts used in the plots of composite distributions, default: 1. |
... |
further arguments to be passed. |
Examples
N <- normdist()
plot(N)
# manipulating cdf plot
B <- binomdist(12, 0.5)
plot(-3*B, which = "cdf", xlim1 = c(-30, -10))
# manipulating pdf plot
plot(-3*B, which = "pdf", xlim1 = c(-30, -10))