G02GKF calculates the estimates of the parameters of a generalized linear model for given constraints from the singular value decomposition results.
SUBROUTINE G02GKF ( |
IP, ICONST, V, LDV, C, LDC, B, S, SE, COV, WK, IFAIL) |
INTEGER |
IP, ICONST, LDV, LDC, IFAIL |
REAL (KIND=nag_wp) |
V(LDV,IP+7), C(LDC,ICONST), B(IP), S, SE(IP), COV(IP*(IP+1)/2), WK(2*IP*IP+IP*ICONST+2*ICONST*ICONST+4*ICONST) |
|
G02GKF computes the estimates given a set of linear constraints for a generalized linear model which is not of full rank. It is intended for use after a call to
G02GAF,
G02GBF,
G02GCF or
G02GDF.
In the case of a model not of full rank the routines use a singular value decomposition to find the parameter estimates,
, and their variance-covariance matrix. Details of the SVD are made available in the form of the matrix
:
as described by
G02GAF,
G02GBF,
G02GCF and
G02GDF. Alternative solutions can be formed by imposing constraints on the parameters. If there are
parameters and the rank of the model is
then
constraints will have to be imposed to obtain a unique solution.
Let
be a
by
matrix of constraints, such that
then the new parameter estimates
are given by:
and the variance-covariance matrix is given by
provided
exists.
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
It should be noted that due to rounding errors a parameter that should be zero when the constraints have been imposed may be returned as a value of order machine precision.
A loglinear model is fitted to a
by
contingency table by
G02GCF. The model consists of terms for rows and columns. The table is
The constraints that the sum of row effects and the sum of column effects are zero are then read in and the parameter estimates with these constraints imposed are computed by G02GKF and printed.