Learn R Programming

logcondens (version 2.0.6)

rlogcon: 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, not necessarily unique.

Value

  • XRandom sample from $\hat f_n$.
  • X_starRandom sample from $\hat f_n^*$.
  • UUniform random sample of size n used in the generation of X.
  • ZNormal random sample of size n used in the generation of X_star.
  • fComputed log-concave density estimator.
  • f.smoothedList containing smoothed log-concave density estimator, as output by evaluateLogConDens.
  • xVector of distinct observations generated from x0.
  • wWeights corresponding to x.

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. Duembgen, L. and Rufibach, K. (2011) logcondens: Computations Related to Univariate Log-Concave Density Estimation. Journal of Statistical Software, 39(6), 1--28. http://www.jstatsoft.org/v39/i06

Examples

Run this code
## ===================================================
## Generate random samples as described in Section 3 of
## Duembgen and Rufibach (2009)
## ===================================================
x0 <- 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

Run the code above in your browser using DataLab