# HuberizedDistribution: Distribution Huberization Wrapper In distr6: The Complete R6 Probability Distributions Interface

 HuberizedDistribution R Documentation

## Distribution Huberization Wrapper

### Description

A wrapper for huberizing any probability distribution at given limits.

### Details

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.

### Super classes

`distr6::Distribution` -> `distr6::DistributionWrapper` -> `HuberizedDistribution`

### Active bindings

`properties`

Returns distribution properties, including skewness type and symmetry.

### Methods

#### Public methods

Inherited methods

#### Method `new()`

Creates a new instance of this R6 class.

##### Usage
`HuberizedDistribution\$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
```HuberizedDistribution\$new(
Binomial\$new(prob = 0.5, size = 10),
lower = 2, upper = 4
)

# alternate constructor
huberize(Binomial\$new(), lower = 2, upper = 4)
```

#### Method `clone()`

The objects of this class are cloneable with this method.

##### Usage
`HuberizedDistribution\$clone(deep = FALSE)`
##### Arguments
`deep`

Whether to make a deep clone.

Other wrappers: `Convolution`, `DistributionWrapper`, `MixtureDistribution`, `ProductDistribution`, `TruncatedDistribution`, `VectorDistribution`

### Examples

```
## ------------------------------------------------
## 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)
```

distr6 documentation built on March 28, 2022, 1:05 a.m.