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

simplifyD-methods

Methods for function simplifyD in Package ‘distr’


Description

simplifyD-methods

Usage

simplifyD(object)

Arguments

object

distribution object

Details

generating functions UnivarMixingDistribution Minimum, Maximum, Truncate, and Huberize have an argument withSimplify which decides whether the respective result is filtered by/piped through a call to simplifyD. By default this argument is set to the distr-option getdistrOption("simplifyD" (for the inspection and modification of such global options see distroptions). Depending on whether or not this option is TRUE, also arithmetic operations "+", "*", "/", "^" and group Math give results filtered by/piped through a call to simplifyD.

Value

the corresponding, possibly simplified distribution

Methods

simplifyD

signature(object = "AbscontDistribution"): returns object unchanged

simplifyD

signature(object = "DiscreteDistribution"): returns object unchanged

simplifyD

signature(object = "UnivarLebDecDistribution"): checks whether acWeight or discreteWeight is approximately (i.e.; up to getdistrOption("TruncQuantile")) zero and if so, accordingly returns discretePart(object) or acPart(object), respectively.

simplifyD

signature(object = "UnivarMixingDistribution"): returns the flattened version of object (using flat.mix). before doing so, it checks whether any component carries weight approximately (i.e.; up to getdistrOption("TruncQuantile")) one (in slot mixCoeff) and if so, returns this component; else, if not all weights are below getdistrOption("TruncQuantile")), it filters out those components with weight less than getdistrOption("TruncQuantile")).

See Also

Examples

set.seed(123)
Mix1 <- UnivarMixingDistribution(Norm(),Binom(2,.3),
  UnivarLebDecDistribution(acPart = Chisq(df = 2), discretePart = Nbinom(3,.09),
                           acWeight = 0.3),
  Norm()-Chisq(df=3), mixCoeff=c(0,0,0.2,0.8), withSimplify = FALSE)
Mix2 <- UnivarMixingDistribution(Norm(),Mix1, DExp(2),
        mixCoeff = c(0,0.2,0.8), withSimplify = FALSE)
Mix2        
simplifyD(Mix2)

distr

Object Oriented Implementation of Distributions

v2.8.0
LGPL-3
Authors
Florian Camphausen [ctb] (contributed as student in the initial phase --2005), Matthias Kohl [aut, cph], Peter Ruckdeschel [cre, cph], Thomas Stabla [ctb] (contributed as student in the initial phase --2005), R Core Team [ctb, cph] (for source file ks.c/ routines 'pKS2' and 'pKolmogorov2x')
Initial release
2019-03-11

We don't support your browser anymore

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