Learn R Programming

distr6 (version 1.1.0)

HuberizedDistribution: Distribution Huberization Wrapper

Description

A wrapper for huberizing any probability distribution at given limits.

Value

Returns an R6 object of class HuberizedDistribution.

Constructor

HuberizedDistribution$new(distribution, lower = NULL, upper = NULL)

Constructor Arguments

Argument Type Details
distribution distribution Distribution to huberize.
lower numeric Lower limit for huberization.

Public Variables

Variable Return
name Name of distribution.
short_name Id of distribution.
description Brief description of distribution.

Public Methods

Accessor Methods Link
wrappedModels(model = NULL) wrappedModels
decorators() decorators
traits() traits
valueSupport() valueSupport
variateForm() variateForm
type() type
properties() properties
support() support
symmetry() symmetry
sup() sup
inf() inf
dmax() dmax
dmin() dmin
skewnessType() skewnessType
kurtosisType() kurtosisType
d/p/q/r Methods Link
pdf(x1, ..., log = FALSE, simplify = TRUE) pdf
cdf(x1, ..., lower.tail = TRUE, log.p = FALSE, simplify = TRUE) cdf
quantile(p, ..., lower.tail = TRUE, log.p = FALSE, simplify = TRUE) quantile.Distribution
rand(n, simplify = TRUE) rand
Statistical Methods Link
prec() prec
stdev() stdev
median() median.Distribution
iqr() iqr
cor() cor
Parameter Methods Link
parameters(id) parameters
getParameterValue(id, error = "warn") getParameterValue
setParameterValue(..., lst = NULL, error = "warn") setParameterValue
Validation Methods Link
liesInSupport(x, all = TRUE, bound = FALSE) liesInSupport
liesInType(x, all = TRUE, bound = FALSE) liesInType
Representation Methods Link
strprint(n = 2) strprint
print(n = 2) print
summary(full = T) summary.Distribution
plot() Coming Soon.
qqplot() Coming Soon.

Details

Huberizes a distribution at lower and upper limits, using the formula

\(f_H(x) = F(x), if x \le lower\)

\(f_H(x) = f(x), if lower < x < upper\)

\(f_H(x) = F(x), if x \ge 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.

If lower or upper are NULL they are taken to be self$inf() and self$sup() respectively.

The pdf and cdf of the distribution are required for this wrapper, if unavailable decorate with FunctionImputation first.

See Also

listWrappers, FunctionImputation, huberize

Examples

Run this code
# NOT RUN {
hubBin <- HuberizedDistribution$new(
          Binomial$new(prob = 0.5, size = 10),
          lower = 2, upper = 4)
hubBin$getParameterValue("prob")
hubBin$pdf(2)

# }

Run the code above in your browser using DataLab