Distribution Huberization Wrapper
A wrapper for huberizing any probability distribution at given limits.
The pdf and cdf of the distribution are required for this wrapper, if unavailable decorate with FunctionImputation first.
Huberizes a distribution at lower and upper limits, using the formula
f_H(x) = F(x), if x ≤ lower
f_H(x) = f(x), if lower < x < upper
f_H(x) = F(x), if x ≥ upper
where f_H is the pdf of the truncated distribution H = Huberize(X, lower, upper) and f_X/F_X is the pdf/cdf of the original distribution.
distr6::Distribution
-> distr6::DistributionWrapper
-> HuberizedDistribution
new()
Creates a new instance of this R6 class.
HuberizedDistribution$new(distribution, lower = NULL, upper = NULL)
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.
HuberizedDistribution$new( Binomial$new(prob = 0.5, size = 10), lower = 2, upper = 4 ) # alternate constructor huberize(Binomial$new(), lower = 2, upper = 4)
setParameterValue()
Sets the value(s) of the given parameter(s).
HuberizedDistribution$setParameterValue( ..., lst = NULL, error = "warn", resolveConflicts = FALSE )
...
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"
.
resolveConflicts
(logical(1))
If FALSE
(default) throws error if conflicting parameterisations are provided, otherwise
automatically resolves them by removing all conflicting parameters.
clone()
The objects of this class are cloneable with this method.
HuberizedDistribution$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `HuberizedDistribution$new` ## ------------------------------------------------ HuberizedDistribution$new( Binomial$new(prob = 0.5, size = 10), lower = 2, upper = 4 ) # alternate constructor huberize(Binomial$new(), lower = 2, upper = 4)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.