Calculates the cross-validated risk for the optimal bandwidth selection in kernel smoothing approach.
compute_risk(h, matched_Y, matched_w, matched_cw, x_eval, w_vals, kernel_appr)returns a cross-validated risk value for the input bandwidth
A scalar representing the bandwidth value.
A vector of outcome variable in the matched set.
A vector of continuous exposure variable in the matched set.
A vector of counter or weight variable in the matched set.
A vector of values that you want to calculate the values of the ERF at.
Internal kernel approach. Available options are locpol
and kernsmooth.