The functions plot the CDF and PDF of a given distribution object.
# S3 method for 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," ...)<="" p=""># S3 method for 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," ...)<="" p="">
# S3 method for 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," ...)<="" p="">
# S3 method for 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," ...)<="" p="">
# S3 method for 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," ...)<="" p="">
# S3 method for 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," ...)<="" p="">
# S3 method for 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," ...)<="" p="">
# S3 method for 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," ...)<="" p="">
# S3 method for 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," ...)<="" p="">
# S3 method for 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," ...)<="" p="">
# S3 method for 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," ...)<="" p="">
# S3 method for 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
=>=>=>=>=>=>=>=>=>=>=>
distribution object.
whether to plot only CDF, PDF or both, default: 'all'.
whether to plot only mixture/composite model and not also the components, default: FALSE.
number of points at which CDF is evaluated, default: 1000.
number of points at which PDF is evaluated, default: 1000.
color used in plot, default: '#122e94'.
xlim of CDF plot, default: q(x, c(0.01, 0.99)).
ylim of CDF plot, default: NULL.
xlim of PDF plot, default: xlim1.
ylim of PDF plot, default: NULL.
xlab of CDF plot, default: 'x'.
ylab of CDF plot, default: expression(P(X <= x)).
xlab of PDF plot, default: 'x'.
ylab of PDF plot, default: 'P(X = x)'.
title of CDF plot, default: 'CDF'.
title of PDF plot, default: 'PDF'/'PMF'.
type of CDF plot.
type of PDF plot.
lty used in CDF plot.
lty used in PDF plot.
lwd used in CDF plot.
lwd used in PDF plot.
lty of abline if ablines are part of plot (composite and discrete distributions).
cex parameter for mtexts used in the plots of composite distributions, default: 1.
further arguments to be passed.
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))
Run the code above in your browser using DataLab