|
NAG[g02dnc] NAG[nag_regsn_mult_linear_est_func] - Estimate of an estimable function for a general linear regression model
|
|
Calling Sequence
g02dnc(rank, b, cov, p, f, est, stat, sestat, t, tol, 'ip'=ip, 'fail'=fail)
nag_regsn_mult_linear_est_func(. . .)
Parameters
|
rank - integer;
|
|
|
On entry: the rank of the independent variables, .
|
|
Constraint: . .
|
|
|
b - Vector(1..ip, datatype=float[8]);
|
|
|
On entry: the ip values of the estimates of the arguments of the model, .
|
|
|
cov - Vector(1.., datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array cov must be at least .
|
|
|
p - Vector(1.., datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array p must be at least .
|
|
|
f - Vector(1..ip, datatype=float[8]);
|
|
|
On entry: the linear function to be estimated, .
|
|
|
est - assignable;
|
|
|
Note: On exit the variable est will have a value of type boolean.
|
|
On exit: est indicates if the function was estimable.
|
|
The function is estimable.
|
|
The function is not estimable and stat, sestat and t are not set.
|
|
|
stat - assignable;
|
|
|
Note: On exit the variable stat will have a value of type float.
|
|
On exit: if , stat contains the estimate of the function, .
|
|
|
sestat - assignable;
|
|
|
Note: On exit the variable sestat will have a value of type float.
|
|
On exit: if , sestat contains the standard error of the estimate of the function, .
|
|
|
t - assignable;
|
|
|
Note: On exit the variable t will have a value of type float.
|
|
On exit: if , t contains the -statistic for the test of the function being equal to zero.
|
|
|
'ip'=ip - integer; (optional)
|
|
|
Default value: the first dimension of the arrays b, f.
|
|
On entry: the number of terms in the linear model, .
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_regsn_mult_linear_est_func (g02dnc) gives the estimate of an estimable function along with its standard error.
|
|
Description
|
|
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 g02dac (nag_regsn_mult_linear) or g02ddc (nag_regsn_mult_linear_upd_model). 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 argument estimates, , and their variance-covariance matrix. Given the upper triangular matrix obtained from the decomposition of the independent variables the SVD gives:
where is a by diagonal matrix with non-zero diagonal elements, being the rank of , and and are by orthogonal matrices. This leads to a solution:
being the first columns of , i.e., , being the first columns of and being the first elements of .
Details of the SVD are made available, in the form of the matrix :
as given by g02dac (nag_regsn_mult_linear) and g02ddc (nag_regsn_mult_linear_upd_model).
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 .
Given that is estimable it can be estimated by and its standard error calculated from the variance-covariance matrix of , , as
Also a -statistic:
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.
|
|
Error Indicators and Warnings
|
|
"NE_2_INT_ARG_GT"
On entry, while . These arguments must satisfy .
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_INT_ARG_LT"
On entry, ip must not be less than 1: .
"NE_RANK_EQ_IP"
On entry, . In this case, the boolean variable est is returned as true and all statistics are calculated.
"NE_STDES_ZERO"
se probably due to rounding error or due to incorrectly specified inputs cov and f.
|
|
Accuracy
|
|
The computations are believed to be stable.
|
|
Further Comments
|
|
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 g02dkc (nag_regsn_mult_linear_tran_model), , these must be expressed in terms of the original arguments, . The relation between the two sets of arguments may not be straightforward.
|
|
|
Examples
|
|
>
|
ip := 5:
rank := 4:
tol := 1e-05:
b := Vector([30.55666666666667, 5.446666666666667, 6.743333333333339, 11.04666666666667, 7.320000000000003], datatype=float[8]):
cov := Vector([0.1481786666666665, 0.03704466666666668, 0.703848666666666, 0.0370446666666667, -0.222268, 0.7038486666666662, 0.03704466666666655, -0.2222679999999998, -0.2222679999999997, 0.7038486666666665, 0.03704466666666659, -0.2222679999999998, -0.2222679999999999, -0.2222680000000002, 0.7038486666666667], datatype=float[8]):
p := Vector([1.135198279858991, 1.13078348304906, 1.234006904805161, 1.228003039942231, 1.148419798367432, 3.872983346207417, 1.732050807568878, 1.732050807568877, 1.732050807568877, 3.166264259090703e-16, 0.2309401076758502, 0.05773502691896256, 0.05773502691896257, 0.0577350269189626, 0.05773502691896259, -8.986850838355147e-17, -0.2180297316413536, -0.3448196554213736, 0.3466016006011757, 0.2162477864615517, 3.472144456476812e-18, 0.4492089773025322, -0.3565253366776346, -0.03799964639604183, -0.05468399422885582, 4.280983223691876e-18, -0.02596788076090121, -0.06315923956148034, -0.3583620478433494, 0.4474891681657309, -0.447213595499958, 0.4472135954999579, 0.447213595499958, 0.4472135954999578, 0.4472135954999579], datatype=float[8]):
f := Vector([1, 1, 0, 0, 0], datatype=float[8]):
NAG:-g02dnc(rank, b, cov, p, f, est, stat, sestat, t, tol, 'ip' = ip):
|
|
|
See Also
|
|
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
g02 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|