cqs
estimates the directions of the central quantile subspace.
cqs(x, y, tau = 0.5, dtau = NULL)
A design matrix (n x p). The rows represent observations and the columns represent predictor variables.
A vector of the response variable.
A quantile level, a number strictly between 0 and 1.
An optional dimension of the central quantile subspace. If
specified, it should be an integer between 1 and p, the number of columns
of the design matrix x
. In the context of the algorithm, if
dtau
is known to be one, i.e., the assumed model is a single-index
model, then the algorithm stops after estimating the initial vector and
saves computational time. However, if dtau
is greater than one or
(more realistically) unknown, then the algorithm continues on creating more
vectors.
cqs
computes the directions of the central quantile subspace
and returns:
The estimated directions of the \(\tau\)th central quantile subspace.
The eigenvalues resulting from the eigenvalue decomposition
of the matrix with column vectors that span the central quantile subspace.
If dtau
is one, the qvalues
output is not produced.
Suggested dimension of the central quantile subspace. If
dtau
is specified by the user then the algorithm outputs the
user-defined value. If dtau
is not specified by the user then the
algorithm outputs a suggested dimension using the modified-BIC type
criterion of Zhu et al. (2010). Note that this is one suggested method to
estimate the structural dimension and is not necessarily a perfect one. The
user has the option to use the eigenvalues qvalues
on other
criteria, like cross-validation, and determine the estimated dimension of
the subspace.
The function computes the directions that span the \(\tau\)th central
quantile subspace, i.e., the directions that define linear combinations of
the predictor x
that contain all the information available on the
conditional quantile function.
The function starts by estimating the initial vector, which is defined as the
least-squares estimator from regressing the conditional quantile on the
predictor variable x
. Then, if the dimension of the central quantile
subspace is one, the algorithm stops and reports that vector as the basis of
the central quantile subspace. Otherwise, the algorithm continues by creating
more vectors and applying an eigenvalue decomposition to extract linearly
independent vectors.
Zhu, L.-P., Zhu, L.-X., Feng, Z.-H. (2010) Dimension reduction in regression through cumulative slicing estimation. Journal of the American Statistical Association, 105, 1455-1466.
# estimate the directions of a single-index model
set.seed(1234)
n <- 100
p <- 10
x <- matrix(rnorm(n * p), n, p)
error <- rnorm(n)
y <- 3 * x[, 1] + x[, 2] + error
tau <- 0.5
out <- cqs(x, y, tau, dtau = 1)
out
#> $qvectors
#> [,1]
#> [1,] 0.952948139
#> [2,] 0.287974471
#> [3,] 0.042667367
#> [4,] 0.038590479
#> [5,] -0.003885815
#> [6,] -0.042769158
#> [7,] 0.028417264
#> [8,] 0.018789922
#> [9,] 0.023914784
#> [10,] 0.045541197
#>
#> $dtau
#> [1] 1
#>
# without specifying dtau
out <- cqs(x, y, tau)
out
#> $qvectors
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 0.94285965 -0.04373861 0.323724575 0.10473035 0.06290808 -0.04667851
#> [2,] 0.30671396 0.29208998 -0.401758607 -0.16287563 0.15202916 -0.21945183
#> [3,] 0.03101309 -0.28351089 -0.199986929 -0.59193015 -0.45455105 -0.19721619
#> [4,] 0.03394904 -0.16427022 -0.478614025 0.35884778 -0.13384503 0.13125004
#> [5,] -0.00658252 -0.09730212 -0.205810821 -0.08802898 0.75194191 -0.04145494
#> [6,] -0.02433910 0.31968626 0.006386568 -0.65344860 0.37885008 -0.06677676
#> [7,] 0.02707587 0.03398101 0.354491863 -0.21839222 0.12549555 0.77574347
#> [8,] 0.01569753 -0.12261129 -0.358513162 0.23379874 0.04091144 0.40756218
#> [9,] 0.06317845 0.79095189 0.144685863 0.19507455 -0.18329861 -0.20917231
#> [10,] 0.07962450 0.54997345 -0.443034398 -0.38301190 -0.35618445 0.33809519
#> [,7] [,8] [,9] [,10]
#> [1,] -0.07376381 -0.16872174 0.008474194 0.14020956
#> [2,] 0.00725682 0.78950190 0.134953357 0.14996842
#> [3,] 0.06903646 -0.25806832 0.566790028 -0.28810369
#> [4,] -0.31360476 -0.09073977 -0.387039672 -0.57510228
#> [5,] -0.39371036 -0.29970274 0.123874984 -0.05495289
#> [6,] 0.47061321 -0.12265678 -0.366212884 -0.45406911
#> [7,] -0.07727430 0.30837138 0.410192154 -0.40082730
#> [8,] 0.74653472 -0.32831788 0.339507633 0.04297342
#> [9,] 0.22776133 -0.25554310 0.624061136 -0.30765592
#> [10,] -0.10565655 -0.04530856 -0.094568566 0.39571912
#>
#> $qvalues
#> [1] 9.943967e+01 9.879354e-02 3.285674e-03 4.633843e-04 1.760913e-04
#> [6] 3.195217e-05 1.161632e-05 4.207074e-06 1.322628e-06 1.268059e-10
#>
#> $dtau
#> [1] 1
#>
out$qvectors[, 1:out$dtau]
#> [1] 0.94285965 0.30671396 0.03101309 0.03394904 -0.00658252 -0.02433910
#> [7] 0.02707587 0.01569753 0.06317845 0.07962450