g02de adds a new independent variable to a general linear regression model.
- Type: System..::..StringOn entry: indicates if weights are to be used.
Constraint: or .
- Least squares estimation is used.
- Weighted least squares is used and weights must be supplied in array wt.
- Type: System..::..Int32On entry: , the number of observations.Constraint: .
- Type: System..::..Int32On entry: , the number of independent variables already in the model.Constraint: and .
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, ]Note: dim1 must satisfy the constraint:On entry: if , q must contain the results of the decomposition for the model with parameters as returned by g02da or a previous call to g02de.If , the first column of q should contain the values of the dependent variable, .On exit: the results of the decomposition for the model with parameters:
- the first column of q contains the updated value of ;
- the columns to are unchanged;
- the first elements of column contain the new column of , while the remaining elements contain details of the matrix .
- Type: array<System..::..Double>()An array of size On entry: contains further details of the decomposition used. The first ip elements of p must contain the zeta values for the decomposition (see (F08AEF not in this release) for details).
- Type: array<System..::..Double>()An array of size [dim1]Note: the dimension of the array wt must be at least if , and at least otherwise.On entry: if , wt must contain the weights to be used.If , the th observation is not included in the model, in which case the effective number of observations is the number of observations with nonzero weights.If , wt is not referenced and the effective number of observations is .Constraint: if , , for .
- Type: array<System..::..Double>()An array of size [n]On entry: , the new independent variable.
- Type: System..::..Double%On exit: the residual sum of squares for the new fitted model.Note: this will only be valid if the model is of full rank, see [Further Comments].
- Type: System..::..DoubleOn entry: the value of tol is used to decide if the new independent variable is linearly related to independent variables already included in the model. If the new variable is linearly related then is not updated. The smaller the value of tol the stricter the criterion for deciding if there is a linear relationship.Suggested value: .Constraint: .
A linear regression model may be built up by adding new independent variables to an existing model. g02de updates the decomposition used in the computation of the linear regression model. The decomposition may come from g02da or a previous call to g02de. The general linear regression model is defined by
|where||is a vector of observations on the dependent variable,|
|is an by matrix of the independent variables of column rank ,|
|is a vector of length of unknown parameters,|
|and||is a vector of length of unknown random errors such that , where is a known diagonal matrix.|
If , the identity matrix, then least squares estimation is used. If , then for a given weight matrix , weighted least squares estimation is used.
The least squares estimates, of the parameters minimize while the weighted least squares estimates, minimize .
The parameter estimates may be found by computing a decomposition of (or in the weighted case), i.e.,
where and is a by upper triangular matrix and is an by orthogonal matrix.
If is of full rank, then is the solution to
where (or ) and is the first elements of .
If is not of full rank a solution is obtained by means of a singular value decomposition (SVD) of .
To add a new independent variable, , and have to be updated. The matrix is found such that (or ) is upper triangular. The vector is then updated by multiplying by .
The new independent variable is tested to see if it is linearly related to the existing independent variables by checking that at least one of the values , for , is nonzero.
The new parameter estimates, , can then be obtained by a call to g02dd.
The method can be used with , in which case and are initialized.
Draper N R and Smith H (1985) Applied Regression Analysis (2nd Edition) Wiley
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
McCullagh P and Nelder J A (1983) Generalized Linear Models Chapman and Hall
Searle S R (1971) Linear Models Wiley
Note: g02de may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (LDQ) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry, , or , or , or , or or .
- The new independent variable is a linear combination of existing variables. The th column of q will therefore be null.
The accuracy is closely related to the accuracy of f08ag which should be consulted for further details.