|
| 1 | +# Censored Distributions |
| 2 | + |
| 3 | +In *censoring* of data, values exceeding an upper limit (right censoring) or falling below a lower limit (left censoring), or both (interval censoring) are replaced by the corresponding limit itself. |
| 4 | +The package provides the `censored` function, which creates the most appropriate distribution to represent a censored version of a given distribution. |
| 5 | + |
| 6 | +A censored distribution can be constructed using the following signature: |
| 7 | + |
| 8 | +```@docs |
| 9 | +censored |
| 10 | +``` |
| 11 | + |
| 12 | +In the general case, this will create a `Distributions.Censored{typeof(d0)}` structure, defined as follows: |
| 13 | + |
| 14 | +```@docs |
| 15 | +Distributions.Censored |
| 16 | +``` |
| 17 | + |
| 18 | +In general, `censored` should be called instead of the constructor of `Censored`, which is not exported. |
| 19 | + |
| 20 | +Many functions, including those for the evaluation of pdf and sampling, are defined for all censored univariate distributions: |
| 21 | + |
| 22 | +- [`maximum(::UnivariateDistribution)`](@ref) |
| 23 | +- [`minimum(::UnivariateDistribution)`](@ref) |
| 24 | +- [`insupport(::UnivariateDistribution, x::Any)`](@ref) |
| 25 | +- [`pdf(::UnivariateDistribution, ::Real)`](@ref) |
| 26 | +- [`logpdf(::UnivariateDistribution, ::Real)`](@ref) |
| 27 | +- [`cdf(::UnivariateDistribution, ::Real)`](@ref) |
| 28 | +- [`logcdf(::UnivariateDistribution, ::Real)`](@ref) |
| 29 | +- [`logdiffcdf(::UnivariateDistribution, ::T, ::T) where {T <: Real}`](@ref) |
| 30 | +- [`ccdf(::UnivariateDistribution, ::Real)`](@ref) |
| 31 | +- [`logccdf(::UnivariateDistribution, ::Real)`](@ref) |
| 32 | +- [`quantile(::UnivariateDistribution, ::Real)`](@ref) |
| 33 | +- [`cquantile(::UnivariateDistribution, ::Real)`](@ref) |
| 34 | +- [`invlogcdf(::UnivariateDistribution, ::Real)`](@ref) |
| 35 | +- [`invlogccdf(::UnivariateDistribution, ::Real)`](@ref) |
| 36 | +- [`median(::UnivariateDistribution)`](@ref) |
| 37 | +- [`rand(::UnivariateDistribution)`](@ref) |
| 38 | +- [`rand!(::UnivariateDistribution, ::AbstractArray)`](@ref) |
| 39 | + |
| 40 | +Some functions to compute statistics are available for the censored distribution if they are also available for its truncation: |
| 41 | +- [`mean(::UnivariateDistribution)`](@ref) |
| 42 | +- [`var(::UnivariateDistribution)`](@ref) |
| 43 | +- [`std(::UnivariateDistribution)`](@ref) |
| 44 | +- [`entropy(::UnivariateDistribution)`](@ref) |
| 45 | + |
| 46 | +For example, these functions are available for the following uncensored distributions: |
| 47 | +- `DiscreteUniform` |
| 48 | +- `Exponential` |
| 49 | +- `LogUniform` |
| 50 | +- `Normal` |
| 51 | +- `Uniform` |
| 52 | + |
| 53 | +[`mode`](@ref) is not implemented for censored distributions. |
0 commit comments