g02dgf
g02dgf
© Numerical Algorithms Group, 2002.
Purpose
G02DGF Fits a general linear regression model for new dependent variable
Synopsis
[rss,cov,q,b,se,res,ifail] = g02dgf(rss,irank,cov,q,svd,p,y,wk<,wt,weight,...
ifail>)
Description
G02DGF uses the results given by G02DAF to fit the same set of
independent variables to a new dependent variable.
G02DAF computes a QR decomposition of the matrix of p independent
variables and also, if the model is not of full rank, a singular
value decomposition (SVD). These results can be used to compute
estimates of the parameters for a general linear model with a new
dependent variable. The QR decomposition leads to the formation
of an upper triangular p by p matrix R and an n by n orthogonal
T T 1/2
matrix Q. In addition the vector c=Q y (or Q W y) is computed.
For a new dependent variable, y , G02DGF computes a new value
new
T T 1/2
of c=Q y or Q W y .
new new
If R is of full rank, then the least-squares parameter estimates,
^^^^^^ ^^^^^^
(beta), are the solution to: R(beta)=c , where c is the first p
1 1
elements of c.
If R is not of full rank, then G02DAF will have computed a SVD of
R,
(D 0) T
R=Q (0 0)P ,
*
where D is a k by k diagonal matrix with non-zero diagonal
elements, k being the rank of R and Q and P are p by p
*
orthogonal matrices. This gives the solution
^^^^^^ -1 T
(beta)=P D Q c
1 * 1
1
P being the first k columns of P, i.e., P=(P P ) and Q being
1 1 0 *
1
the first k columns of Q . Details of the SVD, are made available
*
*
by G02DAF in the form of the matrix P :
( -1 T)
(D P )
( 1)
* ( T )
P =( P ).
( 0 )
The matrix Q is made available through the workspace of G02DAF.
*
In addition to parameter estimates, the new residuals are
computed and the variance-covariance matrix of the parameter
estimates are found by scaling the variance-covariance matrix for
the original regression.
Parameters
g02dgf
Required Input Arguments:
rss real
irank integer
cov (:) real
q (:,:) real
svd logical
p (:) real
y (:) real
wk (:) real
Optional Input Arguments: <Default>
wt (:) real zeros(size(q,1),1)
weight (1) string g02dgf01(wt)
ifail integer -1
Output Arguments:
rss real
cov (:) real
q (:,:) real
b (:) real
se (:) real
res (:) real
ifail integer