Learn R Programming

edecob (version 1.2.2)

conf_band: Confidence Bounds of the Smoother

Description

Calculate the confidence bounds of the smoother function using the bootstrap.

Usage

conf_band(bt_smoother, smoother_pts, bt_tot_rep, conf_band_lvl)

Value

A data frame containing the upper confidence bound, the lower confidence bound, and the time point corresponding to the bounds.

Arguments

bt_smoother

A data frame containing the bootstrapped smoother. Use the output of bt_smoother.

smoother_pts

A data frame containing the smoother. Preferably the output of one of the smoother functions included in this package.

bt_tot_rep

The number of iterations for the bootstrap computation. Because of run time, it is recommended to keep this number below 500. Defaults to 100.

conf_band_lvl

The confidence level for the simultaneous confidence bands. Defaults to 0.95. When detection of events using only the smoother is desired, conf_band_lvl can be chosen to be 0.

Details

The procedure is as follows:

  1. We compute the quantiles $$ q_x(t_i), q_{1-x}(t_i) i = 1,\dots, N$$ where $$q_x(t_i) = inf\left\{u; P^*[S(t_i)^*_b - S(t_i) \le u] \ge x\right\} $$ is a pointwise bootstrap quantile, \(S(t_i)^*_b\) the bootstrapped smoother, and \(N\) the number of measurements or rows in data, in our case the number of rows.

  2. We vary the pointwise error \(x\) until $$P^*[q_x(t_i) \le S(t_i)^*_b - S(t_i) \le q_{1-x}(t_i) \forall i = 1,\dots, N] \approx 1-\alpha.$$ In other words, until the ratio of bootstrap curves that have all their points within \([q_x(t_i), q_{1-x}(t_i)]\) is approximately \(1-\alpha\).

  3. We define $$ I_n(t_i) = [S(t_i) + q_x(t_i), S(t_i) + q_{1-x}(t_i)] \forall i = 1,\dots, N$$ the confidence bounds. Then \({I_n(t_i); i = 1,\dots, N}\) is a consistent simultaneous confidence band of level \(1-\alpha\).

References

Bühlmann, P. (1998). Sieve Bootstrap for Smoothing in Nonstationary Time Series. The Annals of Statistics, 26(1), 48-83.