conf_band | R Documentation |
Calculate the confidence bounds of the smoother function using the bootstrap.
conf_band(bt_smoother, smoother_pts, bt_tot_rep, conf_band_lvl)
bt_smoother |
A data frame containing the bootstrapped smoother. Use the output of |
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, |
The procedure is as follows:
We compute the quantiles
q_x(t_i), q_{1-x}(t_i) i = 1,…, N
where
q_x(t_i) = inf≤ft\{u; P^*[S(t_i)^*_b - S(t_i) ≤ u] ≥ 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.
We vary the pointwise error x until
P^*[q_x(t_i) ≤ S(t_i)^*_b - S(t_i) ≤ q_{1-x}(t_i) \forall i = 1,…, N] \approx 1-α.
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-α.
We define
I_n(t_i) = [S(t_i) + q_x(t_i), S(t_i) + q_{1-x}(t_i)] \forall i = 1,…, N
the confidence bounds. Then {I_n(t_i); i = 1,…, N} is a consistent simultaneous confidence band of level 1-α.
A data frame containing the upper confidence bound, the lower confidence bound, and the time point corresponding to the bounds.
Bühlmann, P. (1998). Sieve Bootstrap for Smoothing in Nonstationary Time Series. The Annals of Statistics, 26(1), 48-83.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.