boundary_kernel: Boundary Kernel Function

View source: R/kernel_functions.R

boundary_kernelR 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:

  1. Scales the difference between the current time t and reference time r by the product of total time periods T and bandwidth h.

  2. Applies the kernel function to the scaled difference and adjusts by the bandwidth.

  3. Determines if the current time period is within the lower or upper boundary regions based on T_h = \lfloor T \times h \rfloor.

  4. 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.


TVMVP documentation built on June 28, 2025, 1:08 a.m.