A stationary block bootstrap is applied to resample from a time series that was decomposed into a trend, a seasonal component and a remainder by means of data-driven local polynomial regression with automatically selected bandwidth. Bandwidth re-estimation from each bootstrapped sample results in confidence bounds for the bandwidth.
bwidth_confint(
nonpar_model,
blocklen = NULL,
npaths = 1000,
parallel = TRUE,
num_cores = future::availableCores() - 1,
...
)
A list with the following elements is returned.
conf
A vector with named elements that gives the original bandwidth estimate as well as the bootstrapped bounds of the 95 and 99 percent confidence intervals of the bandwidth.
bwidth_estimates
a vector with all the obtained bandwidths for the bootstrapped series.
se_bwidth
the sample standard deviation of
bwidth_estimates
.
the object with the nonparametric trend and seasonality
estimation results returned by for example the function
deseats
.
a numerical vector of length one that indicates the average
block length to be drawn from the detrended series; the default is
NULL
, which means 8
for quarterly and 24
for monthly
data; selecting a suitable expected blocklength and checking the sensitivity
of the blocklength are left for the user.
a numeric vector of length one that indicates the number of
bootstrap paths; the default is npaths = 1000
.
a logical vector of length one that indicates whether or
not to employ parallel programming for the resampling and the subsequently
data-driven bandwidth estimations from the bootstrapped samples; the default
is patrallel = TRUE
.
a numeric vector of length one that indicates the number of
CPU cores to use for parallel programming, if parallel = TRUE
; the
default is num_cores = future::availableCores() - 1
.
further arguments to pass to deseats
.
Dominik Schulz (Research Assistant) (Department of Economics, Paderborn
University),
Author and Package Creator
Confidence bounds for the bandwidth in local polynomial regression for identifying the trend in a trend-stationary short-memory time series are obtained via a block bootstrap, which ensures that no specific model assumptions are required for the detrended series.
This function makes use of the future
parallel programming
framework to ensure exactly the same results regardless of whether
sequential or parallel programming, and then also regardless of
the number of workers, is employed.
# \donttest{
xt <- log(EXPENDITURES)
est <- deseats(xt, set_options(order_poly = 3))
conf <- bwidth_confint(est, npaths = 200, num_cores = 2)
conf
# }
Run the code above in your browser using DataLab