|
NAG[g02ddc] NAG[nag_regsn_mult_linear_upd_model] - Estimates of regression parameters from an updated model
|
|
Calling Sequence
g02ddc(q, rss, df, b, se, cov, svd, rank, p, 'n'=n, 'ip'=ip, 'tdq'=tdq, 'tol'=tol, 'fail'=fail)
nag_regsn_mult_linear_upd_model(. . .)
Parameters
|
q - Matrix(1..n, 1..tdq, datatype=float[8], order=C_order);
|
|
|
|
rss - assignable;
|
|
|
Note: On exit the variable rss will have a value of type float.
|
|
On entry: either the residual sum of squares or a value less than or equal to 0.0 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 nag_regsn_mult_linear_upd_model (g02ddc).
|
|
If rss was positive on entry, then it will be unchanged.
|
|
|
df - assignable;
|
|
|
Note: On exit the variable df will have a value of type float.
|
|
On exit: the degrees of freedom associated with the residual sum of squares.
|
|
|
b - Vector(1..ip, datatype=float[8]);
|
|
|
On exit: the estimates of the arguments, .
|
|
|
se - Vector(1..ip, datatype=float[8]);
|
|
|
On exit: the standard errors of the arguments given in b.
|
|
|
cov - Vector(1.., datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array cov must be at least .
|
|
|
svd - assignable;
|
|
|
Note: On exit the variable svd will have a value of type boolean.
|
|
On exit: if a singular value decomposition has been performed, then , otherwise .
|
|
|
rank - assignable;
|
|
|
Note: On exit the variable rank will have a value of type integer.
|
|
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.
|
|
|
p - Vector(1.., datatype=float[8]);
|
|
|
Note: the dimension, dim, of the array p must be at least .
|
|
On exit: p contains details of the singular value decomposition if used.
|
|
If , p is not referenced.
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the first dimension of the array q.
|
|
On entry: number of observations.
|
|
Constraint: . .
|
|
|
'ip'=ip - integer; (optional)
|
|
|
Default value: the first dimension of the arrays b, se and the second dimension of the arrays b, sethe array q.
|
|
On entry: the number of terms in the regression model, .
|
|
Constraint: . .
|
|
|
'tdq'=tdq - integer; (optional)
|
|
|
On entry: the second dimension of the array q as declared in the function from which nag_regsn_mult_linear_upd_model (g02ddc) is called.
|
|
Constraint: . .
|
|
|
'tol'=tol - float; (optional)
|
|
|
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: (default: ) .
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Description
|
|
A general linear regression model fitted by g02dac (nag_regsn_mult_linear) may be adjusted by adding or deleting an observation using g02dcc (nag_regsn_mult_linear_addrem_obs), adding a new independent variable using g02dec (nag_regsn_mult_linear_add_var) or deleting an existing independent variable using g02dfc (nag_regsn_mult_linear_delete_var). These functions compute the vector and the upper triangular matrix . nag_regsn_mult_linear_upd_model (g02ddc) takes these basic results and computes the regression coefficients, , their standard errors and their variance-covariance matrix.
If is of full rank, then is the solution to:
where is the first elements of .
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 non-zero 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 (nag_regsn_mult_linear_tran_model) after calling nag_regsn_mult_linear_upd_model (g02ddc). Only certain linear combinations of the arguments will have unique estimates, these are known as estimable functions. These can be estimated using g02dnc (nag_regsn_mult_linear_est_func).
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.
|
|
Error Indicators and Warnings
|
|
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_DOF_LE_ZERO"
The degrees of freedom for error are less than or equal to 0. In this case the estimates, , are returned but not the standard errors or covariances.
"NE_INT_ARG_LT"
On entry, n must not be less than 1: .
"NE_REAL_ARG_LT"
On entry, tol must not be less than 0.0: .
"NE_SVD_NOT_CONV"
The singular value decomposition has failed to converge. See f02wec (nag_real_svd). This is an unlikely error exit.
|
|
Accuracy
|
|
The accuracy of the results will depend on the accuracy of the input matrix, which may lose accuracy if a large number of observations or variables have been dropped.
|
|
|
Examples
|
|
>
|
n := 12:
ip := 4:
tdq := 5:
rss := 0:
tol := 1e-06:
q := Matrix([[-62.35960257517148, -1.732050807568877, 0, 0, 0], [64.60549512231913, 0, 1.732050807568877, 0, 0], [72.05908709755718, 0, -0.5773502691896257, 1.732050807568877, 0], [-65.60431108801718, 0, -0, -0.5773502691896257, -1.732050807568877], [-0.3146182873523433, 0, -0, -0, 0.5287121214812434], [-0.7278845221914569, 0, -0.5773502691896257, -0, 0.305252085661014], [-2.344618287352345, 0, -0, -0, 0.5287121214812434], [1.44536695831506, 0.4597008433809831, -0, -0, 0], [2.253195474436097, 0, -0, -0.5773502691896257, 0.1762373738270811], [2.665366958315059, 0.4597008433809831, -0, -0, 0], [-0.2368045255639049, 0, -0, -0.5773502691896257, 0.1762373738270811], [1.332115477808545, 0, -0.5773502691896257, -0, 0.305252085661014]], datatype=float[8], order='C_order'):
b := Vector(4, datatype=float[8]):
se := Vector(4, datatype=float[8]):
cov := Vector(10, datatype=float[8]):
p := Vector(24, datatype=float[8]):
NAG:-g02ddc(q, rss, df, b, se, cov, svd, rank, p, 'n' = n, 'ip' = ip, 'tdq' = tdq, 'tol' = tol):
|
|
|
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.
|
|