|
# simplest case |
|
plot_dist(dbeta, c(2, 2)) |
|
|
|
# with named parameters |
|
plot_dist(pnorm, c(mean=0, sd=1), from=-3, to=3, |
|
main="Normal CDF", legend.x="bottomright") |
|
|
|
# https://en.wikipedia.org/wiki/File:Beta_distribution_pdf.svg |
|
plot_dist(dbeta, c(shape1=0.5, shape2=0.5), legend.x="top", col="red", |
|
ylim=c(0, 2.5), main="Beta PDF") |
|
plot_dist(dbeta, c(shape1=5, shape2=1), legend.x="top", col="blue", add=TRUE) |
|
plot_dist(dbeta, c(shape1=1, shape2=3), legend.x="top", col="green", add=TRUE) |
|
plot_dist(dbeta, c(shape1=2, shape2=2), legend.x="top", col="purple", add=TRUE) |
|
plot_dist(dbeta, c(shape1=2, shape2=5), egend.x="top", col="orange", add=TRUE) |
|
|
|
# https://en.wikipedia.org/wiki/File:Beta_distribution_cdf.svg |
|
plot_dist(pbeta, c(shape1=0.5, shape2=0.5), legend.x="topleft", col="red", |
|
main="Beta CDF") |
|
plot_dist(pbeta, c(shape1=5, shape2=1), legend.x="topleft", col="blue", |
|
add=TRUE) |
|
plot_dist(pbeta, c(shape1=1, shape2=3), legend.x="topleft", col="green", |
|
add=TRUE) |
|
plot_dist(pbeta, c(shape1=2, shape2=2), legend.x="topleft", col="purple", |
|
add=TRUE) |
|
plot_dist(pbeta, c(shape1=2, shape2=5), legend.x="topleft", col="orange", |
|
add=TRUE) |
|
|
|
# https://en.wikipedia.org/wiki/File:Binomial_distribution_pmf.svg |
|
plot_dist(dbinom, c(p=0.5, size=20), from=0, to=40, n=41, type="p", pch=19, |
|
col="blue", ylim=c(0, 0.25), main="Binomial PMF") |
|
plot_dist(dbinom, c(p=0.7, size=20), n=41, type="p", pch=19, |
|
col="green", add=TRUE) |
|
plot_dist(dbinom, c(p=0.5, size=40), n=41, type="p", pch=19, |
|
col="red", add=TRUE) |
|
|
|
# https://en.wikipedia.org/wiki/File:Binomial_distribution_cdf.svg |
|
plot_dist(pbinom, c(p=0.5, size=40), from=0, to=40, type="p", pch=19, |
|
legend.x="bottomright", col="red", main="Binomial CDF") |
|
plot_dist(pbinom, c(p=0.7, size=20), type="p", pch=19, |
|
legend.x="bottomright", legend.move="up", col="green", add=TRUE) |
|
plot_dist(pbinom, c(p=0.5, size=20), type="p", pch=19, |
|
legend.x="bottomright", legend.move="up", col="blue", add=TRUE) |
|
|
|
# https://en.wikipedia.org/wiki/File:Poisson_pmf.svg |
|
plot_dist(dpois, c(lambda=1), from=0, to=20, n=21, type="b", pch=19, |
|
col="orange", main="Poisson PMF") |
|
plot_dist(dpois, c(lambda=4), n=21, type="b", pch=19, |
|
col="purple", add=TRUE) |
|
plot_dist(dpois, c(lambda=10), n=21, type="b", pch=19, |
|
col="lightblue", add=TRUE) |
|
|
|
# https://en.wikipedia.org/wiki/File:Poisson_cdf.svg |
|
plot_dist(ppois, c(lambda=10), from=0, to=20, type="b", pch=19, |
|
legend.x="bottomright", col="lightblue", main="Poisson CDF") |
|
plot_dist(ppois, c(lambda=4), type="b", pch=19, |
|
legend.x="bottomright", legend.move="up", col="purple", add=TRUE) |
|
plot_dist(ppois, c(lambda=1), type="b", pch=19, |
|
legend.x="bottomright", legend.move="up", col="orange", add=TRUE) |
|
|
|
# https://en.wikipedia.org/wiki/File:Normal_Distribution_PDF.svg |
|
plot_dist(dnorm, c(mean=0, sd=sqrt(0.2)), from=-5, to=5, col="blue", |
|
main="Normal PDF") |
|
plot_dist(dnorm, c(mean=0, sd=sqrt(1.0)), col="red", add=TRUE) |
|
plot_dist(dnorm, c(mean=0, sd=sqrt(5.0)), col="orange", add=TRUE) |
|
plot_dist(dnorm, c(mean=-2, sd=sqrt(0.5)), col="darkgreen", add=TRUE) |
|
|
|
# https://en.wikipedia.org/wiki/File:Normal_Distribution_CDF.svg |
|
plot_dist(pnorm, c(mean=0, sd=sqrt(0.2)), from=-5, to=5, legend.x="topleft", |
|
col="blue", main="Normal CDF") |
|
plot_dist(pnorm, c(mean=0, sd=sqrt(1.0)), legend.x="topleft", col="red", |
|
add=TRUE) |
|
plot_dist(pnorm, c(mean=0, sd=sqrt(5.0)), legend.x="topleft", col="orange", |
|
add=TRUE) |
|
plot_dist(pnorm, c(mean=-2, sd=sqrt(0.5)), legend.x="topleft", col="darkgreen", |
|
add=TRUE) |
|
|
|
# EOF |