`R/DistributionDecorator_ExoticStatistics.R`

`ExoticStatistics.Rd`

This decorator adds methods for more complex statistical methods including p-norms, survival and hazard functions and anti-derivatives. If possible analytical expressions are exploited, otherwise numerical ones are used with a message.

Numerical approximations will not work for multivariate distributions.

Decorator objects add functionality to the given Distribution object by copying methods in the decorator environment to the chosen Distribution environment.

All methods implemented in decorators try to exploit analytical results where possible, otherwise numerical results are used with a message.

Other decorators:
`CoreStatistics`

,
`FunctionImputation`

`distr6::DistributionDecorator`

-> `ExoticStatistics`

`cdfAntiDeriv()`

The cdf anti-derivative is defined by $$acdf(a, b) = \int_a^b F_X(x) dx$$
where X is the distribution, \(F_X\) is the cdf of the distribution \(X\) and
\(a, b\) are the `lower`

and `upper`

limits of integration.

`survivalAntiDeriv()`

The survival anti-derivative is defined by
$$as(a, b) = \int_a^b S_X(x) dx$$
where X is the distribution, \(S_X\) is the survival function of the distribution
\(X\) and \(a, b\) are the `lower`

and `upper`

limits of integration.

`survival()`

The survival function is defined by $$S_X(x) = P(X \ge x) = 1 - F_X(x) = \int_x^\infty f_X(x) dx$$ where X is the distribution, \(S_X\) is the survival function, \(F_X\) is the cdf and \(f_X\) is the pdf.

`...`

`(numeric())`

Points to evaluate the function at Arguments do not need to be named. The length of each argument corresponds to the number of points to evaluate, the number of arguments corresponds to the number of variables in the distribution. See examples.`log`

`(logical(1))`

If`TRUE`

returns the logarithm of the probabilities. Default is`FALSE`

.`simplify`

`logical(1)`

If`TRUE`

(default) simplifies the return if possible to a`numeric`

, otherwise returns a data.table::data.table.`data`

array

Alternative method to specify points to evaluate. If univariate then rows correspond with number of points to evaluate and columns correspond with number of variables to evaluate. In the special case of VectorDistributions of multivariate distributions, then the third dimension corresponds to the distribution in the vector to evaluate.

`hazard()`

The hazard function is defined by $$h_X(x) = \frac{f_X}{S_X}$$ where X is the distribution, \(S_X\) is the survival function and \(f_X\) is the pdf.

`...`

`(numeric())`

Points to evaluate the function at Arguments do not need to be named. The length of each argument corresponds to the number of points to evaluate, the number of arguments corresponds to the number of variables in the distribution. See examples.`log`

`(logical(1))`

If`TRUE`

returns the logarithm of the probabilities. Default is`FALSE`

.`simplify`

`logical(1)`

If`TRUE`

(default) simplifies the return if possible to a`numeric`

, otherwise returns a data.table::data.table.`data`

array

Alternative method to specify points to evaluate. If univariate then rows correspond with number of points to evaluate and columns correspond with number of variables to evaluate. In the special case of VectorDistributions of multivariate distributions, then the third dimension corresponds to the distribution in the vector to evaluate.

`cumHazard()`

The cumulative hazard function is defined analytically by $$H_X(x) = -log(S_X)$$ where X is the distribution and \(S_X\) is the survival function.

`...`

`(numeric())`

Points to evaluate the function at Arguments do not need to be named. The length of each argument corresponds to the number of points to evaluate, the number of arguments corresponds to the number of variables in the distribution. See examples.`log`

`(logical(1))`

If`TRUE`

returns the logarithm of the probabilities. Default is`FALSE`

.`simplify`

`logical(1)`

If`TRUE`

(default) simplifies the return if possible to a`numeric`

, otherwise returns a data.table::data.table.`data`

array

Alternative method to specify points to evaluate. If univariate then rows correspond with number of points to evaluate and columns correspond with number of variables to evaluate. In the special case of VectorDistributions of multivariate distributions, then the third dimension corresponds to the distribution in the vector to evaluate.

`cdfPNorm()`

The p-norm of the cdf is defined by
$$(\int_a^b |F_X|^p d\mu)^{1/p}$$
where X is the distribution, \(F_X\) is the cdf and \(a, b\)
are the `lower`

and `upper`

limits of integration.

Returns NULL if distribution is not continuous.

`pdfPNorm()`

The p-norm of the pdf is defined by
$$(\int_a^b |f_X|^p d\mu)^{1/p}$$
where X is the distribution, \(f_X\) is the pdf and \(a, b\)
are the `lower`

and `upper`

limits of integration.

Returns NULL if distribution is not continuous.

`survivalPNorm()`

The p-norm of the survival function is defined by
$$(\int_a^b |S_X|^p d\mu)^{1/p}$$
where X is the distribution, \(S_X\) is the survival function and \(a, b\)
are the `lower`

and `upper`

limits of integration.

Returns NULL if distribution is not continuous.

```
decorate(Exponential$new(), "ExoticStatistics")
#> Exponential is now decorated with ExoticStatistics
#> Exp(rate = 1)
Exponential$new(decorators = "ExoticStatistics")
#> Exp(rate = 1)
ExoticStatistics$new()$decorate(Exponential$new())
#> Exponential is now decorated with ExoticStatistics
```