cv.wtf1 | R Documentation |
Use a fixed set of knots and a random partition of the data to cross-validate
the risk estimate for a provided list of tau values. If nfolds = length(x)
leave-one-out cross-validation is used. If fit.best = TRUE
(default) then
a final model is fit using all of the data and best value of tau. A seed is
available to set for reproducible partitions.
cv.wtf1(x, s, tau.options, nfolds = 5, seed = NULL, fit.best = TRUE, ...)
x |
Gaussian sequence |
s |
standard deviation |
tau.options |
a vector of candidate values for TV(d') |
nfolds |
number of cross-validation folds |
seed |
random seed used for reproducible folds |
fit.best |
boolean (default TRUE) whether to fit all of |
... |
additional parameters passed to wtf1() such as backend and knots |
theta_hat |
estimated values of means of Gaussian sequence |
x |
original Gaussian sequence |
s |
known standard deviation |
SURE |
value of minimum risk estimate |
tau |
the user specified bound on TV(d') |
TV1 |
the value of TV(d') for minimizer |
intercept |
intercept of fitted estimator |
slopes |
slopes of fitted estimator |
knots |
location of knots |
backend |
which version of wtf1 was used |
solver |
solver used by CVXR |
... |
additional inputed parameters |
cv.risks |
data.frame containing cross-validation parameters and risks |
nfold |
number of folds for cross-validation |
seed |
seed for reproducible fold partitions |
# basic usage set.seed(1) theta = rnorm(250) x = theta + rnorm(250) res = cv.wtf1(x, s = 1, tau.options = 1:2, knots = -2:2) mean((theta - res$theta_hat)^2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.