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

flat.mix

Default procedure to fill slots d,p,q given r for Lebesgue decomposed distributions


Description

function to do get empirical density, cumulative distribution and quantile function from random numbers

Usage

flat.mix(object)

Arguments

object

object of class UnivariateMixingDistribution

Details

flat.mix generates 10^e random numbers, by default

e = RtoDPQ.e

. Replicates are assumed to be part of the discrete part, unique values to be part of the a.c. part of the distribution. For the replicated ones, we generate a discrete distribution by a call to DiscreteDistribution. The a.c. density is formed on the basis of n points using approxfun and density (applied to the unique values), by default

n = DefaultNrGridPoints

. The cumulative distribution function is based on all random variables, and, as well as the quantile function, is also created on the basis of n points using approxfun and ecdf. Of course, the results are usually not exact as they rely on random numbers.

Value

flat.mix returns an object of class UnivarLebDecDistribution.

Note

Use RtoDPQ for absolutely continuous and RtoDPQ.d for discrete distributions.

Author(s)

See Also

Examples

D1 <- Norm()
D2 <- Pois(1)
D3 <- Binom(1,.4)
D4 <- UnivarMixingDistribution(D1,D2,D3, mixCoeff = c(0.4,0.5,0.1), 
      withSimplify = FALSE)
D <- UnivarMixingDistribution(D1,D4,D1,D2, mixCoeff = c(0.4,0.3,0.1,0.2), 
      withSimplify = FALSE)
D
D0<-flat.mix(D)
D0
plot(D0)

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.