optimal.knots | R Documentation |
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.
optimal.knots(x, bw)
x |
Gaussian sequence |
bw |
scalar bandwidth for Gaussian kernel density estimate |
vector of optimal knots given x and bw (one element shorter than x
)
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.