g02dkc calculates the estimates of the arguments of a general linear regression model for given constraints from the singular value decomposition results.
The function may be called by the names: g02dkc, nag_correg_linregm_constrain or nag_regsn_mult_linear_tran_model.
3Description
g02dkc computes the estimates given a set of linear constraints for a general linear regression model which is not of full rank. It is intended for use after a call to g02dac or g02ddc.
In the case of a model not of full rank the functions use a singular value decomposition (SVD) to find the parameter estimates, , and their variance-covariance matrix. Details of the SVD are made available, in the form of the matrix :
Alternative solutions can be formed by imposing constraints on the arguments. If there are arguments and the rank of the model is , then constraints will have to be imposed to obtain a unique solution.
Let be a matrix of constraints, such that
then the new parameter estimates are given by:
where is the identity matrix, and the variance-covariance matrix is given by:
provided exists.
4References
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
Searle S R (1971) Linear Models Wiley
5Arguments
1: – IntegerInput
On entry: the number of terms in the linear model, .
Constraint:
.
2: – IntegerInput
On entry: the number of constraints to be imposed on the arguments, .
On entry: the iconst constraints stored by column, i.e., the th constraint is stored in the th column of c.
5: – IntegerInput
On entry: the stride separating matrix column elements in the array c.
Constraint:
.
6: – doubleInput/Output
On entry: the parameter estimates computed by using the singular value decomposition, .
On exit: the parameter estimates of the arguments with the constraints imposed, .
7: – doubleInput
On entry: the residual sum of squares as returned by g02dac or g02ddc.
Constraint:
.
8: – doubleInput
On entry: the degrees of freedom associated with the residual sum of squares as returned by g02dac or g02ddc.
Constraint:
.
9: – doubleOutput
On exit: the standard error of the parameter estimates in b.
10: – doubleOutput
On exit: the upper triangular part of the variance-covariance matrix of the ip parameter estimates given in b. They are stored packed by column, i.e., the covariance between the parameter estimate given in and the parameter estimate given in , , is stored in , for and .
11: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
On entry, df must not be less than or equal to 0.0: .
On entry, rss must not be less than or equal to 0.0: .
7Accuracy
It should be noted that due to rounding errors an argument that should be zero when the constraints have been imposed may be returned as a value of order machine precision.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
g02dkc is not threaded in any implementation.
9Further Comments
g02dkc is intended for use in situations in which dummy (0-1) variables have been used such as in the analysis of designed experiments when you do not wish to change the arguments of the model to give a full rank model. The function is not intended for situations in which the relationships between the independent variables are only approximate.
10Example
Data from an experiment with four treatments and three observations per treatment are read in. A model, including the mean term, is fitted by g02dac and the results printed. The constraint that the sum of treatment effects is zero is then read in and the parameter estimates with this constraint imposed are computed by g02dkc and printed.