bandwidth.CV: Choice of the bandwidth by cross validation.

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Choose a bandwidth by minimizing the cross validation function.

Usage

1
2
3
bandwidth.CV(X, t, Tgrid, hgrid, pcv = 0.99,
  kernel = TruncGauss.kernel, kpar = NULL, CritVal = 3.6,
  plot = FALSE)

Arguments

X

a vector of the observed values.

t

a vector of time covariates which should have the same length as X.

Tgrid

a sequence of times used to perform the cross validation (can be any sequence in the interval [min(t) , max(t)] ).

hgrid

a sequence of values from which the bandwidth is selected.

pcv

a probability value which determines the level of quantiles used to perform the cross validation, with default 0.99.

kernel

a kernel function used to compute the weights in the time domain, with default the truncated gaussian kernel.

kpar

a value for the kernel function parameter, with no default value.

CritVal

a critical value associated to the kernel function computed from the function CriticalValue, with default 3.6 corresponding to the truncated Gaussian kernel.

plot

If TRUE, the cross validation function is plotted.

Details

The sequence hgrid must be geometric. (see bandwidth.grid to generate a geometric grid of bandwidths).

The value pcv should be scalar (vector values are not admitted).

Value

hgrid

the sequence of bandwidth given in input.

CV

the values of the cross validation function for hgrid.

h.cv

the bandwidth that minimizes the cross-validation function.

Author(s)

Durrieu, G., Grama, I., Jaunatre, K., Pham, Q. and Tricot, J.- M

References

Durrieu, G. and Grama, I. and Pham, Q. and Tricot, J.- M (2015). Nonparametric adaptive estimator of extreme conditional tail probabilities quantiles. Extremes, 18, 437-478.

See Also

bandwidth.grid , CriticalValue

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#Generate the data
theta <- function(t){
   0.5+0.25*sin(2*pi*t)
 }
n <- 5000
t <- 1:n/n
Theta <- theta(t)
Data <- NULL
for(i in 1:n){
   Data[i] <- rparetomix(1, a = 1/Theta[i], b = 1/Theta[i]+5, c = 0.75)
 }

#compute the cross validation bandwidth
Tgrid <- seq(0, 1, 0.02) #define a grid to perform the cross validation
hgrid <- bandwidth.grid(0.1, 0.3, 20) #define a grid of bandwidths
## Not run:  #For computation time purpose
  Hcv <- bandwidth.CV(Data, t, Tgrid, hgrid, pcv = 0.99, plot = TRUE)
  #The computing time can be long
  Hcv

## End(Not run)

extremefit documentation built on May 6, 2019, 1:10 a.m.