Skip to contents

Wave weights from a kernel applied to wave rank

Usage

wave_weights(waves, kernel = "triangular")

Arguments

waves

Numeric vector of the pre-shock waves to be used (any order).

kernel

Kernel name, see cdd_kernel().

Value

Named numeric vector of kernel weights, names are the waves, most recent wave first. Weights are unnormalized; cdd() rescales them so the survey-weight total of the comparison sample is preserved.

Examples

wave_weights(c(1998, 2000, 2002, 2004, 2006), "triangular")
#>  2006  2004  2002  2000  1998 
#> 0.999 0.799 0.599 0.399 0.199