NAG Library Function Document
nag_regsn_mult_linear_est_func (g02dnc) gives the estimate of an estimable function along with its standard error.
||nag_regsn_mult_linear_est_func (Integer ip,
const double b,
const double cov,
const double p,
const double f,
This function computes the estimates of an estimable function for a general linear regression model which is not of full rank. It is intended for use after a call to nag_regsn_mult_linear (g02dac)
or nag_regsn_mult_linear_upd_model (g02ddc)
. An estimable function is a linear combination of the arguments such that it has a unique estimate. For a full rank model all linear combinations of arguments are estimable.
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. Given the upper triangular matrix
obtained from the
decomposition of the independent variables the SVD gives:
diagonal matrix with nonzero diagonal elements,
being the rank of
orthogonal matrices. This leads to a solution:
being the first
being the first
being the first
Details of the SVD are made available, in the form of the matrix
as given by nag_regsn_mult_linear (g02dac)
and nag_regsn_mult_linear_upd_model (g02ddc)
A linear function of the arguments, , can be tested to see if it is estimable by computing . If is zero, then the function is estimable, if not, the function is not estimable. In practice is tested against some small quantity .
is estimable it can be estimated by
and its standard error calculated from the variance-covariance matrix of
can be computed. The
-statistic will have a Student's
-distribution with degrees of freedom as given by the degrees of freedom for the residual sum of squares for the model.
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
ip – IntegerInput
On entry: the number of terms in the linear model, .
rank – IntegerInput
On entry: the rank of the independent variables, .
b[ip] – const doubleInput
: the ip
values of the estimates of the arguments of the model,
cov – const doubleInput
: 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
p – const doubleInput
f[ip] – const doubleInput
On entry: the linear function to be estimated, .
est – Nag_Boolean *Output
indicates if the function was estimable.
- The function is estimable.
- The function is not estimable and stat, sestat and t are not set.
stat – double *Output
contains the estimate of the function,
sestat – double *Output
contains the standard error of the estimate of the function,
t – double *Output
-statistic for the test of the function being equal to zero.
tol – doubleInput
is the tolerance value used in the check for estimability,
is used instead.
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
On entry, while . These arguments must satisfy .
Dynamic memory allocation failed.
On entry, .
On entry, .
. In this case, the boolean variable est
is returned as Nag_TRUE and all statistics are calculated.
probably due to rounding error or due to incorrectly specified inputs cov
The computations are believed to be stable.
8 Parallelism and Performance
The value of estimable functions is independent of the solution chosen from the many possible solutions. While nag_regsn_mult_linear_est_func (g02dnc) may be used to estimate functions of the arguments of the model as computed by nag_regsn_mult_linear_tran_model (g02dkc)
, these must be expressed in terms of the original arguments,
. The relation between the two sets of arguments may not be straightforward.
Data from an experiment with four treatments and three observations per treatment are read in. A model, with a mean term, is fitted by nag_regsn_mult_linear (g02dac)
. The number of functions to be tested is read in, then the linear functions themselves are read in and tested with nag_regsn_mult_linear_est_func (g02dnc). The results of nag_regsn_mult_linear_est_func (g02dnc) are printed.
10.1 Program Text
Program Text (g02dnce.c)
10.2 Program Data
Program Data (g02dnce.d)
10.3 Program Results
Program Results (g02dnce.r)