This function creates a confidence envelope for the empirical density by bootstrapping from the data. Transparency is used to indicate the level of uncertainty.

Arguments

data

The data to be displayed in this layer.

mapping

Default list of aesthetic mappings to use for plot.

k

Number of bootstrapped smoothers. The default is 1000.

color

Color for the bootstrapped densities that make up the confidence envelope. The default is color="#1D91C0"

alpha

Transparency level for the paths that make up the bootstrapped fitted lines. This may need to be adjusted if the argument k= is changed. The default value is alpha=0.03.

model

The model to bootstrap from. The default is model="none" which bootstraps from the data. Using model="normal" draws repeated samples from a normal distribution with parameters based on the data.

Aesthetics

These stat uses geom_line() so support the same aesthetics: alpha, colour, group, linetype and size.