Using a linear model produced by sisal, computes a
bootstrap estimate of MSE in test data.
bootMSE(object, dataset = NULL, R = 1000,
inputs = c("L.f", "L.v", "full"),
method = c("OLS", "magic"), standardize = "inherit",
stepsAhead = NULL, noiseSd = NULL, verbose = 1, …)an object of class "sisal",
containing the results of input selection and the corresponding
ordinary least squares and ridge regression models. Must be
compatible with dataset. See ‘Details’.
dataset to work on. A character string, a
numeric vector or a list with components
"X" and "y". When the default value NULL is
used, the function attempts to detect the dataset from attributes of
object. See ‘Details’.
the number of bootstrap replicates. Usually a single
positive integral number. See boot::boot.
a character string. Which set of input
variables to use. Choices are "L.f" (smallest set with error
under threshold), "L.v" (minimum validation error) and
"full" (full model). See sisal.
a character string. "OLS" for ordinary
least squares regression or "magic" for a ridge regression
model with an automatically selected regularization parameter. See
sisal.
"inherit" or a logical flag. If
TRUE, standardizes the data to zero mean and unit variance.
If FALSE, uses original data. If "inherit" (the
default), the value of this argument is copied from
object. This affects the scale of the results.
If doing time series prediction, this indicates how
many steps ahead to predict. A non-negative integral value or
NULL. If NULL (the default), the value is copied from
an attribute of object, put there by
testSisal.
standard deviation of the noise to be added to the
dependent variable when dataset is "toy". The
noise is a saved dataset. Thus it is always identical, only scaled
by noiseSd. If NULL (the default), the value is
copied from object.
verbosity level. A single numeric value. If
0, output is disabled. If greater than 0, shows some
information about what the function is doing. Currently there is
only one non-zero verbosity level (the default).
arguments passed to boot::boot.
An object of class "boot", as returned by
boot::boot.
Four types of values are supported in dataset.
Use one of "laser", "poland", "toy" and
"tsToy" to work on the test part of a dataset included in or
specifically supported by the package. The first two options will
load their respective datasets over a network connection. See
sisalData, toy.test and
tsToy.test.
Use a numeric vector to work with time series
data. The use of the "laser" and "poland" datasets is
recognized. Loading the datasets in advance reduces unnecessary
network traffic when doing multiple repeats with the same dataset.
Use a list with a numeric matrix
"X" and a numeric vector "y" to supply
inputs "X" and output "y". This is appropriate when
using your own data for something else than time series prediction
based on past values of the same time series.
Use NULL (the default value) for automatic detection of
the dataset. This works if object was created with
testSisal.
When using time series data, the names of the inputs used in
object must match the regular expression
"lag\.\d+", i.e. "lag" followed by a dot and an
integer without spaces or any other formatting. This is automatically
taken care of by laggedData and testSisal.
When using other than time series data, the user-supplied
dataset must contain all the input variables used in the
selected linear model (i.e. full model or a subset of inputs) of
object.
# NOT RUN {
foo <- testSisal(dataset="toy", Mtimes=10)
bootMSE(foo)
# }
Run the code above in your browser using DataLab