rlogcon {logcondens}R Documentation

Generate random sample from the log-concave and the smoothed log-concave density estimator

Description

Generate a random sample from a distribution with density \hat f_n and \hat f_n^*, as described in Duembgen and Rufibach (2009, Section 3).

Usage

rlogcon(n, x0)

Arguments

n Size of random sample to be generated.
x0 Sorted vector of independent and identically distributed numbers. Note that unlike for activeSetLogCon, here x0 is the vector of initial, unweighted observations, i.e. identical values are allowed.

Value

X Random sample from \hat f_n.
X_star Random sample from \hat f_n^*.
U Uniform random sample of size n used in the generation of X.
Z Normal random sample of size n used in the generation of X_star.
f Computed log-concave density estimator.
f.smoothed List containing smoothed log-concave density estimator, as output by logconSmoothed.
x Vector of distinct observations generated from x0.
w Weights corresponding to x.

Author(s)

Kaspar Rufibach, kaspar.rufibach@ifspm.uzh.ch,
http://www.biostat.uzh.ch/aboutus/people/rufibach.html

Lutz Duembgen, duembgen@stat.unibe.ch,
http://www.staff.unibe.ch/duembgen

References

Duembgen, L. and Rufibach, K. (2009) Maximum likelihood estimation of a log–concave density and its distribution function: basic properties and uniform consistency. Bernoulli, 15(1), 40–68.

Examples


## ===================================================
## Generate random samples as described in Section 3 of
## Duembgen and Rufibach (2009)
## ===================================================
x0 <- sort(rnorm(111))
n <- 22
random <- rlogcon(n, x0)

## sample of size n from the log-concave density estimator
random$X

## sample of size n from the smoothed log-concave density estimator
random$X_star

[Package logcondens version 1.3.5 Index]