Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

decorate

Decorate Distributions


Description

Functionality to decorate R6 Distributions (and child classes) with extra methods.

Usage

decorate(distribution, decorators, ...)

Arguments

distribution

([Distribution])
Distribution to decorate.

decorators

(character()) Vector of DistributionDecorator names to decorate the Distribution with.

...

ANY
Extra arguments passed down to specific decorators.

Details

Decorating is the process of adding methods to classes that are not part of the core interface (Gamma et al. 1994). Use listDecorators to see which decorators are currently available. The primary use-cases are to add numeric results when analytic ones are missing, to add complex modelling functions and to impute missing d/p/q/r functions.

Value

Returns a Distribution with additional methods from the chosen DistributionDecorator.

References

Gamma, Erich, Richard Helm, Ralph Johnson, and John Vlissides. 1994. “Design Patterns: Elements of Reusable Object-Oriented Software.” Addison-Wesley.

See Also

listDecorators() for available decorators and DistributionDecorator for the parent class.

Examples

B <- Binomial$new()
decorate(B, "CoreStatistics")

E <- Exponential$new()
decorate(E, c("CoreStatistics", "ExoticStatistics"))

distr6

The Complete R6 Probability Distributions Interface

v1.5.2
MIT + file LICENSE
Authors
Raphael Sonabend [aut, cre] (<https://orcid.org/0000-0001-9225-4654>), Franz Kiraly [aut], Peter Ruckdeschel [ctb] (Author of distr), Matthias Kohl [ctb] (Author of distr), Nurul Ain Toha [ctb], Shen Chen [ctb], Jordan Deenichin [ctb], Chengyang Gao [ctb], Chloe Zhaoyuan Gu [ctb], Yunjie He [ctb], Xiaowen Huang [ctb], Shuhan Liu [ctb], Runlong Yu [ctb], Chijing Zeng [ctb], Qian Zhou [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.