NAG Library Function Document

nag_regsn_quant_linear (g02qgc)

Note: this function uses optional parameters to define choices in the problem specification and in the details of the algorithm. If you wish to use default settings for all of the optional parameters, you need only read Sections 1 to 10 of this document. If, however, you wish to reset some or all of the settings please refer to Section 11 for a detailed description of the algorithm, to Section 12 for a detailed description of the specification of the optional parameters and to Section 13 for a detailed description of the monitoring information produced by the function.

1Purpose

nag_regsn_quant_linear (g02qgc) performs a multiple linear quantile regression. Parameter estimates and, if required, confidence limits, covariance matrices and residuals are calculated. nag_regsn_quant_linear (g02qgc) may be used to perform a weighted quantile regression. A simplified interface for nag_regsn_quant_linear (g02qgc) is provided by nag_regsn_quant_linear_iid (g02qfc).

2Specification

 #include #include
 void nag_regsn_quant_linear (Nag_OrderType order, Nag_IncludeIntercept intcpt, Integer n, Integer m, const double dat[], Integer pddat, const Integer isx[], Integer ip, const double y[], const double wt[], Integer ntau, const double tau[], double *df, double b[], double bl[], double bu[], double ch[], double res[], const Integer iopts[], const double opts[], Integer state[], Integer info[], NagError *fail)

3Description

Given a vector of $n$ observed values, $y=\left\{{y}_{i}:i=1,2,\dots ,n\right\}$, an $n×p$ design matrix $X$, a column vector, $x$, of length $p$ holding the $i$th row of $X$ and a quantile $\tau \in \left(0,1\right)$, nag_regsn_quant_linear (g02qgc) estimates the $p$-element vector $\beta$ as the solution to
 $minimize β ∈ ℝ p ∑ i=1 n ρ τ y i - xiT β$ (1)
where ${\rho }_{\tau }$ is the piecewise linear loss function ${\rho }_{\tau }\left(z\right)=z\left(\tau -I\left(z<0\right)\right)$, and $I\left(z<0\right)$ is an indicator function taking the value $1$ if $z<0$ and $0$ otherwise. Weights can be incorporated by replacing $X$ and $y$ with $WX$ and $Wy$ respectively, where $W$ is an $n×n$ diagonal matrix. Observations with zero weights can either be included or excluded from the analysis; this is in contrast to least squares regression where such observations do not contribute to the objective function and are therefore always dropped.
nag_regsn_quant_linear (g02qgc) uses the interior point algorithm of Portnoy and Koenker (1997), described briefly in Section 11, to obtain the parameter estimates $\stackrel{^}{\beta }$, for a given value of $\tau$.
Under the assumption of Normally distributed errors, Koenker (2005) shows that the limiting covariance matrix of $\stackrel{^}{\beta }-\beta$ has the form
 $Σ = τ 1 - τ n H n -1 J n H n -1$
where ${J}_{n}={n}^{-1}\sum _{\mathit{i}=1}^{n}{x}_{i}{x}_{i}^{\mathrm{T}}$ and ${H}_{n}$ is a function of $\tau$, as described below. Given an estimate of the covariance matrix, $\stackrel{^}{\Sigma }$, lower (${\stackrel{^}{\beta }}_{L}$) and upper (${\stackrel{^}{\beta }}_{U}$) limits for an $\left(100×\alpha \right)%$ confidence interval can be calculated for each of the $p$ parameters, via
 $β^ Li = β^ i - t n-p , 1 + α / 2 Σ^ ii , β^ Ui = β^ i + t n-p , 1 + α / 2 Σ^ ii$
where ${t}_{n-p,0.975}$ is the $97.5$ percentile of the Student's $t$ distribution with $n-k$ degrees of freedom, where $k$ is the rank of the cross-product matrix ${X}^{\mathrm{T}}X$.
Four methods for estimating the covariance matrix, $\Sigma$, are available:
(i) Independent, identically distributed (IID) errors
Under an assumption of IID errors the asymptotic relationship for $\Sigma$ simplifies to
 $Σ = τ 1 - τ n s τ 2 XT X -1$
where $s$ is the sparsity function. nag_regsn_quant_linear (g02qgc) estimates $s\left(\tau \right)$ from the residuals, ${r}_{i}={y}_{i}-{x}_{i}^{\mathrm{T}}\stackrel{^}{\beta }$ and a bandwidth ${h}_{n}$.
(ii) Powell Sandwich
Powell (1991) suggested estimating the matrix ${H}_{n}$ by a kernel estimator of the form
 $H^ n = n cn -1 ∑ i=1 n K r i c n ⁢ xi xiT$
where $K$ is a kernel function and ${c}_{n}$ satisfies $\underset{n\to \infty }{\mathrm{lim}}\phantom{\rule{0.25em}{0ex}}{c}_{n}\to 0$ and $\underset{n\to \infty }{\mathrm{lim}}\phantom{\rule{0.25em}{0ex}}\sqrt{n}{c}_{n}\to \infty$. When the Powell method is chosen, nag_regsn_quant_linear (g02qgc) uses a Gaussian kernel (i.e., $K=\varphi$) and sets
 $cn = minσr, qr3 - qr1 / 1.34 × Φ-1 τ + hn - Φ-1 τ - hn$
where ${h}_{n}$ is a bandwidth, ${\sigma }_{r},{q}_{r1}$ and ${q}_{r3}$ are, respectively, the standard deviation and the $25%$ and $75%$ quantiles for the residuals, ${r}_{i}$.
(iii) Hendricks–Koenker Sandwich
Koenker (2005) suggested estimating the matrix ${H}_{n}$ using
 $H^ n = n-1 ∑ i=1 n 2 ⁢ hn xiT β^ τ + hn - β^ τ - hn ⁢ xi xiT$
where ${h}_{n}$ is a bandwidth and $\stackrel{^}{\beta }\left(\tau +{h}_{n}\right)$ denotes the parameter estimates obtained from a quantile regression using the $\left(\tau +{h}_{n}\right)$th quantile. Similarly with $\stackrel{^}{\beta }\left(\tau -{h}_{n}\right)$.
(iv) Bootstrap
The last method uses bootstrapping to either estimate a covariance matrix or obtain confidence intervals for the parameter estimates directly. This method therefore does not assume Normally distributed errors. Samples of size $n$ are taken from the paired data $\left\{{y}_{i},{x}_{i}\right\}$ (i.e., the independent and dependent variables are sampled together). A quantile regression is then fitted to each sample resulting in a series of bootstrap estimates for the model parameters, $\beta$. A covariance matrix can then be calculated directly from this series of values. Alternatively, confidence limits, ${\stackrel{^}{\beta }}_{L}$ and ${\stackrel{^}{\beta }}_{U}$, can be obtained directly from the $\left(1-\alpha \right)/2$ and $\left(1+\alpha \right)/2$ sample quantiles of the bootstrap estimates.
Further details of the algorithms used to calculate the covariance matrices can be found in Section 11.
All three asymptotic estimates of the covariance matrix require a bandwidth, ${h}_{n}$. Two alternative methods for determining this are provided:
(i) Sheather–Hall
 $hn = 1.5 ⁢ Φ-1αb ϕ Φ-1τ 2 n ⁢ 2⁢ Φ-1τ + 1 13$
for a user-supplied value ${\alpha }_{b}$,
(ii) Bofinger
 $hn = 4.5 ⁢ ϕ Φ-1τ 4 n ⁢ 2⁢ Φ-1τ + 1 2 15$
nag_regsn_quant_linear (g02qgc) allows optional arguments to be supplied via the iopts and opts arrays (see Section 12 for details of the available options). If the default values for these optional arguments are sufficient then iopts and opts can be set to NULL, otherwise prior to calling nag_regsn_quant_linear (g02qgc) the optional parameter arrays, must be initialized by calling nag_g02_opt_set (g02zkc) with optstr set to ${\mathbf{Initialize}}={\mathbf{g02qgc}}$. If bootstrap confidence limits are required (${\mathbf{Interval Method}}=\mathrm{BOOTSTRAP XY}$) then one of the random number initialization functions nag_rand_init_repeatable (g05kfc) (for a repeatable analysis) or nag_rand_init_nonrepeatable (g05kgc) (for an unrepeatable analysis) must also have been previously called.
Koenker R (2005) Quantile Regression Econometric Society Monographs, Cambridge University Press, New York
Mehrotra S (1992) On the implementation of a primal-dual interior point method SIAM J. Optim. 2 575–601
Nocedal J and Wright S J (2006) Numerical Optimization (2nd Edition) Springer Series in Operations Research, Springer, New York
Portnoy S and Koenker R (1997) The Gaussian hare and the Laplacian tortoise: computability of squared-error versus absolute error estimators Statistical Science 4 279–300
Powell J L (1991) Estimation of monotonic regression models under quantile restrictions Nonparametric and Semiparametric Methods in Econometrics Cambridge University Press, Cambridge

5Arguments

1:    $\mathbf{order}$Nag_OrderTypeInput
On entry: the order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by ${\mathbf{order}}=\mathrm{Nag_RowMajor}$. See Section 3.3.1.3 in How to Use the NAG Library and its Documentation for a more detailed explanation of the use of this argument.
Constraint: ${\mathbf{order}}=\mathrm{Nag_RowMajor}$ or $\mathrm{Nag_ColMajor}$.
2:    $\mathbf{intcpt}$Nag_IncludeInterceptInput
On entry: indicates whether an intercept will be included in the model. The intercept is included by adding a column of ones as the first column in the design matrix, $X$.
${\mathbf{intcpt}}=\mathrm{Nag_Intercept}$
An intercept will be included in the model.
${\mathbf{intcpt}}=\mathrm{Nag_NoIntercept}$
An intercept will not be included in the model.
Constraint: ${\mathbf{intcpt}}=\mathrm{Nag_NoIntercept}$ or $\mathrm{Nag_Intercept}$.
3:    $\mathbf{n}$IntegerInput
On entry: the total number of observations in the dataset. If no weights are supplied, or no zero weights are supplied or observations with zero weights are included in the model then ${\mathbf{n}}=n$. Otherwise ${\mathbf{n}}=n+$ the number of observations with zero weights.
Constraint: ${\mathbf{n}}\ge 2$.
4:    $\mathbf{m}$IntegerInput
On entry: $m$, the total number of variates in the dataset.
Constraint: ${\mathbf{m}}\ge 0$.
5:    $\mathbf{dat}\left[\mathit{dim}\right]$const doubleInput
Note: the dimension, dim, of the array dat must be at least
• ${\mathbf{pddat}}×{\mathbf{m}}$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• ${\mathbf{pddat}}×{\mathbf{n}}$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
Where ${\mathbf{DAT}}\left(i,j\right)$ appears in this document, it refers to the array element
• ${\mathbf{dat}}\left[\left(j-1\right)×{\mathbf{pddat}}+i-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_ColMajor}$;
• ${\mathbf{dat}}\left[\left(i-1\right)×{\mathbf{pddat}}+j-1\right]$ when ${\mathbf{order}}=\mathrm{Nag_RowMajor}$.
On entry: the $\mathit{i}$th value for the $\mathit{j}$th variate, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$ and $\mathit{j}=1,2,\dots ,{\mathbf{m}}$, must be supplied in ${\mathbf{DAT}}\left(i,j\right)$
The design matrix $X$ is constructed from dat, isx and intcpt.
6:    $\mathbf{pddat}$IntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array dat.
Constraints:
• if ${\mathbf{order}}=\mathrm{Nag_ColMajor}$, ${\mathbf{pddat}}\ge {\mathbf{n}}$;
• otherwise ${\mathbf{pddat}}\ge {\mathbf{m}}$.
7:    $\mathbf{isx}\left[{\mathbf{m}}\right]$const IntegerInput
On entry: indicates which independent variables are to be included in the model.
${\mathbf{isx}}\left[j-1\right]=0$
The $j$th variate, supplied in dat, is not included in the regression model.
${\mathbf{isx}}\left[j-1\right]=1$
The $j$th variate, supplied in dat, is included in the regression model.
Constraints:
• ${\mathbf{isx}}\left[\mathit{j}-1\right]=0$ or $1$, for $\mathit{j}=1,2,\dots ,{\mathbf{m}}$;
• if ${\mathbf{intcpt}}=\mathrm{Nag_Intercept}$, exactly ${\mathbf{ip}}-1$ values of isx must be set to $1$;
• if ${\mathbf{intcpt}}=\mathrm{Nag_NoIntercept}$, exactly ip values of isx must be set to $1$.
8:    $\mathbf{ip}$IntegerInput
On entry: $p$, the number of independent variables in the model, including the intercept, see intcpt, if present.
Constraints:
• $1\le {\mathbf{ip}}<{\mathbf{n}}$;
• if ${\mathbf{intcpt}}=\mathrm{Nag_Intercept}$, $1\le {\mathbf{ip}}\le {\mathbf{m}}+1$;
• if ${\mathbf{intcpt}}=\mathrm{Nag_NoIntercept}$, $1\le {\mathbf{ip}}\le {\mathbf{m}}$.
9:    $\mathbf{y}\left[{\mathbf{n}}\right]$const doubleInput
On entry: $y$, the observations on the dependent variable.
10:  $\mathbf{wt}\left[{\mathbf{n}}\right]$const doubleInput
On entry: optionally, the diagonal elements of the weight matrix $W$.
If weights are not provided then wt must be set to NULL.
When
${\mathbf{Drop Zero Weights}}=\mathrm{YES}$
If ${\mathbf{wt}}\left[i-1\right]=0.0$, the $i$th observation is not included in the model, in which case the effective number of observations, $n$, is the number of observations with nonzero weights. If ${\mathbf{Return Residuals}}=\mathrm{YES}$, the values of res will be set to zero for observations with zero weights.
${\mathbf{Drop Zero Weights}}=\mathrm{NO}$
All observations are included in the model and the effective number of observations is n, i.e., $n={\mathbf{n}}$.
Constraints:
• the effective number of observations $\text{}\ge 2$;
• ${\mathbf{wt}}\left[i\right]=0.0$, for all $i$.
11:  $\mathbf{ntau}$IntegerInput
On entry: the number of quantiles of interest.
Constraint: ${\mathbf{ntau}}\ge 1$.
12:  $\mathbf{tau}\left[{\mathbf{ntau}}\right]$const doubleInput
On entry: the vector of quantiles of interest. A separate model is fitted to each quantile.
Constraint: $\sqrt{\epsilon }<{\mathbf{tau}}\left[\mathit{j}-1\right]<1-\sqrt{\epsilon }$ where $\epsilon$ is the machine precision returned by nag_machine_precision (X02AJC), for $\mathit{j}=1,2,\dots ,{\mathbf{ntau}}$.
13:  $\mathbf{df}$double *Output
On exit: the degrees of freedom given by $n-k$, where $n$ is the effective number of observations and $k$ is the rank of the cross-product matrix ${X}^{\mathrm{T}}X$.
14:  $\mathbf{b}\left[{\mathbf{ip}}×{\mathbf{ntau}}\right]$doubleInput/Output
Note: where ${\mathbf{B}}\left(i,l\right)$ appears in this document, it refers to the array element ${\mathbf{b}}\left[\left(l-1\right)×{\mathbf{ip}}+i-1\right]$.
On entry: if ${\mathbf{Calculate Initial Values}}=\mathrm{NO}$, ${\mathbf{B}}\left(\mathit{i},\mathit{l}\right)$ must hold an initial estimates for ${\stackrel{^}{\beta }}_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,{\mathbf{ip}}$ and $\mathit{l}=1,2,\dots ,{\mathbf{ntau}}$. If ${\mathbf{Calculate Initial Values}}=\mathrm{YES}$, b need not be set.
On exit: ${\mathbf{B}}\left(\mathit{i},\mathit{l}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{ip}}$, contains the estimates of the parameters of the regression model, $\stackrel{^}{\beta }$, estimated for $\tau ={\mathbf{tau}}\left[\mathit{l}-1\right]$.
If ${\mathbf{intcpt}}=\mathrm{Nag_Intercept}$, ${\mathbf{B}}\left(1,l\right)$ will contain the estimate corresponding to the intercept and ${\mathbf{B}}\left(i+1,l\right)$ will contain the coefficient of the $j$th variate contained in dat, where ${\mathbf{isx}}\left[j-1\right]$ is the $i$th nonzero value in the array isx.
If ${\mathbf{intcpt}}=\mathrm{Nag_NoIntercept}$, ${\mathbf{B}}\left(i,l\right)$ will contain the coefficient of the $j$th variate contained in dat, where ${\mathbf{isx}}\left[j-1\right]$ is the $i$th nonzero value in the array isx.
15:  $\mathbf{bl}\left[\mathit{dim}\right]$doubleOutput
Note: the dimension, dim, of the array bl must be at least ${\mathbf{ntau}}$ when ${\mathbf{Interval Method}}\ne \mathrm{NONE}$.
Where ${\mathbf{BL}}\left(i,l\right)$ appears in this document, it refers to the array element ${\mathbf{bl}}\left[\left(l-1\right)×{\mathbf{ip}}+i-1\right]$.
On exit: if ${\mathbf{Interval Method}}\ne \mathrm{NONE}$, ${\mathbf{BL}}\left(i,l\right)$ contains the lower limit of an $\left(100×\alpha \right)%$ confidence interval for ${\mathbf{B}}\left(\mathit{i},\mathit{l}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{ip}}$ and $\mathit{l}=1,2,\dots ,{\mathbf{ntau}}$.
If ${\mathbf{Interval Method}}=\mathrm{NONE}$, bl is not referenced and can be set to NULL.
The method used for calculating the interval is controlled by the optional parameters ${\mathbf{Interval Method}}$ and ${\mathbf{Bootstrap Interval Method}}$. The size of the interval, $\alpha$, is controlled by the optional parameter ${\mathbf{Significance Level}}$.
16:  $\mathbf{bu}\left[\mathit{dim}\right]$doubleOutput
Note: the dimension, dim, of the array bu must be at least ${\mathbf{ntau}}$ when ${\mathbf{Interval Method}}\ne \mathrm{NONE}$.
Where ${\mathbf{BU}}\left(i,l\right)$ appears in this document, it refers to the array element ${\mathbf{bu}}\left[\left(l-1\right)×{\mathbf{ip}}+i-1\right]$.
On exit: if ${\mathbf{Interval Method}}\ne \mathrm{NONE}$, ${\mathbf{BU}}\left(i,l\right)$ contains the upper limit of an $\left(100×\alpha \right)%$ confidence interval for ${\mathbf{B}}\left(\mathit{i},\mathit{l}\right)$, for $\mathit{i}=1,2,\dots ,{\mathbf{ip}}$ and $\mathit{l}=1,2,\dots ,{\mathbf{ntau}}$.
If ${\mathbf{Interval Method}}=\mathrm{NONE}$, bu is not referenced and can be set to NULL.
The method used for calculating the interval is controlled by the optional parameters ${\mathbf{Interval Method}}$ and ${\mathbf{Bootstrap Interval Method}}$. The size of the interval, $\alpha$ is controlled by the optional parameter ${\mathbf{Significance Level}}$.
17:  $\mathbf{ch}\left[\mathit{dim}\right]$doubleOutput
Note: the dimension, dim, of the array ch must be at least
• if ${\mathbf{Interval Method}}\ne \mathrm{NONE}$ and ${\mathbf{Matrix Returned}}=\mathrm{COVARIANCE}$${\mathbf{ip}}×{\mathbf{ip}}×{\mathbf{ntau}}$;
• if ${\mathbf{Interval Method}}\ne \mathrm{NONE}$, $\mathrm{IID}$ or $\mathrm{BOOTSTRAP XY}$ and ${\mathbf{Matrix Returned}}=\mathrm{H INVERSE}$${\mathbf{ip}}×{\mathbf{ip}}×\left({\mathbf{ntau}}+1\right)$.
Where ${\mathbf{CH}}\left(i,j,l\right)$ appears in this document, it refers to the array element ${\mathbf{ch}}\left[\left(l-1\right)×{\mathbf{ip}}×{\mathbf{ip}}+\left(j-1\right)×{\mathbf{ip}}+i-1\right]$.
On exit: depending on the supplied optional parameters, ch will either not be referenced, hold an estimate of the upper triangular part of the covariance matrix, $\Sigma$, or an estimate of the upper triangular parts of $n{J}_{n}$ and ${n}^{-1}{H}_{n}^{-1}$.
If ${\mathbf{Interval Method}}=\mathrm{NONE}$ or ${\mathbf{Matrix Returned}}=\mathrm{NONE}$, ch is not referenced.
If ${\mathbf{Interval Method}}=\mathrm{BOOTSTRAP XY}$ or $\mathrm{IID}$ and ${\mathbf{Matrix Returned}}=\mathrm{H INVERSE}$, ch is not referenced.
Otherwise, for $i,j=1,2,\dots ,{\mathbf{ip}},j\ge i$ and $l=1,2,\dots ,{\mathbf{ntau}}$:
• If ${\mathbf{Matrix Returned}}=\mathrm{COVARIANCE}$, ${\mathbf{CH}}\left(i,j,l\right)$ holds an estimate of the covariance between ${\mathbf{B}}\left(i,l\right)$ and ${\mathbf{B}}\left(j,l\right)$.
• If ${\mathbf{Matrix Returned}}=\mathrm{H INVERSE}$, ${\mathbf{CH}}\left(i,j,1\right)$ holds an estimate of the $\left(i,j\right)$th element of $n{J}_{n}$ and ${\mathbf{CH}}\left(i,j,l+1\right)$ holds an estimate of the $\left(i,j\right)$th element of ${n}^{-1}{H}_{n}^{-1}$, for $\tau ={\mathbf{tau}}\left[l-1\right]$.
The method used for calculating $\Sigma$ and ${H}_{n}^{-1}$ is controlled by the optional parameter ${\mathbf{Interval Method}}$.
In cases where ch is not going to be referenced it can be set to NULL.
18:  $\mathbf{res}\left[{\mathbf{n}}×{\mathbf{ntau}}\right]$doubleOutput
Note: the $\left(i,j\right)$th element of the matrix is stored in ${\mathbf{res}}\left[\left(j-1\right)×{\mathbf{n}}+i-1\right]$.
On exit: if ${\mathbf{Return Residuals}}=\mathrm{YES}$, ${\mathbf{res}}\left[\left(\mathit{l}-1\right)×{\mathbf{n}}+\mathit{i}-1\right]$ holds the (weighted) residuals, ${r}_{\mathit{i}}$, for $\tau ={\mathbf{tau}}\left[\mathit{l}-1\right]$, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$ and $\mathit{l}=1,2,\dots ,{\mathbf{ntau}}$.
If ${\mathbf{wt}}\phantom{\rule{0.25em}{0ex}}\text{is not}\phantom{\rule{0.25em}{0ex}}\mathbf{NULL}$ and ${\mathbf{Drop Zero Weights}}=\mathrm{YES}$, the value of res will be set to zero for observations with zero weights.
If ${\mathbf{Return Residuals}}=\mathrm{NO}$, res is not referenced and can be set to NULL.
19:  $\mathbf{iopts}\left[\mathit{dim}\right]$const IntegerCommunication Array
Note: the dimension, $\mathit{dim}$, of this array is dictated by the requirements of associated functions that must have been previously called. This array MUST be the same array passed as argument iopts in the previous call to nag_g02_opt_set (g02zkc).
On entry: if the default values of the optional arguments are sufficient, iopts can be set to NULL, otherwise theoptional parameter array, as initialized by a call to nag_g02_opt_set (g02zkc) must be supplied.
20:  $\mathbf{opts}\left[\mathit{dim}\right]$const doubleCommunication Array
Note: the dimension, $\mathit{dim}$, of this array is dictated by the requirements of associated functions that must have been previously called. This array MUST be the same array passed as argument opts in the previous call to nag_g02_opt_set (g02zkc).
On entry: if the default values of the optional arguments are sufficient, opts can be set to NULL, otherwise theoptional parameter array, as initialized by a call to nag_g02_opt_set (g02zkc) must be supplied.
21:  $\mathbf{state}\left[\mathit{dim}\right]$IntegerCommunication Array
Note: the dimension, $\mathit{dim}$, of this array is dictated by the requirements of associated functions that must have been previously called. This array MUST be the same array passed as argument state in the previous call to nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc).
If ${\mathbf{Interval Method}}=\mathrm{BOOTSTRAP XY}$, state contains information about the selected random number generator. Otherwise state is not referenced and can be set to NULL.
22:  $\mathbf{info}\left[{\mathbf{ntau}}\right]$IntegerOutput
On exit: ${\mathbf{info}}\left[i\right]$ holds additional information concerning the model fitting and confidence limit calculations when $\tau ={\mathbf{tau}}\left[i\right]$.
 Code Warning $0$ Model fitted and confidence limits (if requested) calculated successfully $1$ The function did not converge. The returned values are based on the estimate at the last iteration. Try increasing ${\mathbf{Iteration Limit}}$ whilst calculating the parameter estimates or relaxing the definition of convergence by increasing ${\mathbf{Tolerance}}$. $2$ A singular matrix was encountered during the optimization. The model was not fitted for this value of $\tau$. $4$ Some truncation occurred whilst calculating the confidence limits for this value of $\tau$. See Section 11 for details. The returned upper and lower limits may be narrower than specified. $8$ The function did not converge whilst calculating the confidence limits. The returned limits are based on the estimate at the last iteration. Try increasing ${\mathbf{Iteration Limit}}$. $16$ Confidence limits for this value of $\tau$ could not be calculated. The returned upper and lower limits are set to a large positive and large negative value respectively as defined by the optional parameter ${\mathbf{Big}}$.
It is possible for multiple warnings to be applicable to a single model. In these cases the value returned in info is the sum of the corresponding individual nonzero warning codes.
23:  $\mathbf{fail}$NagError *Input/Output
The NAG error argument (see Section 3.7 in How to Use the NAG Library and its Documentation).

6Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
NE_ARRAY_SIZE
On entry, ${\mathbf{pddat}}=〈\mathit{\text{value}}〉$ and ${\mathbf{m}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pddat}}\ge {\mathbf{m}}$.
On entry, ${\mathbf{pddat}}=〈\mathit{\text{value}}〉$ and ${\mathbf{n}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{pddat}}\ge {\mathbf{n}}$.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_INITIALIZATION
On entry, either the option arrays have not been initialized or they have been corrupted.
NE_INT
On entry, ${\mathbf{m}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{m}}\ge 0$.
On entry, ${\mathbf{n}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{n}}\ge 2$.
On entry, ${\mathbf{ntau}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{ntau}}\ge 1$.
NE_INT_2
On entry, ${\mathbf{ip}}=〈\mathit{\text{value}}〉$ and ${\mathbf{n}}=〈\mathit{\text{value}}〉$.
Constraint: $1\le {\mathbf{ip}}<{\mathbf{n}}$.
NE_INT_ARRAY
On entry, ${\mathbf{isx}}\left[〈\mathit{\text{value}}〉\right]=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{isx}}\left[i\right]=0$ or $1$ for all $i$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
NE_INVALID_STATE
On entry, state vector has been corrupted or not initialized.
NE_IP_INCOMP_SX
On entry, ip is not consistent with isx or intcpt: ${\mathbf{ip}}=〈\mathit{\text{value}}〉$, $\text{expected value}=〈\mathit{\text{value}}〉$.
NE_NEG_WEIGHT
On entry, ${\mathbf{wt}}\left[〈\mathit{\text{value}}〉\right]=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{wt}}\left[i\right]\ge 0.0$ for all $i$.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
NE_OBSERVATIONS
On entry, $\text{effective number of observations}=〈\mathit{\text{value}}〉$.
Constraint: $\text{effective number of observations}\ge 〈\mathit{\text{value}}〉$.
NE_REAL_ARRAY
On entry, ${\mathbf{tau}}\left[〈\mathit{\text{value}}〉\right]=〈\mathit{\text{value}}〉$ is invalid.
NW_POTENTIAL_PROBLEM
A potential problem occurred whilst fitting the model(s).
Additional information has been returned in info.

Not applicable.

8Parallelism and Performance

nag_regsn_quant_linear (g02qgc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
nag_regsn_quant_linear (g02qgc) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the x06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

nag_regsn_quant_linear (g02qgc) allocates internally approximately the following elements of double storage: $13n+np+3{p}^{2}+6p+3\left(p+1\right)×{\mathbf{ntau}}$. If ${\mathbf{Interval Method}}=\mathrm{BOOTSTRAP XY}$ then a further $np$ elements are required, and this increases by $p×{\mathbf{ntau}}×{\mathbf{Bootstrap Iterations}}$ if ${\mathbf{Bootstrap Interval Method}}=\mathrm{QUANTILE}$. Where possible, any user-supplied output arrays are used as workspace and so the amount actually allocated may be less. If ${\mathbf{order}}=\mathrm{Nag_RowMajor}$, ${\mathbf{wt}}\phantom{\rule{0.25em}{0ex}}\text{is}\phantom{\rule{0.25em}{0ex}}\mathbf{NULL}$, ${\mathbf{intcpt}}=\mathrm{Nag_NoIntercept}$ and ${\mathbf{ip}}={\mathbf{m}}$ an internal copy of the input data is avoided and the amount of locally allocated memory is reduced by $np$.

10Example

A quantile regression model is fitted to Engels 1857 study of household expenditure on food. The model regresses the dependent variable, household food expenditure, against two explanatory variables, a column of ones and household income. The model is fit for five different values of $\tau$ and the covariance matrix is estimated assuming Normal IID errors. Both the covariance matrix and the residuals are returned.

10.1Program Text

Program Text (g02qgce.c)

10.2Program Data

Program Data (g02qgce.d)

10.3Program Results

Program Results (g02qgce.r)

11Algorithmic Details

By the addition of slack variables the minimization (1) can be reformulated into the linear programming problem
 $minimize u, v, β ∈ ℝ + n × ℝ + n × ℝ p τ eT u + 1 - τ eT v ​ subject to y = Xβ + u - v$ (2)
and its associated dual
 $maximize d yT d ​ subject to XTd=0, d ∈ τ-1,τ n$ (3)
where $e$ is a vector of $n$ $1$s. Setting $a=d+\left(1-\tau \right)e$ gives the equivalent formulation
 $maximize a yT a ​ subject to XT a = 1 - τ XT e , a ∈ 0,1 n .$ (4)
The algorithm introduced by Portnoy and Koenker (1997) and used by nag_regsn_quant_linear (g02qgc), uses the primal-dual formulation expressed in equations (2) and (4) along with a logarithmic barrier function to obtain estimates for $\beta$. The algorithm is based on the predictor-corrector algorithm of Mehrotra (1992) and further details can be obtained from Portnoy and Koenker (1997) and Koenker (2005). A good description of linear programming, interior point algorithms, barrier functions and Mehrotra's predictor-corrector algorithm can be found in Nocedal and Wright (2006).

11.1Interior Point Algorithm

In this section a brief description of the interior point algorithm used to estimate the model parameters is presented. It should be noted that there are some differences in the equations given here – particularly (7) and (9) – compared to those given in Koenker (2005) and Portnoy and Koenker (1997).

11.1.1Central path

Rather than optimize (4) directly, an additional slack variable $s$ is added and the constraint $a\in {\left[0,1\right]}^{n}$ is replaced with $a+s=e,{a}_{i}\ge 0,{s}_{i}\ge 0$, for $i=1,2,\dots ,n$.
The positivity constraint on $a$ and $s$ is handled using the logarithmic barrier function
 $B a,s,μ = yT a + μ ⁢ ∑ i=1 n log⁡ai + log⁡si .$
The primal-dual form of the problem is used giving the Lagrangian
 $L a,s,β,u,μ = B a,s,μ - βT XT a - 1 - τ XT e - uT a + s - e$
whose central path is described by the following first order conditions
 $XTa = 1-τ XTe a+s = e Xβ+u-v = y SUe = μe AVe = μe$ (5)
where $A$ denotes the diagonal matrix with diagonal elements given by $a$, similarly with $S,U$ and $V$. By enforcing the inequalities on $s$ and $a$ strictly, i.e., ${a}_{i}>0$ and ${s}_{i}>0$ for all $i$ we ensure that $A$ and $S$ are positive definite diagonal matrices and hence ${A}^{-1}$ and ${S}^{-1}$ exist.
Rather than applying Newton's method to the system of equations given in (5) to obtain the step directions ${\delta }_{\beta },{\delta }_{a},{\delta }_{s},{\delta }_{u}$ and ${\delta }_{v}$, Mehrotra substituted the steps directly into (5) giving the augmented system of equations
 $XT a + δa = 1-τXTe a + δa + s + δs = e X β + δβ + u + δu - v + δv = y S + Δs U + Δu e = μe A + Δa V + Δv e = μe$ (6)
where ${\Delta }_{a},{\Delta }_{s},{\Delta }_{u}$ and ${\Delta }_{v}$ denote the diagonal matrices with diagonal elements given by ${\delta }_{a},{\delta }_{s},{\delta }_{u}$ and ${\delta }_{v}$ respectively.

11.1.2Affine scaling step

The affine scaling step is constructed by setting $\mu =0$ in (5) and applying Newton's method to obtain an intermediate set of step directions
 $XT W X δ β = XT W y - X β + τ - 1 XT e + XT a δ a = W y-Xβ - X δ β δ s = - δ a δ u = S-1 U δ a - U e δ v = A-1 V δ s - V e$ (7)
where $W={\left({S}^{-1}U+{A}^{-1}V\right)}^{-1}$.
Initial step sizes for the primal (${\stackrel{^}{\gamma }}_{P}$) and dual (${\stackrel{^}{\gamma }}_{D}$) parameters are constructed as
 $γ^P = σ × min min i , δ a i < 0 ai / δ a i , min i , δ s i < 0 si / δ s i γ^D = σ × min min i , δ u i < 0 ui / δ u i , min i , δ v i < 0 vi / δ v i$ (8)
where $\sigma$ is a user-supplied scaling factor. If ${\stackrel{^}{\gamma }}_{P}×{\stackrel{^}{\gamma }}_{D}\ge 1$ then the nonlinearity adjustment, described in Section 11.1.3, is not made and the model parameters are updated using the current step size and directions.

In the nonlinearity adjustment step a new estimate of $\mu$ is obtained by letting
 $g^γ^P,γ^D = s + γ^P δs T u + γ^D δu + a + γ^P δa T v + γ^D δv$
and estimating $\mu$ as
 $μ = g^γ^P,γ^D g^0,0 3 ⁢ g^0,0 2⁢n .$
This estimate, along with the nonlinear terms ($\Delta u$, $\Delta s$, $\Delta a$ and $\Delta v$) from (6) are calculated using the values of ${\delta }_{a},{\delta }_{s},{\delta }_{u}$ and ${\delta }_{v}$ obtained from the affine scaling step.
Given an updated estimate for $\mu$ and the nonlinear terms the system of equations
 $XT W X δ β = XT W y - X β + μ S-1 - A-1 e + S-1 Δ s Δ u e - A-1 Δ a Δ v e + τ - 1 XT e + XT a δ a = W y-Xβ - X δ β + μ S-1 - A-1 δ s = - δ a δ u = μ S-1 e + S-1 U δ a - U e - S-1 Δs Δu e δ v = μ A-1 e + A-1 V δ s - V e - A-1 Δa Δv e$ (9)
are solved and updated values for ${\delta }_{\beta },{\delta }_{a},{\delta }_{s},{\delta }_{u},{\delta }_{v},{\stackrel{^}{\gamma }}_{P}$ and ${\stackrel{^}{\gamma }}_{D}$ calculated.

11.1.4Update and convergence

At each iteration the model parameters $\left(\beta ,a,s,u,v\right)$ are updated using step directions, $\left({\delta }_{\beta },{\delta }_{a},{\delta }_{s},{\delta }_{u},{\delta }_{v}\right)$ and step lengths $\left({\stackrel{^}{\gamma }}_{P},{\stackrel{^}{\gamma }}_{D}\right)$.
Convergence is assessed using the duality gap, that is, the differences between the objective function in the primal and dual formulations. For any feasible point $\left(u,v,s,a\right)$ the duality gap can be calculated from equations (2) and (3) as
 $τ eT u + 1-τ ⁢ eT v - dT y = τ eT u + 1-τ ⁢ eT v - a - 1 - τ e T y = sT u + aT v = eT u - aT y + 1 - τ eT X β$
and the optimization terminates if the duality gap is smaller than the tolerance supplied in the optional parameter ${\mathbf{Tolerance}}$.

Initial values are required for the parameters $a,s,u,v$ and $\beta$. If not supplied by the user, initial values for $\beta$ are calculated from a least squares regression of $y$ on $X$. This regression is carried out by first constructing the cross-product matrix ${X}^{\mathrm{T}}X$ and then using a pivoted $QR$ decomposition as performed by nag_dgeqp3 (f08bfc). In addition, if the cross-product matrix is not of full rank, a rank reduction is carried out and, rather than using the full design matrix, $X$, a matrix formed from the first $p$-rank columns of $XP$ is used instead, where $P$ is the pivot matrix used during the $QR$ decomposition. Parameter estimates, confidence intervals and the rows and columns of the matrices returned in the argument ch (if any) are set to zero for variables dropped during the rank-reduction. The rank reduction step is performed irrespective of whether initial values are supplied by the user.
Once initial values have been obtained for $\beta$, the initial values for $u$ and $v$ are calculated from the residuals. If $\left|{r}_{i}\right|<{\epsilon }_{u}$ then a value of $±{\epsilon }_{u}$ is used instead, where ${\epsilon }_{u}$ is supplied in the optional parameter ${\mathbf{Epsilon}}$. The initial values for the $a$ and $s$ are always set to $1-\tau$ and $\tau$ respectively.
The solution for ${\delta }_{\beta }$ in both (7) and (9) is obtained using a Bunch–Kaufman decomposition, as implemented in nag_dsytrf (f07mdc).

11.2Calculation of Covariance Matrix

nag_regsn_quant_linear (g02qgc) supplies four methods to calculate the covariance matrices associated with the parameter estimates for $\beta$. This section gives some additional detail on three of the algorithms, the fourth, (which uses bootstrapping), is described in Section 3.
(i) Independent, identically distributed (IID) errors
When assuming IID errors, the covariance matrices depend on the sparsity, $s\left(\tau \right)$, which nag_regsn_quant_linear (g02qgc) estimates as follows:
 (a) Let ${r}_{i}$ denote the residuals from the original quantile regression, that is ${r}_{i}={y}_{i}-{x}_{i}^{\mathrm{T}}\stackrel{^}{\beta }$. (b) Drop any residual where $\left|{r}_{i}\right|$ is less than ${\epsilon }_{u}$, supplied in the optional parameter ${\mathbf{Epsilon}}$. (c) Sort and relabel the remaining residuals in ascending order, by absolute value, so that ${\epsilon }_{u}<\left|{r}_{1}\right|<\left|{r}_{2}\right|<\dots$. (d) Select the first $l$ values where $l={h}_{n}n$, for some bandwidth ${h}_{n}$. (e) Sort and relabel these $l$ residuals again, so that ${r}_{1}<{r}_{2}<\dots <{r}_{l}$ and regress them against a design matrix with two columns ($p=2$) and rows given by ${x}_{i}=\left\{1,i/\left(n-p\right)\right\}$ using quantile regression with $\tau =0.5$. (f) Use the resulting estimate of the slope as an estimate of the sparsity.
(ii) Powell Sandwich
When using the Powell Sandwich to estimate the matrix ${H}_{n}$, the quantity
 $cn = minσr, qr3 - qr1 / 1.34 × Φ-1 τ + hn - Φ-1 τ - hn$
is calculated. Dependent on the value of $\tau$ and the method used to calculate the bandwidth (${h}_{n}$), it is possible for the quantities $\tau ±{h}_{n}$ to be too large or small, compared to machine precision ($\epsilon$). More specifically, when $\tau -{h}_{n}\le \sqrt{\epsilon }$, or $\tau +{h}_{n}\ge 1-\sqrt{\epsilon }$, a warning flag is raised in info, the value is truncated to $\sqrt{\epsilon }$ or $1-\sqrt{\epsilon }$ respectively and the covariance matrix calculated as usual.
(iii) Hendricks–Koenker Sandwich
The Hendricks–Koenker Sandwich requires the calculation of the quantity ${d}_{i}={x}_{i}^{\mathrm{T}}\left(\stackrel{^}{\beta }\left(\tau +{h}_{n}\right)-\stackrel{^}{\beta }\left(\tau -{h}_{n}\right)\right)$. As with the Powell Sandwich, in cases where $\tau -{h}_{n}\le \sqrt{\epsilon }$, or $\tau +{h}_{n}\ge 1-\sqrt{\epsilon }$, a warning flag is raised in info, the value truncated to $\sqrt{\epsilon }$ or $1-\sqrt{\epsilon }$ respectively and the covariance matrix calculated as usual.
In addition, it is required that ${d}_{i}>0$, in this method. Hence, instead of using $2{h}_{n}/{d}_{i}$ in the calculation of ${H}_{n}$, $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(2{h}_{n}/\left({d}_{i}+{\epsilon }_{u}\right),0\right)$ is used instead, where ${\epsilon }_{u}$ is supplied in the optional parameter ${\mathbf{Epsilon}}$.

12Optional Parameters

Several optional parameters in nag_regsn_quant_linear (g02qgc) control aspects of the optimization algorithm, methodology used, logic or output. Their values are contained in the arrays iopts and opts; these must be initialized before calling nag_regsn_quant_linear (g02qgc) by first calling nag_g02_opt_set (g02zkc) with optstr set to ${\mathbf{Initialize}}={\mathbf{g02qgc}}$.
Each optional parameter has an associated default value; to set any of them to a non-default value, use nag_g02_opt_set (g02zkc). The current value of an optional parameter can be queried using nag_g02_opt_get (g02zlc).
The remainder of this section can be skipped if you wish to use the default values for all optional parameters.
The following is a list of the optional parameters available. A full description of each optional parameter is provided in Section 12.1.

12.1Description of the Optional Parameters

For each option, we give a summary line, a description of the optional parameter and details of constraints.
The summary line contains:
• the keywords, where the minimum abbreviation of each keyword is underlined (if no characters of an optional qualifier are underlined, the qualifier may be omitted);
• a parameter value, where the letters $a$, $i$ and $r$ denote options that take character, integer and real values respectively;
• the default value, where the symbol $\epsilon$ is a generic notation for machine precision (see nag_machine_precision (X02AJC)).
Keywords and character values are case and white space insensitive.
 Band Width Alpha $r$ Default $\text{}=1.0$
A multiplier used to construct the parameter ${\alpha }_{b}$ used when calculating the Sheather–Hall bandwidth (see Section 3), with ${\alpha }_{b}=\left(1-\alpha \right)×{\mathbf{Band Width Alpha}}$. Here, $\alpha$ is the ${\mathbf{Significance Level}}$.
Constraint: ${\mathbf{Band Width Alpha}}>0.0$.
 Band Width Method $a$ Default $\text{}=\text{'SHEATHER HALL'}$
The method used to calculate the bandwidth used in the calculation of the asymptotic covariance matrix $\Sigma$ and ${H}^{-1}$ if ${\mathbf{Interval Method}}=\mathrm{HKS}$, $\mathrm{KERNEL}$ or $\mathrm{IID}$ (see Section 3).
Constraint: ${\mathbf{Band Width Method}}=\overline{)\mathrm{SHE}}\mathrm{ATHER}\overline{)\mathrm{HAL}}\mathrm{L}$ or $\overline{)\mathrm{BOF}}\mathrm{INGER}$.
 Big $r$ Default $\text{}={10.0}^{20}$
This parameter should be set to something larger than the biggest value supplied in dat and y.
Constraint: ${\mathbf{Big}}>0.0$.
 Bootstrap Interval Method $a$ Default $\text{}=\mathrm{QUANTILE}$
If ${\mathbf{Interval Method}}=\mathrm{BOOTSTRAP XY}$, ${\mathbf{Bootstrap Interval Method}}$ controls how the confidence intervals are calculated from the bootstrap estimates.
${\mathbf{Bootstrap Interval Method}}=\mathrm{T}$
$t$ intervals are calculated. That is, the covariance matrix, $\Sigma =\left\{{\sigma }_{ij}:i,j=1,2,\dots ,p\right\}$ is calculated from the bootstrap estimates and the limits calculated as ${\beta }_{i}±{t}_{\left(n-p,\left(1+\alpha \right)/2\right)}{\sigma }_{ii}$ where ${t}_{\left(n-p,\left(1+\alpha \right)/2\right)}$ is the $\left(1+\alpha \right)/2$ percentage point from a Student's $t$ distribution on $n-p$ degrees of freedom, $n$ is the effective number of observations and $\alpha$ is given by the optional parameter ${\mathbf{Significance Level}}$.
${\mathbf{Bootstrap Interval Method}}=\mathrm{QUANTILE}$
Quantile intervals are calculated. That is, the upper and lower limits are taken as the $\left(1+\alpha \right)/2$ and $\left(1-\alpha \right)/2$ quantiles of the bootstrap estimates, as calculated using nag_double_quantiles (g01amc).
Constraint: ${\mathbf{Bootstrap Interval Method}}=\overline{)\mathrm{T}}$ or $\overline{)\mathrm{QUA}}\mathrm{NTILE}$.
 Bootstrap Iterations $i$ Default $\text{}=100$
The number of bootstrap samples used to calculate the confidence limits and covariance matrix (if requested) when ${\mathbf{Interval Method}}=\mathrm{BOOTSTRAP XY}$.
Constraint: ${\mathbf{Bootstrap Iterations}}>1$.
 Bootstrap Monitoring $a$ Default $\text{}=\mathrm{NO}$
If ${\mathbf{Bootstrap Monitoring}}=\mathrm{YES}$ and ${\mathbf{Interval Method}}=\mathrm{BOOTSTRAP XY}$, the parameter estimates for each of the bootstrap samples are displayed. This information is sent to the unit number specified by ${\mathbf{Unit Number}}$.
Constraint: ${\mathbf{Bootstrap Monitoring}}=\overline{)\mathrm{YES}}$ or $\overline{)\mathrm{NO}}$.
 Calculate Initial Values $a$ Default $\text{}=\mathrm{YES}$
If ${\mathbf{Calculate Initial Values}}=\mathrm{YES}$ then the initial values for the regression parameters, $\beta$, are calculated from the data. Otherwise they must be supplied in b.
Constraint: ${\mathbf{Calculate Initial Values}}=\overline{)\mathrm{YES}}$ or $\overline{)\mathrm{NO}}$.
 Defaults
This special keyword is used to reset all optional parameters to their default values.
 Drop Zero Weights $a$ Default $\text{}=\mathrm{YES}$
If a weighted regression is being performed and ${\mathbf{Drop Zero Weights}}=\mathrm{YES}$ then observations with zero weight are dropped from the analysis. Otherwise such observations are included.
Constraint: ${\mathbf{Drop Zero Weights}}=\overline{)\mathrm{YES}}$ or $\overline{)\mathrm{NO}}$.
 Epsilon $r$ Default $\text{}=\sqrt{\epsilon }$
${\epsilon }_{u}$, the tolerance used when calculating the covariance matrix and the initial values for $u$ and $v$. For additional details see Section 11.2 and Section 11.1.5 respectively.
Constraint: ${\mathbf{Epsilon}}\ge 0.0$.
 Interval Method $a$ Default $\text{}=\mathrm{IID}$
The value of ${\mathbf{Interval Method}}$ controls whether confidence limits are returned in bl and bu and how these limits are calculated. This parameter also controls how the matrices returned in ch are calculated.
${\mathbf{Interval Method}}=\mathrm{NONE}$
No limits are calculated and bl, bu and ch are not referenced.
${\mathbf{Interval Method}}=\mathrm{KERNEL}$
The Powell Sandwich method with a Gaussian kernel is used.
${\mathbf{Interval Method}}=\mathrm{HKS}$
The Hendricks–Koenker Sandwich is used.
${\mathbf{Interval Method}}=\mathrm{IID}$
The errors are assumed to be identical, and independently distributed.
${\mathbf{Interval Method}}=\mathrm{BOOTSTRAP XY}$
A bootstrap method is used, where sampling is done on the pair $\left({y}_{i},{x}_{i}\right)$. The number of bootstrap samples is controlled by the parameter ${\mathbf{Bootstrap Iterations}}$ and the type of interval constructed from the bootstrap samples is controlled by ${\mathbf{Bootstrap Interval Method}}$.
Constraint: ${\mathbf{Interval Method}}=\overline{)\mathrm{NON}}\mathrm{E}$, $\overline{)\mathrm{KER}}\mathrm{NEL}$, $\overline{)\mathrm{HKS}}$, $\overline{)\mathrm{IID}}$ or $\overline{)\mathrm{BOO}}\mathrm{TSTRAP}\overline{)\mathrm{XY}}$.
 Iteration Limit $i$ Default $\text{}=100$
The maximum number of iterations to be performed by the interior point optimization algorithm.
Constraint: ${\mathbf{Iteration Limit}}>0$.
 Matrix Returned $a$ Default $\text{}=\mathrm{NONE}$
The value of ${\mathbf{Matrix Returned}}$ controls the type of matrices returned in ch. If ${\mathbf{Interval Method}}=\mathrm{NONE}$, this parameter is ignored and ch is not referenced. Otherwise:
${\mathbf{Matrix Returned}}=\mathrm{NONE}$
No matrices are returned and ch is not referenced.
${\mathbf{Matrix Returned}}=\mathrm{COVARIANCE}$
The covariance matrices are returned.
${\mathbf{Matrix Returned}}=\mathrm{H INVERSE}$
If ${\mathbf{Interval Method}}=\mathrm{KERNEL}$ or $\mathrm{HKS}$, the matrices $J$ and ${H}^{-1}$ are returned. Otherwise no matrices are returned and ch is not referenced.
The matrices returned are calculated as described in Section 3, with the algorithm used specified by ${\mathbf{Interval Method}}$. In the case of ${\mathbf{Interval Method}}=\mathrm{BOOTSTRAP XY}$ the covariance matrix is calculated directly from the bootstrap estimates.
Constraint: ${\mathbf{Matrix Returned}}=\overline{)\mathrm{NON}}\mathrm{E}$, $\overline{)\mathrm{COV}}\mathrm{ARIANCE}$ or $\overline{)\mathrm{H}}\mathrm{}\overline{)\mathrm{INV}}\mathrm{ERSE}$.
 Monitoring $a$ Default $\text{}=\mathrm{NO}$
If ${\mathbf{Monitoring}}=\mathrm{YES}$ then the duality gap is displayed at each iteration of the interior point optimization algorithm. In addition, the final estimates for $\beta$ are also displayed.
The monitoring information is sent to the unit number specified by ${\mathbf{Unit Number}}$.
Constraint: ${\mathbf{Monitoring}}=\overline{)\mathrm{YES}}$ or $\overline{)\mathrm{NO}}$.
 QR Tolerance $r$ Default $\text{}={\epsilon }^{0.9}$
The tolerance used to calculate the rank, $k$, of the $p×p$ cross-product matrix, ${X}^{\mathrm{T}}X$. Letting $Q$ be the orthogonal matrix obtained from a $QR$ decomposition of ${X}^{\mathrm{T}}X$, then the rank is calculated by comparing ${Q}_{ii}$ with ${Q}_{11}×{\mathbf{QR Tolerance}}$.
If the cross-product matrix is rank deficient, the parameter estimates for the $p-k$ columns with the smallest values of ${Q}_{ii}$ are set to zero, along with the corresponding entries in bl, bu and ch, if returned. This is equivalent to dropping these variables from the model. Details on the $QR$ decomposition used can be found in nag_dgeqp3 (f08bfc).
Constraint: ${\mathbf{QR Tolerance}}>0.0$.
 Return Residuals $a$ Default $\text{}=\mathrm{NO}$
If ${\mathbf{Return Residuals}}=\mathrm{YES}$, the residuals are returned in res. Otherwise res is not referenced.
Constraint: ${\mathbf{Return Residuals}}=\overline{)\mathrm{YES}}$ or $\overline{)\mathrm{NO}}$.
 Sigma $r$ Default $\text{}=0.99995$
The scaling factor used when calculating the affine scaling step size (see equation (8)).
Constraint: $0.0<{\mathbf{Sigma}}<1.0$.
 Significance Level $r$ Default $\text{}=0.95$
$\alpha$, the size of the confidence interval whose limits are returned in bl and bu.
Constraint: $0.0<{\mathbf{Significance Level}}<1.0$.
 Tolerance $r$ Default $\text{}=\sqrt{\epsilon }$
Convergence tolerance. The optimization is deemed to have converged if the duality gap is less than ${\mathbf{Tolerance}}$ (see Section 11.1.4).
Constraint: ${\mathbf{Tolerance}}>0.0$.
 Unit Number $i$ Output sent to stdout
The unit number to which any monitoring information is sent. See nag_open_file (x04acc) for details on how to assign a file to a unit number. If no unit number is specified then any monitoring information will be sent to standard output (stdout).
Constraint: ${\mathbf{Unit Number}}>1$.

13Description of Monitoring Information

See the description of the optional argument ${\mathbf{Monitoring}}$.
© The Numerical Algorithms Group Ltd, Oxford, UK. 2017