Learn R Programming

HQM (version 0.1.1)

Kernels: Classical (unmodified) kernel and related functionals

Description

Implements the classical kernel function and related functionals

Usage

K_b(b,x,y, K)
xK_b(b,x,y, K)
K_b_mat(b,x,y, K)

Value

Scalar values for K_b and xK_b and matrix outputs for K_b_mat.

Arguments

x

A vector of design points where the kernel will be evaluated.

y

A vector of sample data points.

b

The bandwidth to use (a scalar).

K

The kernel function to use.

Details

The function K_b implements the classical kernel function calculation $$ h^{-1} K \left ( \frac{x-y}{h} \right )$$ for scalars \(x\) and \(y\) while xK_b implements the functional $$ h^{-1} K \left ( \frac{x-y}{h} \right )(x-y)$$ again for for scalars \(x\) and \(y\). The function K_b_mat is the vectorized version of K_b. It uses as inputs the vectors \((X_1, \dots, X_n)\) and \((Y_1, \dots, Y_n)\) and returns a \(n \times n\) matrix with entries $$ h^{-1} K \left ( \frac{X_i-Y_j}{h} \right )$$