Learn R Programming

distr6 (version 1.0.0)

VectorDistribution: Vectorise Distributions

Description

A wrapper for creating a vector of distributions.

Value

Returns an R6 object of class VectorDistribution.

Constructor

VectorDistribution$new(distlist, name = NULL, short_name = NULL, description = NULL)

Constructor Arguments

Argument Type Details
distlist list List of distributions.
name list Optional new name for distribution.
short_name list Optional new short_name for distribution.
description list Optional new description for distribution.

Public Variables

Variable Return
name Name of distribution.
short_name Id of distribution.
description Brief description of distribution.

Public Methods

Accessor Methods Link
wrappedModels(model = NULL) wrappedModels
decorators() decorators
traits() traits
valueSupport() valueSupport
variateForm() variateForm
type() type
properties() properties
support() support
symmetry() symmetry
sup() sup
inf() inf
dmax() dmax
dmin() dmin
skewnessType() skewnessType
kurtosisType() kurtosisType
d/p/q/r Methods Link
pdf(x1, ..., log = FALSE, simplify = TRUE) pdf
cdf(x1, ..., lower.tail = TRUE, log.p = FALSE, simplify = TRUE) cdf
quantile(p, ..., lower.tail = TRUE, log.p = FALSE, simplify = TRUE) quantile.Distribution
rand(n, simplify = TRUE) rand
Statistical Methods Link
prec() prec
stdev() stdev
median() median.Distribution
iqr() iqr
cor() cor
Parameter Methods Link
parameters(id) parameters
getParameterValue(id, error = "warn") getParameterValue
setParameterValue(..., lst = NULL, error = "warn") setParameterValue
Validation Methods Link
liesInSupport(x, all = TRUE, bound = FALSE) liesInSupport
liesInType(x, all = TRUE, bound = FALSE) liesInType
Representation Methods Link
strprint() strprint
print() print
summary(full = T) summary.Distribution
plot() Coming Soon.
qqplot() Coming Soon.

Details

A vector of distributions has the following relationship $$f_V(X1 = x1,...,XN = xN) = f_{X1}(x1), ..., f_{XN}(xn)$$ $$F_V(X1 = x1,...,XN = xN) = F_{X1}(x1), ..., F_{XN}(xn)$$ where \(f_V\)/\(F_V\) is the pdf/cdf of the vector of distributions \(V\) and \(X1,...,XN\) are distributions.

See Also

listWrappers

Examples

Run this code
# NOT RUN {
vecBin <- VectorDistribution$new(list(Binomial$new(prob = 0.5,
                           size = 10), Normal$new(mean = 15)))
vecBin$pdf(x1 = 2, x2 =3)
vecBin$cdf(1:5, 12:16)
vecBin$quantile(c(0.1,0.2),c(0.3,0.4))
vecBin$rand(10)

# }

Run the code above in your browser using DataLab