Generate a sequence of n-quantiles, i.e., a sample of size n with a near-perfect distribution.
distribution(type = "normal", ...)distribution_normal(n, mean = 0, sd = 1, random = FALSE, ...)
distribution_binomial(n, size = 1, prob = 0.5, random = FALSE, ...)
distribution_cauchy(n, location = 0, scale = 1, random = FALSE, ...)
distribution_poisson(n, lambda = 1, random = FALSE, ...)
distribution_student(n, df, ncp, random = FALSE, ...)
distribution_chisquared(n, df, ncp = 0, random = FALSE, ...)
distribution_uniform(n, min = 0, max = 1, random = FALSE, ...)
distribution_beta(n, shape1, shape2, ncp = 0, random = FALSE, ...)
distribution_tweedie(n, xi = NULL, mu, phi, power = NULL, random = FALSE, ...)
distribution_gamma(n, shape, scale = 1, random = FALSE, ...)
distribution_custom(n, type = "norm", ..., random = FALSE)
distribution_mixture_normal(n, mean = c(-3, 3), sd = 1, random = FALSE, ...)
rnorm_perfect(n, mean = 0, sd = 1)
Can be any of the names from base R's Distributions, like "cauchy", "pois" or "beta".
Arguments passed to or from other methods.
the number of observations
vector of means.
vector of standard deviations.
Generate near-perfect or random (simple wrappers for the base R r* functions) distributions.
number of trials (zero or more).
probability of success on each trial.
location and scale parameters.
location and scale parameters.
vector of (non-negative) means.
degrees of freedom (\(> 0\), maybe non-integer). df
= Inf is allowed.
non-centrality parameter \(\delta\);
currently except for rt(), only for abs(ncp) <= 37.62.
If omitted, use the central t distribution.
lower and upper limits of the distribution. Must be finite.
lower and upper limits of the distribution. Must be finite.
non-negative parameters of the Beta distribution.
non-negative parameters of the Beta distribution.
the value of \(\xi\) such that the variance is \(\mbox{var}[Y]=\phi\mu^{\xi}\)
the mean
the dispersion
a synonym for \(\xi\)
shape and scale parameters. Must be positive,
scale strictly.
# NOT RUN {
library(bayestestR)
x <- distribution(n = 10)
plot(density(x))
x <- distribution(type = "gamma", n = 100, shape = 2)
plot(density(x))
# }
Run the code above in your browser using DataLab