optimal.knots: Optimal Knots for wtf0

View source: R/wtf0.R

optimal.knotsR Documentation

Optimal Knots for wtf0

Description

Compute the optimal knot placement for wtf0() by minimize f_h(t) between each consecutive pair of observations. These knots are optimal for the risk estimate, but may not produce a better minimizer of the true risk.

Usage

optimal.knots(x, bw)

Arguments

x

Gaussian sequence

bw

scalar bandwidth for Gaussian kernel density estimate

Value

vector of optimal knots given x and bw (one element shorter than x)

Examples

set.seed(1)
theta = rnorm(250)
x = theta + rnorm(250)
bw = 0.25

# optimal knots
wtf0(x, 1, bw = bw, knots = optimal.knots(x, bw))$risk.est

# approximate knots
wtf0(x, 1, bw = bw)$risk.est

sdzhao/cole documentation built on May 2, 2022, 9:42 a.m.