G02MCF calculates additional parameter estimates following Least Angle Regression (LARS), forward stagewise linear regression or Least Absolute Shrinkage and Selection Operator (LASSO) as performed by G02MAF and G02MBF.
G02MAF and G02MBF fit either a LARS, forward stagewise linear regression, LASSO or positive LASSO model to a vector of observed values,
and an design matrix , where the th column of is given by the th independent variable . The models are fit using the LARS algorithm of Efron et al. (2004).
The full solution path for all four of these models follow a similar pattern where the parameter estimate for a given variable is piecewise linear. One such path, for a LARS model with six variables can be seen in Figure 1. Both G02MAF and G02MBF return the vector of parameter estimates, , at points along this path (so ). Each point corresponds to a step of the LARS algorithm. The number of steps taken depends on the model being fitted. In the case of a LARS model, and each step corresponds to a new variable being included in the model. In the case of the LASSO models, each step corresponds to either a new variable being included in the model or an existing variable being removed from the model; the value of is therefore no longer bound by the number of parameters. For forward stagewise linear regression, each step no longer corresponds to the addition or removal of a variable; therefore the number of possible steps is often markedly greater than for a corresponding LASSO model.
G02MCF uses the piecewise linear nature of the solution path to predict the parameter estimates, , at a different point on this path. The location of the solution can either be defined in terms of a (fractional) step number or a function of the norm of the parameter estimates.
Efron B, Hastie T, Johnstone I and Tibshirani R (2004) Least Angle Regression The Annals of Statistics (Volume 32)2 407–499
Hastie T, Tibshirani R and Friedman J (2001) The Elements of Statistical Learning: Data Mining, Inference and Prediction Springer (New York)
Tibshirani R (1996) Regression Shrinkage and Selection via the Lasso Journal of the Royal Statistics Society, Series B (Methodological) (Volume 58)1 267–288
Weisberg S (1985) Applied Linear Regression Wiley
1: – INTEGERInput
On entry: , the number of steps carried out in the model fitting process, as returned by G02MAF and G02MBF.
2: – INTEGERInput
On entry: , number of parameter estimates, as returned by G02MAF and G02MBF.
3: – REAL (KIND=nag_wp) arrayInput
Note: the second dimension of the array B
must be at least
On entry: the parameter estimates, as returned by G02MAF and G02MBF, with
, the parameter estimate for the th variable, for , at the th step of the model fitting process.
B should be unchanged since the last call to G02MAF or G02MBF.
4: – INTEGERInput
On entry: the first dimension of the array B as declared in the (sub)program from which G02MCF is called.
5: – REAL (KIND=nag_wp) arrayInput
On entry: summaries of the model fitting process, as returned by G02MAF and G02MBF.
NK holds values for norm of the (scaled) parameters.
NK holds ratios with respect to the largest (scaled) norm.
NK holds values for the norm of the (unscaled) parameters.
NK holds ratios with respect to the largest (unscaled) norm.
If G02MAF was called with or or G02MBF was called with then the model fitting routine did not rescale the independent variables, , prior to fitting the model and therefore there is no difference between or and or .
, , , or .
7: – REAL (KIND=nag_wp) arrayInput
On entry: target values used for predicting the new set of parameter estimates.
Note: the second dimension of the array NB
must be at least
On exit: the predicted parameter estimates, with , the parameter estimate for variable , at the point in the fitting process associated with , .
10: – INTEGERInput
On entry: the first dimension of the array NB as declared in the (sub)program from which G02MCF is called.
11: – INTEGERInput/Output
On entry: IFAIL must be set to , . If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value is recommended. If the output of error messages is undesirable, then the value is recommended. Otherwise, because for this routine the values of the output arguments may be useful even if on exit, the recommended value is . When the value is used it is essential to test the value of IFAIL on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6 Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by X04AAF).
Note: G02MCF may return useful information for one or more of the following detected errors or warnings.
An unexpected error has been triggered by this routine. Please
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.
8 Parallelism and Performance
G02MCF is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
G02MCF 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 routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.
9 Further Comments
This example performs a LARS on a set a simulated dataset with observations and independent variables.
Additional parameter estimates are obtained corresponding to a LARS step number of and . Where, for example, corresponds to the solution halfway between that obtained at step and that obtained at step .