G02DDF calculates the regression parameters for a general linear regression model. It is intended to be called after
G02DCF,
G02DEF or
G02DFF.
SUBROUTINE G02DDF ( |
N, IP, Q, LDQ, RSS, IDF, B, SE, COV, SVD, IRANK, P, TOL, WK, IFAIL) |
INTEGER |
N, IP, LDQ, IDF, IRANK, IFAIL |
REAL (KIND=nag_wp) |
Q(LDQ,IP+1), RSS, B(IP), SE(IP), COV(IP*(IP+1)/2), P(IP*IP+2*IP), TOL, WK(IP*IP+(IP-1)*5) |
LOGICAL |
SVD |
|
A general linear regression model fitted by
G02DAF may be adjusted by adding or deleting an observation using
G02DCF, adding a new independent variable using
G02DEF or deleting an existing independent variable using
G02DFF. Alternatively a model may be constructed by a forward selection procedure using
G02EEF. These routines compute the vector
and the upper triangular matrix
. G02DDF takes these basic results and computes the regression coefficients,
, their standard errors and their variance-covariance matrix.
If
is not of full rank a solution is obtained by means of a singular value decomposition (SVD) of
,
where
is a
by
diagonal matrix with nonzero diagonal elements,
being the rank of
, and
and
are
by
orthogonal matrices. This gives the solution
being the first
columns of
, i.e.,
, and
being the first
columns of
.
Details of the SVD are made available in the form of the matrix
:
This will be only one of the possible solutions. Other estimates may be obtained by applying constraints to the parameters. These solutions can be obtained by calling
G02DKF after calling G02DDF. Only certain linear combinations of the parameters will have unique estimates; these are known as estimable functions. These can be estimated using
G02DNF.
The residual sum of squares required to calculate the standard errors and the variance-covariance matrix can either be input or can be calculated if additional information on for the whole sample is provided.
Hammarling S (1985) The singular value decomposition in multivariate statistics SIGNUM Newsl. 20(3) 2–25
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
None.
A dataset consisting of
observations and four independent variables is input and a regression model fitted by calls to
G02DEF. The parameters are then calculated by G02DDF and the results printed.