Learn R Programming

blackbox (version 1.0)

calcGCV: Estimate smoothing parameters by generalized cross-validation (GCV)

Description

Smoothing is based on prediction in a linear mixed model (Kriging) with non-zero residual variance. The correlation function for the random effect is the Matern function with argument the Euclidian distance between scaled coordinates (x/scale). The Matern function also has a smoothness parameter. These parameters are by default estimated by GCV. For large data sets (say >2000 rows), it is strongly recommended to select a subset of the data using GCVptnbr, as GCV will otherwise be very slow.

Usage

calcGCV(sorted_data=data, data, CovFnParam = NULL, GCVptnbr = Inf,
       topmode = FALSE, verbose = FALSE, cleanResu = "",
       force=FALSE, decreasing=FALSE,
       verbosity = blackbox.getOption("verbosity"),
       optimizers = blackbox.getOption("optimizers"))

Arguments

sorted_data
A data frame with both predictor and response variance, sorted and with attributes, as produced by prepareData
data
Obsolete, for Migraine back-compatibility, should not be used.
CovFnParam
Optional fixed values of scale factors for each predictor variable. Smoothness should not be included in this argument.
GCVptnbr
Maximum number of rows selected for GCV.
topmode
Controls the way rows are selected. For development purposes, should not be modified
verbose
Whether to print some messages or not. Distinct from verbosity
verbosity
Distinct from verbose. See verbosity in blackbox.options
cleanResu
A connection, or a character string naming a file for some nicely formated output. If "" (the default), print to the standard output connection.
force
Boolean. Forces the analysis of data without pairs of response values for given parameter values.
optimizers
A vector of) character strings, from which the optimization method is selected. Default is nloptr with its own "NLOPT_LN_BOBYQA" method. See the source of the function for other methods (the latter being subject to change with li
decreasing
Boolean. Use TRUE if you want the result to be used in function maximization rather than minimization.

Value

  • A list with the following elements
  • CovFnParamScale parameters and smoothness parameter of the Matern correlation function
  • lambdaEstRatio of residual variance over random effect variance
  • pureRMSEEstimate of root residual variance
  • and possibly other elements. Global options CovFnParam is modified as a side effect.

References

Golub, G. H., Heath, M. and Wahba, G. (1979) Generalized Cross-Validation as a method for choosing a good ridge parameter. Technometrics 21: 215-223.

Examples

Run this code
# see example on main doc page (?blackbox)

Run the code above in your browser using DataLab