g02ddc calculates the regression arguments for a general linear regression model. It is intended to be called after
g02dcc,
g02dec or
g02dfc.
A general linear regression model fitted by
g02dac may be adjusted by adding or deleting an observation using
g02dcc, adding a new independent variable using
g02dec or deleting an existing independent variable using
g02dfc. These functions compute the vector
and the upper triangular matrix
.
g02ddc 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 arguments. These solutions can be obtained by calling
g02dkc after calling
g02ddc. Only certain linear combinations of the arguments will have unique estimates, these are known as estimable functions. These can be estimated using
g02dnc.
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
-
1:
– Integer
Input
-
On entry: number of observations.
Constraint:
.
-
2:
– Integer
Input
-
On entry: the number of terms in the regression model, .
Constraint:
.
-
3:
– const double
Input
-
Note: the th element of the matrix is stored in .
On entry:
q must be the array
q as output by
g02dcc,
g02dec or
g02dfc. If on entry
then all
n elements of
are needed. This is provided by functions
g02dec or
g02dfc.
-
4:
– Integer
Input
-
On entry: the stride separating matrix column elements in the array
q.
Constraint:
.
-
On entry: either the residual sum of squares or a value less than or equal to to indicate that the residual sum of squares is to be calculated by the function.
On exit: if
on entry, then on exit
rss will contain the residual sum of squares as calculated by
g02ddc.
If
rss was positive on entry, then it will be unchanged.
-
6:
– double *
Output
-
On exit: the degrees of freedom associated with the residual sum of squares.
-
7:
– double
Output
-
On exit: the estimates of the arguments, .
-
8:
– double
Output
-
On exit: the standard errors of the
arguments given in
b.
-
9:
– double
Output
-
On exit: the upper triangular part of the variance-covariance matrix of the
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
.
-
10:
– Nag_Boolean *
Output
-
On exit: if a singular value decomposition has been performed, then , otherwise .
-
11:
– Integer *
Output
-
On exit: the rank of the independent variables.
If , .
If
,
rank is an estimate of the rank of the independent variables.
rank is calculated as the number of singular values greater than
(largest singular value). It is possible for the singular value decomposition to be carried out but
rank to be returned as
ip.
-
12:
– double
Output
-
On exit:
p contains details of the singular value decomposition if used.
If
,
p is not referenced.
If
, the first
ip elements of
p will not be referenced, the next
ip values contain the singular values. The following
values contain the matrix
stored by rows.
-
13:
– double
Input
-
On entry: the value of
tol is used to decide if the independent variables are of full rank and, if not, what is the rank of the independent variables. The smaller the value of
tol the stricter the criterion for selecting the singular value decomposition. If
, then the singular value decomposition will never be used, this may cause run time errors or inaccuracies if the independent variables are not of full rank.
Suggested value:
.
Constraint:
.
-
14:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
None.
A dataset consisting of 12 observations and four independent variables is input and a regression model fitted by calls to
g02dec. The arguments are then calculated by
g02ddc and the results printed.