DiracDistribution | R Documentation |
An R6 class representing a Dirac Delta function.
A distribution modelled by a Dirac delta function \delta(x-c)
where c
is the hyperparameter (value of the constant). It has
probability 1 that the value will be equal to c
and zero otherwise.
The mode, mean, quantiles and random samples are all equal to c
. It is
acknowledged that there is debate over whether Dirac delta functions are
true distributions, but the assumption makes little practical difference in
this case. Inherits from class Distribution
.
rdecision::Distribution
-> DiracDistribution
new()
Create a new Dirac Delta function distribution.
DiracDistribution$new(const)
const
The value at which the distribution is centred.
A new DiracDistribution
object.
distribution()
Accessor function for the name of the distribution.
DiracDistribution$distribution()
Distribution name as character string.
mode()
Return the mode of the distribution.
DiracDistribution$mode()
Numeric Value where the distribution is centered.
mean()
Return the expected value of the distribution.
DiracDistribution$mean()
Expected value as a numeric value.
SD()
Return the standard deviation of the distribution.
DiracDistribution$SD()
Standard deviation as a numeric value
quantile()
Quantiles of the distribution.
DiracDistribution$quantile(probs)
probs
Numeric vector of probabilities, each in range [0,1].
For a Dirac Delta Function all quantiles are returned as the value at which the distribution is centred.
Vector of numeric values of the same length as probs
.
sample()
Draw and hold a random sample from the model variable.
DiracDistribution$sample(expected = FALSE)
expected
If TRUE, sets the next value retrieved by a call to
r()
to be the mean of the distribution.
Updated distribution.
clone()
The objects of this class are cloneable with this method.
DiracDistribution$clone(deep = FALSE)
deep
Whether to make a deep clone.
Andrew Sims andrew.sims@newcastle.ac.uk
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.