# RtoDPQ.LC: Default procedure to fill slots d,p,q given r for Lebesgue... In distr: Object Oriented Implementation of Distributions

## Description

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

## Usage

 1 2 RtoDPQ.LC(r, e = getdistrOption("RtoDPQ.e"), n = getdistrOption("DefaultNrGridPoints"), y = NULL)

## Arguments

 r the random number generator e 10^e numbers are generated, a higher number leads to a better result. n The number of grid points used to create the approximated functions, a higher number leads to a better result. y a (numeric) vector or NULL

## Details

RtoDPQ.LC 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.

For the a.c. part, similarly to RtoDPQ we have an optional parameter y for using N. Horbenko's quantile trick: i.e.; on an equally spaced grid x.grid on [0,1], apply f(q(x)(x.grid)), write the result to y and use these values instead of simulated ones.

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

RtoDPQ.LC returns an object of class UnivarLebDecDistribution.

## Note

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

## Author(s)

Peter Ruckdeschel [email protected]