boundary_kernel {TVMVP} | R Documentation |
Boundary Kernel Function
Description
This function computes boundary kernel weights for a given time period t
within a dataset
of size T
. It adjusts the kernel weights near the boundaries to account for edge effects,
ensuring that the weights sum to one.
Usage
boundary_kernel(t, r, iT, h, kernel_func)
Arguments
t |
An integer specifying the current time period for which the kernel weights are computed. |
r |
An integer representing the reference time period. |
iT |
An integer indicating the total number of time periods in the dataset. |
h |
A numeric value representing the bandwidth parameter for the kernel function. |
kernel_func |
A function representing the kernel used for weighting. |
Details
The boundary kernel function adjusts kernel weights near the start and end of the dataset to mitigate edge effects commonly encountered in kernel-based methods. The function performs the following steps:
Scales the difference between the current time
t
and reference timer
by the product of total time periodsT
and bandwidthh
.Applies the kernel function to the scaled difference and adjusts by the bandwidth.
Determines if the current time period is within the lower or upper boundary regions based on
T_h = \lfloor T \times h \rfloor
.Computes the integral of the kernel function over the adjusted limits to ensure the weights sum to one in boundary regions.
Value
A numeric scalar representing the boundary-adjusted kernel weight for the given time period.