ConditionalDistribution: Combine continuous distributions

Description Details Public fields Methods

Description

Combine continuous distributions

Combine continuous distributions

Details

Get a wrapper for multiple (independent) continuous distributions conditioned on a discrete variable

Public fields

classes

the class names

weights

the relative weights of each distribution

dists

the distribution as Distribution objects

Methods

Public methods


Method withDistribution()

adds in a Distribution with a class name and weight

Usage
ConditionalDistribution$withDistribution(
  distribution,
  class = distribution$label(),
  weight = 1
)
Arguments
distribution

the pdf as an R6 Distribution object (Distribution$new(fn, fnParams...))

class

the classname

weight

the relative weight of this class


Method withRandomDistributions()

adds a set of random (uniform, normal, lognormal) distributions to the composite distribution with sensible (random) defaults

Usage
ConditionalDistribution$withRandomDistributions(n = 2)
Arguments
n

the number of distributions to add


Method sample()

produce a set of samples conforming to this distribution, with random discrete value

Usage
ConditionalDistribution$sample(n = 1000)
Arguments
n

the number of samples

Returns

a data frame of samples (labelled x) associated with classes (labelled "class")


Method sampleByClass()

produce a set of samples conforming to this distribution with preset discrete value

Usage
ConditionalDistribution$sampleByClass(classVector)
Arguments
classVector

the number of samples

Returns

a data frame of samples with continuous values (labelled x) associated with discrete classes (labelled "y") and a sample id column (labelled i)


Method getPdf()

get the pdf of these distributions as a dataframe

Usage
ConditionalDistribution$getPdf(xmin, xmax, resolution = 1001)
Arguments
xmin

- the minimum of the support

xmax

- the maximum of the support

resolution

- the number of points in the pdf

Returns

a datafram containing all classes


Method getInverseCdf()

get the inverse cdf of these distributions as a dataframe

Usage
ConditionalDistribution$getInverseCdf(resolution = 1001)
Arguments
resolution

- the number of points in the inverse cdf

Returns

a dataframe containing regular samples of all classes


Method plot()

plot this distributions as pdf and cdf

Usage
ConditionalDistribution$plot(
  xmin = self$theoreticalMean() - 3 * sqrt(self$theoreticalVariance()),
  xmax = self$theoreticalMean() + 3 * sqrt(self$theoreticalVariance())
)
Arguments
xmin

- the minimum of the support

xmax

- the maximum of the support

Returns

a ggassemble plot object


Method theoreticalMI()

generate the theoretical mutual information for this set of distributions using numerical integration of the underlying functions

Usage
ConditionalDistribution$theoreticalMI()
Returns

a single value for the mutual information of this function


Method theoreticalMean()

generate the theoretical mean

Usage
ConditionalDistribution$theoreticalMean()
Returns

a single value for the mean of this function


Method theoreticalVariance()

generate the theoretical variance

Usage
ConditionalDistribution$theoreticalVariance()
Returns

a single value for the variance of this function


Method clone()

The objects of this class are cloneable with this method.

Usage
ConditionalDistribution$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


terminological/classifier-result documentation built on March 14, 2020, 8:04 a.m.