rddapp (version 1.1.0)

wt_kern: Kernel Weight Calculation

Description

wt_kern calculates the appropriate kernel weights for a vector. This is useful when, for instance, one wishes to perform local regression. It is based on the kernelwts function in the rdd package. This is an internal function and is typically not directly invoked by the user. It can be accessed using the triple colon, as in rddapp:::wt_kern().

Usage

wt_kern(X, center, bw, kernel = "triangular")

Arguments

X

The input x values. This variable represents the axis along which kernel weighting should be performed.

center

The point from which distances should be calculated.

bw

The bandwidth.

kernel

A string indicating the kernel to use. Options are "triangular" (the default), "epanechnikov", "quartic", "triweight", "tricube", "gaussian", and "cosine".

Value

A vector of weights with length equal to that of the X input (one weight per element of X).