Description Details Public fields Methods
Combine continuous distributions
Combine continuous distributions
Get a wrapper for multiple (independent) continuous distributions conditioned on a discrete variable
classes
the class names
weights
the relative weights of each distribution
dists
the distribution as Distribution objects
withDistribution()
adds in a Distribution with a class name and weight
ConditionalDistribution$withDistribution( distribution, class = distribution$label(), weight = 1 )
distribution
the pdf as an R6 Distribution object (Distribution$new(fn, fnParams...))
class
the classname
weight
the relative weight of this class
withRandomDistributions()
adds a set of random (uniform, normal, lognormal) distributions to the composite distribution with sensible (random) defaults
ConditionalDistribution$withRandomDistributions(n = 2)
n
the number of distributions to add
sample()
produce a set of samples conforming to this distribution, with random discrete value
ConditionalDistribution$sample(n = 1000)
n
the number of samples
a data frame of samples (labelled x) associated with classes (labelled "class")
sampleByClass()
produce a set of samples conforming to this distribution with preset discrete value
ConditionalDistribution$sampleByClass(classVector)
classVector
the number of samples
a data frame of samples with continuous values (labelled x) associated with discrete classes (labelled "y") and a sample id column (labelled i)
getPdf()
get the pdf of these distributions as a dataframe
ConditionalDistribution$getPdf(xmin, xmax, resolution = 1001)
xmin
- the minimum of the support
xmax
- the maximum of the support
resolution
- the number of points in the pdf
a datafram containing all classes
getInverseCdf()
get the inverse cdf of these distributions as a dataframe
ConditionalDistribution$getInverseCdf(resolution = 1001)
resolution
- the number of points in the inverse cdf
a dataframe containing regular samples of all classes
plot()
plot this distributions as pdf and cdf
ConditionalDistribution$plot( xmin = self$theoreticalMean() - 3 * sqrt(self$theoreticalVariance()), xmax = self$theoreticalMean() + 3 * sqrt(self$theoreticalVariance()) )
xmin
- the minimum of the support
xmax
- the maximum of the support
a ggassemble plot object
theoreticalMI()
generate the theoretical mutual information for this set of distributions using numerical integration of the underlying functions
ConditionalDistribution$theoreticalMI()
a single value for the mutual information of this function
theoreticalMean()
generate the theoretical mean
ConditionalDistribution$theoreticalMean()
a single value for the mean of this function
theoreticalVariance()
generate the theoretical variance
ConditionalDistribution$theoreticalVariance()
a single value for the variance of this function
clone()
The objects of this class are cloneable with this method.
ConditionalDistribution$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.