View source: R/uncertainty_quantification.R
| vbands | R Documentation |
Compute variability bands for the optimized trend filtering estimate via the
sample quantiles of the bootstrap ensemble generated by
bootstrap_trendfilter().
vbands(obj, level = 0.95)
obj |
A " |
level |
The level of the pointwise variability bands. Defaults to |
A tibble with column set c("x","lower_band","upper_band").
Politsch et al. (2020a). Trend filtering – I. A modern statistical tool for time-domain astronomy and astronomical spectroscopy. MNRAS, 492(3), p. 4005-4018. [Publisher] [arXiv].
Politsch et al. (2020b). Trend Filtering – II. Denoising astronomical signals with varying degrees of smoothness. MNRAS, 492(3), p. 4019-4032. [Publisher] [arXiv].
bootstrap_trendfilter()
# Example 1: Phase-folded light curve of an eclipsing binary star system
#
# The apparent brightness over time of a star system that has two suns
# that regularly eclipse one another from our vantage point on Earth. Here,
# the time series is stacked according to the orbital period of the binary
# system, with the primary eclipse occuring at `phase = 0` and the input
# domain ranging from -0.5 to 0.5.
data("eclipsing_binary")
head(eclipsing_binary)
x <- eclipsing_binary$phase
y <- eclipsing_binary$flux
weights <- 1 / eclipsing_binary$std_err^2
cv_tf <- cv_trendfilter(
x = x,
y = y,
weights = weights,
max_iter = 1e4,
obj_tol = 1e-6
)
boot_tf <- bootstrap_trendfilter(
obj = cv_tf,
algorithm = "nonparametric",
edf = cv_tf$edf_min["MAE"]
)
bands <- vbands(boot_tf)
# Example 2: The "Lyman-alpha forest" in the spectrum of a distant quasar
data("quasar_spectrum")
head(quasar_spectrum)
x <- quasar_spectrum$log10_wavelength
y <- quasar_spectrum$flux
weights <- quasar_spectrum$weights
sure_tf <- sure_trendfilter(x, y, weights)
boot_tf <- bootstrap_trendfilter(
obj = sure_tf,
algorithm = "parametric",
edf = sure_tf$edf_min
)
bands <- vbands(boot_tf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.