X is univariate.
QuantifQuantile(X, Y, alpha = c(0.05, 0.25, 0.5, 0.75, 0.95), x = seq(min(X), max(X), length = 100), testN = c(35, 40, 45, 50, 55), p = 2, B = 50, tildeB = 20, same_N = TRUE, ncores = 1)x in q_alpha(x).N that will be tested.N.N for each alpha
(TRUE by default).QuantifQuantile which is a list with the
following components:x
and the number of rows the size of the order vector alpha. This object
can also be returned using the usual fitted.values function.N. An integer if
same_N=TRUE and a vector of integers of length length(alpha)
otherwise.N. The number of columns is then length(testN)
and the number of rows length(alpha).alpha, x and N.N that were
tested.testN of possible values
in which N will be selected. It actually minimizes some bootstrap
estimated version of the ISE (Integrated Squared Error). More precisely, for
N fixed, it calculates the sum according to alpha of
hatISE_N and then minimizes the resulting vector to get N_opt.
However, the user can choose to select a different value of N_opt for
each alpha by setting same_N=FALSE. In this case, the vector
N_opt is obtained by minimizing each column of hatISE_N
separately. The reason why same_N=TRUE by default is that taking
N_opt according to alpha could provide crossing conditional
quantile curves (rarely observed for not too close values of alpha).
The function plot.QuantifQuantile
illustrates the selection of N_opt. If the graph is not decreasing
then increasing, the argument testN should be adapted.
ncores. Parallel computation relies on
mclapply from parallel package, hence is not available
on Windows unless ncores=1 (default value).
Charlier, I. and Paindaveine, D. and Saracco, J., Conditional quantile estimator based on optimal quantization: from theory to practice, Submitted.
QuantifQuantile.d2 and QuantifQuantile.d
for multivariate versions.plot.QuantifQuantile,
print.QuantifQuantile, summary.QuantifQuantile
set.seed(644972)
n <- 300
X <- runif(300,-2,2)
Y <- X^2+rnorm(n)
res <- QuantifQuantile(X,Y,testN=seq(10,25,by=5))
## Not run:
# res2 <- QuantifQuantile(X,Y,testN=seq(10,30,by=5),same_N=FALSE)
#
# data(gironde)
# X <- gironde[[1]]$middleemp
# Y <- gironde[[2]]$density
# set.seed(642536)
# res <- QuantifQuantile(X,Y,testN=seq(5,25,by=5))
# ## End(Not run)
Run the code above in your browser using DataLab