Skip to contents

Vectorised kernel functions on the support |u| <= 1 (Gaussian is on the real line). Used by RDD local-linear estimators and friends for kernel weighting around the cutoff.

Usage

morie_rdd_kernel_triangular(u)

morie_rdd_kernel_epanechnikov(u)

morie_rdd_kernel_uniform(u)

morie_rdd_kernel_gaussian(u)

Arguments

u

Numeric vector of standardised distances from the cutoff (i.e. \((x - c)/h\)).

Value

Numeric vector of kernel weights, same length as u.

A function of one argument returning Epanechnikov kernel weights.

A function of one argument returning uniform kernel weights.

A function of one argument returning Gaussian kernel weights.

Details

  • morie_rdd_kernel_triangular: \(K(u) = \max(1 - |u|, 0)\)

  • morie_rdd_kernel_epanechnikov: \(K(u) = (3/4)(1 - u^2)\) on |u| <= 1

  • morie_rdd_kernel_uniform: \(K(u) = 1/2\) on |u| <= 1

  • morie_rdd_kernel_gaussian: \(K(u) = \phi(u)\), the standard normal density

Examples

morie_rdd_kernel_epanechnikov(seq(-1, 1, by = 0.5))
#> [1] 0.0000 0.5625 0.7500 0.5625 0.0000
morie_rdd_kernel_uniform(seq(-2, 2, by = 1))
#> [1] 0.0 0.5 0.5 0.5 0.0
morie_rdd_kernel_gaussian(seq(-1, 1, by = 0.5))
#> [1] 0.2419707 0.3520653 0.3989423 0.3520653 0.2419707