if (FALSE) {
data("nuclear")
x.nucl <- seq(min(nuclear$xtab), max(nuclear$xtab),
length.out = 101)
# 1. Unconstrained case
# Optimal bandwidths over 100 bootstrap replications
system.time(
h.nucl.u <- loc_est_bw(nuclear$xtab, nuclear$ytab,
x.nucl, hini = 40, B = 1, method = "u")
)
# result is 79.11877
# 2. Monotonicity constraint
# Optimal bandwidths over 100 bootstrap replications
h.nucl.m <- loc_est_bw(nuclear$xtab, nuclear$ytab,
x.nucl, hini = 40, B = 100, method = "m")
# result is 79.12
}
Run the code above in your browser using DataLab