View source: R/kernel_regression_estimator.R
truncated_est | R Documentation |
This function computes the truncated kernel regression estimator, based on the kernel regression estimator \hat{\rho}(\cdot)
, see adjusted_est.
truncated_est(
X,
x,
t,
T1,
T2,
b,
kernel_name = "gaussian",
kernel_params = c(),
pd = TRUE,
type = "autocovariance",
meanX = mean(X),
custom_kernel = FALSE
)
X |
A vector representing observed values of the time series. |
x |
A vector of lags. |
t |
The arguments at which the autocovariance function is calculated at. |
T1 |
The first truncation point, |
T2 |
The second truncation point, |
b |
Bandwidth parameter, greater than 0. |
kernel_name |
The name of the symmetric kernel (see kernel_symm) function to be used. Possible values are: gaussian, wave, rational_quadratic, and bessel_j. Alternatively, a custom kernel function can be provided, see the examples. |
kernel_params |
A vector of parameters of the kernel function. See kernel_symm for parameters. |
pd |
Whether a positive-definite estimate should be used. Defaults to |
type |
Compute either the 'autocovariance' or 'autocorrelation'. Defaults to 'autocovariance'. |
meanX |
The average value of |
custom_kernel |
If a custom kernel is to be used or not. Defaults to |
This function computes the truncated kernel regression estimator,
\hat{\rho}_{1}(t) = \left\{ \begin{array}{ll}
\hat{\rho}(t) & 0 \leq t \leq T_{1} \\
\hat{\rho}(T_{1}) (T_{2} - t)(T_{2} - T_{1})^{-1} & T_{1} < t \leq T_{2} \\
0 & t > T_{2}
\end{array} \right.
where \hat{\rho}(\cdot)
is the kernel regression estimator, see adjusted_est.
Compared to adjusted_est, this function brings down the estimate to zero linearly between T_{1}
and T_{2}
.
In the case of short-range dependence, this may be beneficial as it can remove estimation artefacts at large lags.
To make this estimator positive-definite, the following procedure is used:
Take the discrete Fourier cosine transform
\widehat{\mathcal{F}}(\theta)
.
Find the smallest frequency where its associated value in the spectral domain is negative
\hat{\theta} = \inf\{ \theta > 0 : \widehat{\mathcal{F}}(\theta)) < 0\}.
Set all values starting at the frequency to zero.
Perform the Fourier inversion.
If \hat{\theta}
is a small frequency, most of the spectrum equals zero, resulting in an inaccurate estimate of the autocovariance function, see Bilchouris and Olenko (2025).
A vector whose values are the truncated kernel regression estimates.
Hall, P. & Patil, P. (1994). Properties of nonparametric estimators of autocovariance for stationary random fields. Probability Theory and Related Fields 99(3), 399-424. https://doi.org/10.1007/bf01199899
Hall, P., Fisher, N. I., & Hoffmann, B. (1994). On the nonparametric estimation of covariance functions. The Annals of Statistics 22(4), 2115-2134. https://doi.org/10.1214/aos/1176325774
Bilchouris, A. & Olenko, A (2025). On Nonparametric Estimation of Covariogram. Austrian Statistical Society 54(1), 112–137. https://doi.org/10.17713/ajs.v54i1.1975
X <- c(1, 2, 3, 4)
truncated_est(X, 1:4, 1:3, 1, 2, 0.1,
"gaussian")
my_kernel <- function(x, theta, params) {
stopifnot(theta > 0, length(x) >= 1)
return(exp(-((abs(x) / theta)^params[1])) * (2 * theta * gamma(1 + 1/params[1])))
}
truncated_est(X, 1:4, 1:3, 1, 2, 0.1, my_kernel, c(0.25), custom_kernel = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.