Skip to contents

The design applies the kernel to the rank of a pre-shock wave rather than to its calendar distance, because survey waves are unequally spaced. The r-th most recent of H waves is evaluated at x = (r - 1)/H (offset by 0.001 so that the most recent wave is strictly inside the support), so the most recent wave receives the largest weight and no wave receives zero.

Usage

cdd_kernel(kernel = c("triangular", "rectangular", "epanechnikov", "gaussian"))

Arguments

kernel

One of "triangular", "rectangular", "epanechnikov", "gaussian" (a Gaussian density truncated at 1). Legacy aliases "triangle" and "uniform" are accepted.

Value

A function of x returning kernel values on |x| <= 1.

Examples

cdd_kernel("triangular")(c(0, 0.5, 1))
#> [1] 1.0 0.5 0.0