The routine may be called by the names g02dff or nagf_correg_linregm_var_del.
When selecting a linear regression model it is sometimes useful to drop independent variables from the model and to examine the resulting sub-model. g02dff updates the decomposition used in the computation of the linear regression model. The decomposition may come from g02daforg02def, or a previous call to g02dff.
For the general linear regression model with independent variables fitted g02daforg02def compute a decomposition of the (weighted) independent variables and form an upper triangular matrix and a vector . To remove an independent variable and have to be updated. The column of corresponding to the variable to be dropped is removed and the matrix is then restored to upper triangular form by applying a series of Givens rotations. The rotations are then applied to . Note only the first elements of are affected.
The method used means that while the updated values of and are computed an updated value of from the decomposition is not available so a call to g02def cannot be made after a call to g02dff.
g02ddf can be used to calculate the parameter estimates, , from the information provided by g02dff.
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Hammarling S (1985) The singular value decomposition in multivariate statistics SIGNUM Newsl.20(3) 2–25
1: – IntegerInput
On entry: , the number of independent variables already in the model.
2: – Real (Kind=nag_wp) arrayInput/Output
On entry: the results of the decomposition as returned by routines g02daf,g02dcf,g02deforg02eef, or previous calls to g02dff.
On exit: the updated decomposition.
3: – IntegerInput
On entry: the first dimension of the array q as declared in the (sub)program from which g02dff is called.
4: – IntegerInput
On entry: indicates which independent variable is to be deleted from the model.
5: – Real (Kind=nag_wp)Input/Output
On entry: the residual sum of squares for the full regression.
On exit: the residual sum of squares with the (indx)th variable removed. Note that the residual sum of squares will only be valid if the regression is of full rank, otherwise the residual sum of squares should be obtained using g02ddf.
6: – Real (Kind=nag_wp) arrayWorkspace
7: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or 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).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
On entry, .
Constraint: and .
On entry, .
On entry, and .
On entry, .
On entry, .
An unexpected error has been triggered by this routine. Please
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
There will inevitably be some loss in accuracy in fitting a model by dropping terms from a more complex model rather than fitting it afresh using g02daf.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
g02dff 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.
A dataset consisting of observations on four independent variables and one dependent variable is read in. The full model, including a mean term, is fitted using g02daf. The value of indx is read in and that variable dropped from the regression. The parameter estimates are calculated by g02ddf and printed. This process is repeated until indx is .