nag_lars_param (g02mcc) calculates additional parameter estimates following Least Angle Regression (LARS), forward stagewise linear regression or Least Absolute Shrinkage and Selection Operator (LASSO) as performed by
nag_lars (g02mac) and
nag_lars_xtx (g02mbc).
nag_lars (g02mac) and
nag_lars_xtx (g02mbc) 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
nag_lars (g02mac) and
nag_lars_xtx (g02mbc) 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.
nag_lars_param (g02mcc) 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.
- 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, and
Constraint: .
On entry, and .
Constraint: .
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- 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.
An unexpected error has been triggered by this function. Please contact
NAG.
See
Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
- 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_OUT_OF_RANGE
-
On entry, or , .
Constraint: for all .
On entry, , , and .
Constraint: for all .
On entry, , and
Constraint: for all .
On entry, , and
Constraint: for all .
- NE_REAL_ARRAY
-
b has been corrupted since the last call to
nag_lars (g02mac) or
nag_lars_xtx (g02mbc).
fitsum has been corrupted since the last call to
nag_lars (g02mac) or
nag_lars_xtx (g02mbc).
Not applicable.
None.
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 .