calcGCV {blackbox} | R Documentation |

## 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 |

`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` |
Distinct from |

`cleanResu` |
A connection, or a character string naming a file for some nicely formated output. If |

`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 |

`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

`CovFnParam` |
Scale parameters |

`lambdaEst` |
Ratio of residual variance over random effect variance |

`pureRMSE` |
Estimate 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

```
# see example on main doc page (?blackbox)
```

*blackbox*version 1.1.46 Index]