# Test the robustess of the cross-validation procedure

### Description

This function calculates the estimated K-fold cross-validation for different
values of `K`

.

### Usage

1 | ```
testCrossValidation(model,Kfold=c(2,5,10,20,30,40,dim(model$data$X)[1]),N=10)
``` |

### Arguments

`model` |
a fitted model from |

`Kfold` |
a vector containing the values to test (default corresponds to 2,5,10,20,30,40 and the number of observations for leave-one-out procedure) |

`N` |
an integer given the number of times the K-fold cross-validation is performed for each value of K |

### Value

a matrix of all the values obtained by K-fold cross-validation

### Note

For each value of K, the cross-validation procedure is repeated `N`

times in
order to get an idea of the dispersion of the `Q2`

criterion and of the `RMSE`

by K-fold cross-validation.

### Author(s)

D. Dupuy

### See Also

`crossValidation`

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
## Not run:
rm(list=ls())
# A 2D example
Branin <- function(x1,x2) {
x1 <- x1*15-5
x2 <- x2*15
(x2 - 5/(4*pi^2)*(x1^2) + 5/pi*x1 - 6)^2 + 10*(1 - 1/(8*pi))*cos(x1) + 10
}
# a 2D uniform design and the value of the response at these points
n <- 50
X <- matrix(runif(n*2),ncol=2,nrow=n)
Y <- Branin(X[,1],X[,2])
mod <- modelFit(X,Y,type="Linear",formula=formulaLm(X,Y))
out <- testCrossValidation(mod,N=20)
## End(Not run)
``` |