Learn R Programming

distr6 (version 1.5.6)

ExoticStatistics: Exotic Statistical Methods Decorator

Description

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.

Arguments

Super class

distr6::DistributionDecorator -> ExoticStatistics

Methods

Public methods

Method 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.

Usage

ExoticStatistics$cdfAntiDeriv(lower = NULL, upper = NULL)

Arguments

lower

(numeric(1) Lower bounds of integral.

upper

(numeric(1) Upper bounds of integral.

Method 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.

Usage

ExoticStatistics$survivalAntiDeriv(lower = NULL, upper = NULL)

Arguments

lower

(numeric(1) Lower bounds of integral.

upper

(numeric(1) Upper bounds of integral.

Method 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.

Usage

ExoticStatistics$survival(..., log = FALSE, simplify = TRUE, data = NULL)

Arguments

...

(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.

Method 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.

Usage

ExoticStatistics$hazard(..., log = FALSE, simplify = TRUE, data = NULL)

Arguments

...

(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.

Method 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.

Usage

ExoticStatistics$cumHazard(..., log = FALSE, simplify = TRUE, data = NULL)

Arguments

...

(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.

Method 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.

Usage

ExoticStatistics$cdfPNorm(p = 2, lower = NULL, upper = NULL)

Arguments

p

(integer(1)) Norm to evaluate.

lower

(numeric(1) Lower bounds of integral.

upper

(numeric(1) Upper bounds of integral.

Method 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.

Usage

ExoticStatistics$pdfPNorm(p = 2, lower = NULL, upper = NULL)

Arguments

p

(integer(1)) Norm to evaluate.

lower

(numeric(1) Lower bounds of integral.

upper

(numeric(1) Upper bounds of integral.

Method 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.

Usage

ExoticStatistics$survivalPNorm(p = 2, lower = NULL, upper = NULL)

Arguments

p

(integer(1)) Norm to evaluate.

lower

(numeric(1) Lower bounds of integral.

upper

(numeric(1) Upper bounds of integral.

Method clone()

The objects of this class are cloneable with this method.

Usage

ExoticStatistics$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

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.

See Also

Other decorators: CoreStatistics, FunctionImputation

Examples

Run this code
# NOT RUN {
decorate(Exponential$new(), "ExoticStatistics")
Exponential$new(decorators = "ExoticStatistics")
ExoticStatistics$new()$decorate(Exponential$new())
# }

Run the code above in your browser using DataLab