distributions <- list(
"normal" = list(
name = "normal",
name_pos = c(0.5, 0.1),
plot_type = "line",
x = seq(-3.3, 3.3, 0.01),
top_space = 0,
ddist = dnorm,
ddist_params = list(mean=0, sd=1),
labels = list(mean = c(0.5, 0.3), right_sd = c(0.80, 0.5), left_sd = c(0.20, 0.5))
),
"beta" = list(
name = "beta",
name_pos = c(0.5, 0.1),
plot_type = "line",
x = seq(0, 1, 0.01),
top_space = 0,
ddist = dbeta,
ddist_params = list(shape1=2, shape2=2),
labels = list(params=c(0.5, 0.4))
),
"gamma" = list(
name = "gamma",
name_pos = c(0.3, 0.1),
plot_type = "line",
x = seq(0, 2, 0.01),
top_space = 0,
ddist = dgamma,
ddist_params = list(shape=1.3, rate=2.5),
labels = list(params = c(0.60, 0.5))
),
"inverse gamma" = list(
name = "inv-gamma",
name_pos = c(0.42, 0.1),
plot_type = "line",
x = seq(0, 1.1, 0.01),
top_space = 0,
ddist = function(x, shape, scale) {scale^shape / gamma(shape) * x^(-shape-1)*exp(-scale/x)},
ddist_params = list(shape=3, scale=1),
labels = list(params = c(0.65, 0.5))
),
"t" = list(
name = "t distrib.",
name_pos = c(0.5, 0.1),
plot_type = "line",
x = seq(-3.0, 3.0, 0.01),
top_space = 0,
ddist = dt,
ddist_params = list(ncp=0, df=3),
labels = list(mean = c(0.5, 0.3), right_scale = c(0.75, 0.65), left_scale = c(0.25, 0.65), right_df = c(0.90, 0.35), left_df = c(0.10, 0.35))
),
"uniform" = list(
name = "uniform",
name_pos = c(0.5, 0.1),
plot_type = "line",
x = seq(0, 1, 0.001),
top_space = 0.6,
ddist = dunif,
ddist_params = list(min=0.15, max=0.85),
labels = list(min=c(0.18,0.55), max=c(0.82,0.55))
),
"bernoulli" = list(
name = "Bernoulli",
name_pos = c(0.5, 0.1),
plot_type = "bar",
x = round(seq(-0.4, 1.4, 0.1), 1),
top_space = 0.0,
ddist = function(x, p) {ifelse(x == 1, p, ifelse(x==0, 1-p, 0))},
ddist_params = list(p=0.7),
labels = list(p = c(0.5, 0.6))
),
binomial = list(
name = "binomial",
name_pos = c(0.5, 0.1),
plot_type = "bar",
x = -2:10,
top_space = 0.2,
ddist = dbinom,
ddist_params = list(size=8, prob = 0.45),
labels = list(params = c(0.7, 0.68))
),
"folded-t" = list(
name = "folded-t",
name_pos = c(0.3, 0.1),
plot_type = "line",
x = seq(0.0, 3.0, 0.01),
top_space = 0,
ddist = dt,
ddist_params = list(ncp=0, df=3),
labels = list(mean = c(0.15, 0.5), scale = c(0.43, 0.62), df = c(0.65, 0.4))
),
"poisson" = list(
name = "Poisson",
name_pos = c(0.3, 0.1),
plot_type = "bar",
x = seq(-1, 10.0, 1),
top_space = 0.0,
ddist = dpois,
ddist_params = list(lambda=2.5),
labels = list(lambda=c(0.60, 0.65))
),
"chi-squared" = list(
name = "chi-squared",
name_pos = c(0.45, 0.1),
plot_type = "line",
x = seq(-1, 8, 0.01),
top_space = 0.0,
ddist = dchisq,
ddist_params = list(df=3),
labels = list(df=c(0.65, 0.60))
),
"double exponential" = list(
name = "double exp.",
name_pos = c(0.5, 0.1),
plot_type = "line",
x = seq(-3, 3, 0.01),
top_space = 0,
ddist = function(x, mu, diversity) {diversity * exp(-diversity * abs(x - mu))/2},
ddist_params = list(mu=0, diversity=1),
labels = list(mean = c(0.5, 0.3), right_diversity = c(0.75, 0.5), left_diversity = c(0.25, 0.5))
),
"exponential" = list(
name = "exponential",
name_pos = c(0.37, 0.1),
plot_type = "line",
x = seq(0, 1.4, 0.01),
top_space = 0.1,
ddist = dexp,
ddist_params = list(rate=1.5),
labels = list(rate = c(0.55, 0.55))
),
"f" = list(
name = "F dist.",
name_pos = c(0.3, 0.1),
plot_type = "line",
x = seq(0, 5, 0.01),
top_space = 0,
ddist = df,
ddist_params = list(df1=5, df2=5),
labels = list(params = c(0.60, 0.5))
),
"generalized gamma" = list(
name = "gen. gamma",
name_pos = c(0.45, 0.1),
plot_type = "line",
x = seq(0, 5, 0.01),
top_space = 0,
ddist = function(x, r, lambda, b) {(b*lambda^(b*r)*x^(b*r-1) * exp(-(lambda*x)^b ))/gamma(r)},
ddist_params = list(r=3, lambda=1, b=1.4),
labels = list(params = c(0.75, 0.75))
),
"logistic" = list(
name = "logistic",
name_pos = c(0.5, 0.1),
plot_type = "line",
x = seq(-4.5, 4.5, 0.01),
top_space = 0,
ddist = dlogis,
ddist_params = list(location=0, scale=1),
labels = list(location = c(0.5, 0.3), right_scale = c(0.80, 0.5), left_scale = c(0.20, 0.5))
),
"log-normal" = list(
name = "log-normal",
name_pos = c(0.48, 0.1),
plot_type = "line",
x = seq(0, 1.7, 0.01),
top_space = 0,
ddist = dlnorm,
ddist_params = list(meanlog=-0.3, sdlog=0.4),
labels = list(meanlog = c(0.43, 0.3), sdlog = c(0.70, 0.5))
),
"noncentral chi-squared" = list(
name = "noncentral\nchi-squared",
name_pos = c(0.45, 0.2),
plot_type = "line",
x = seq(0, 8, 0.01),
top_space = 0.3,
ddist = dchisq,
ddist_params = list(df=2, ncp=3),
labels = list(params=c(0.70, 0.65))
),
"pareto" = list(
name = "Pareto",
name_pos = c(0.65, 0.2),
plot_type = "line",
x = seq(0.1, 1, 0.01),
top_space = 0,
ddist = function(x, alpha, c) {alpha*c^alpha*x^-(alpha+1)},
ddist_params = list(alpha=2, c=1),
labels = list(params=c(0.30, 0.65))
),
"weibull" = list(
name = "Weibull",
name_pos = c(0.35, 0.1),
plot_type = "line",
x = seq(0, 2.5, 0.01),
top_space = 0,
ddist = dweibull,
ddist_params = list(shape=2.1, scale=1),
labels = list(params = c(0.70, 0.60))
),
"beta-binomial" = list(
name = "beta-binomial",
name_pos = c(0.5, 0.1),
plot_type = "bar",
x = seq(0, 1, 0.1),
top_space = 0,
ddist = dbeta,
ddist_params = list(shape1=2.7, shape2=2.7),
labels = list(params=c(0.5, 0.6))
),
"categorical" = list(
name = "categorical",
name_pos = c(0.5, 0.1),
plot_type = "bar",
x = 0:5,
top_space = 0.2,
ddist = function(x, p_cat) {
pd <- rep(0, length(x))
pd[x %in% seq_along(p_cat)] <- p_cat[x[x %in% seq_along(p_cat)]]/sum(p_cat)
pd
},
ddist_params = list(p_cat = c(1.5, 3.3, 2, 3)),
labels = list(params=c(0.5, 0.5))
),
"noncentral hypergeometric" = list(
name = "noncentral\nhypergeom.",
name_pos = c(0.5, 0.2),
plot_type = "bar",
x = 0:12,
top_space = 0.0,
ddist = dhyper,
ddist_params = list(m=50, n=50, k=12),
labels = list(params=c(0.5, 0.6))
),
"negative binomial" = list(
name = "neg. binomial",
name_pos = c(0.5, 0.1),
plot_type = "bar",
x = -2:10,
top_space = 0.1,
ddist = dnbinom,
ddist_params = list(size=25, prob = 0.90),
labels = list(p = c(0.65, 0.65))
),
"shifted exponential" = list(
name = "shif. exp.",
name_pos = c(0.5, 0.1),
plot_type = "line",
x = seq(0, 7, 0.01),
top_space = 0.2,
ddist = function(x, rate, shift) {dexp(x - shift, rate)},
ddist_params = list(rate=0.35, shift = 1),
labels = list(params = c(0.6, 0.55))
),
"right-censored normal" = list(
name = "r-cens.\nnormal",
name_pos = c(0.5, 0.2),
plot_type = "line",
x = seq(-3.3, 3.3, 0.01),
top_space = 0,
ddist = function(x, mean, sd, right_limit) {ifelse(x < right_limit, dnorm(x, mean, sd), 0)},
ddist_params = list(mean=0, sd=1, right_limit=1.75),
labels = list(mean = c(0.5, 0.45), right_sd = c(0.77, 0.60), right_limit=c(0.83,0.175), left_sd = c(0.23, 0.60))
),
"left-censored normal" = list(
name = "l-cens.\nnormal",
name_pos = c(0.5, 0.2),
plot_type = "line",
x = seq(-3.3, 3.3, 0.01),
top_space = 0,
ddist = function(x, mean, sd, left_limit) {ifelse(x > left_limit, dnorm(x, mean, sd), 0)},
ddist_params = list(mean=0, sd=1, left_limit=-1.75),
labels = list(mean = c(0.5, 0.45), right_sd = c(0.77, 0.60), left_limit=c(0.17,0.175), left_sd = c(0.23, 0.60))
),
"cauchy" = list(
name = "Cauchy",
name_pos = c(0.5, 0.1),
plot_type = "line",
x = seq(-3.0, 3.0, 0.01),
top_space = 0,
ddist = dt,
ddist_params = list(ncp=0, df=1),
labels = list(location = c(0.5, 0.3), right_scale = c(0.77, 0.55), left_scale = c(0.23, 0.55))
),
"half-t" = list(
name = "half-t",
name_pos = c(0.3, 0.1),
plot_type = "line",
x = seq(0.0, 3.0, 0.01),
top_space = 0,
ddist = dt,
ddist_params = list(ncp=0, df=3),
labels = list(scale = c(0.43, 0.62), df = c(0.65, 0.4))
),
"half-cauchy" = list(
name = "half-Cauchy",
name_pos = c(0.36, 0.1),
plot_type = "line",
x = seq(0.0, 3.0, 0.01),
top_space = 0,
ddist = dt,
ddist_params = list(ncp=0, df=1),
labels = list(scale = c(0.53, 0.5))
),
"half-normal" = list(
name = "half-normal",
name_pos = c(0.36, 0.1),
plot_type = "line",
x = seq(0.0, 3.0, 0.01),
top_space = 0,
ddist = dnorm,
ddist_params = list(mean=0, sd=1),
labels = list(sd = c(0.53, 0.5))
)
)
.LazyEnv = new.env()
assign("distributions", distributions, envir=.LazyEnv)
rm(distributions)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.