| Distribution | R Documentation |
An R6 class representing a (possibly multivariate) distribution.
The base class for particular univariate or multivariate distributions.
new()Create an object of class Distribution.
Distribution$new(name, K = 1L)
nameName of the distribution ("Beta" etc.)
KOrder of the distribution (1 = univariate, 2 = bivariate etc.). Must be an integer; use 1L, 3L etc. to avoid an error.
An object of class Distribution.
order()Order of the distribution
Distribution$order()
Order (K).
distribution()Description of the uncertainty distribution.
Distribution$distribution()
Includes the distribution name and its parameters.
Distribution name and parameters as character string.
mean()Mean value of the distribution.
Distribution$mean()
Mean value as a numeric scalar (K = 1L) or vector of
length K.
mode()Return the mode of the distribution.
Distribution$mode()
By default returns NA, which will be the case for most
because an arbitrary distribution is not guaranteed to be unimodal.
Mode as a numeric scalar (K = 1L) or vector of
length K.
SD()Return the standard deviation of a univariate distribution.
Distribution$SD()
Only defined for univariate (K = 1L) distributions; for
multivariate distributions, function varcov returns the
variance-covariance matrix.
Standard deviation as a numeric value.
varcov()Variance-covariance matrix.
Distribution$varcov()
A positive definite symmetric matrix of size K by
K, or a scalar for K = 1L, equal to the variance.
quantile()Marginal quantiles of the distribution.
Distribution$quantile(probs)
probsNumeric vector of probabilities, each in range [0,1].
If they are defined, this function returns the marginal
quantiles of the multivariate distribution; i.e. the quantiles of each
univariate marginal distribution of the multivariate distribution. For
example, the univariate marginal distributions of a multivariate
normal are univariate normals, and the univariate marginal distributions
of a Dirichlet distribution are Beta distributions. Note that these are
not the true quantiles of a multivariate distribution, which are contours
for K = 2L, surfaces for K = 3L, etc. For example, the
2.5% and 97.5% marginal quantiles of a bivariate normal distribution
define a rectangle in x_1, x_2 space that will include more than
95% of the distribution, whereas the contour containing 95% of the
distribution is an ellipse.
For K = 1L a numeric vector of length equal to the length
of probs, with each entry labelled with the quantile. For
K > 1L a matrix of numeric values with the number of rows equal
to the length of probs, the number of columns equal to the order;
rows are labelled with probabilities and columns with the dimension
(1, 2, etc).
sample()Draw and hold a random sample from the distribution.
Distribution$sample(expected = FALSE)
expectedIf TRUE, sets the next value retrieved by a call to
r() to be the mean of the distribution.
Void
r()Return a random sample drawn from the distribution.
Distribution$r()
Returns the sample generated at the last call to sample.
A vector of length K representing one sample.
clone()The objects of this class are cloneable with this method.
Distribution$clone(deep = FALSE)
deepWhether to make a deep clone.
Andrew J. Sims andrew.sims@newcastle.ac.uk
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.