Public methods
Method new()
Creates a new instance of this R6 class.
Usage
TruncatedDistribution$new(distribution, lower = NULL, upper = NULL)
Arguments
distribution
([Distribution])
Distribution to wrap.
lower
(numeric(1))
Lower limit to huberize the distribution at. If NULL
then the lower bound of
the Distribution is used.
upper
(numeric(1))
Upper limit to huberize the distribution at. If NULL
then the upper bound of
the Distribution is used.
Examples
TruncatedDistribution$new(
Binomial$new(prob = 0.5, size = 10),
lower = 2, upper = 4
)
# alternate constructor
truncate(Binomial$new(), lower = 2, upper = 4)
Method setParameterValue()
Sets the value(s) of the given parameter(s).
Usage
TruncatedDistribution$setParameterValue(..., lst = NULL, error = "warn")
Arguments
...
ANY
Named arguments of parameters to set values for. See examples.
lst
(list(1))
Alternative argument for passing parameters. List names should be parameter names and list values
are the new values to set.
error
(character(1))
If "warn"
then returns a warning on error, otherwise breaks if "stop"
.
Method clone()
The objects of this class are cloneable with this method.
Usage
TruncatedDistribution$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.