epanechnikov_kernel: Epanechnikov Kernel Function

View source: R/kernel_functions.R

epanechnikov_kernelR Documentation

Epanechnikov Kernel Function

Description

This function computes the value of the Epanechnikov kernel for a given input u. The Epanechnikov kernel is a popular choice in kernel density estimation due to its optimal properties in minimizing mean integrated squared error.

Usage

epanechnikov_kernel(u)

Arguments

u

A numeric vector of points at which the kernel is evaluated.

Details

The Epanechnikov kernel is defined as:

K(u) = \begin{cases} \frac{3}{4}(1 - u^2) & \text{if } |u| \leq 1, \\ 0 & \text{otherwise}. \end{cases}

This function applies the above formula to each element of the input vector u.

Value

A numeric vector of kernel values corresponding to each input u.

Examples

# Define a range of u values
u_values <- seq(-1.5, 1.5, by = 0.1)

# Compute Epanechnikov kernel values
kernel_values <- epanechnikov_kernel(u_values)


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