Syntax
C# |
---|
public static void g02dd( int n, int ip, double[,] q, ref double rss, out int idf, double[] b, double[] se, double[] cov, out bool svd, out int irank, double[] p, double tol, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g02dd ( _ n As Integer, _ ip As Integer, _ q As Double(,), _ ByRef rss As Double, _ <OutAttribute> ByRef idf As Integer, _ b As Double(), _ se As Double(), _ cov As Double(), _ <OutAttribute> ByRef svd As Boolean, _ <OutAttribute> ByRef irank As Integer, _ p As Double(), _ tol As Double, _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g02dd( int n, int ip, array<double,2>^ q, double% rss, [OutAttribute] int% idf, array<double>^ b, array<double>^ se, array<double>^ cov, [OutAttribute] bool% svd, [OutAttribute] int% irank, array<double>^ p, double tol, [OutAttribute] int% ifail ) |
F# |
---|
static member g02dd : n : int * ip : int * q : float[,] * rss : float byref * idf : int byref * b : float[] * se : float[] * cov : float[] * svd : bool byref * irank : int byref * p : float[] * tol : float * ifail : int byref -> unit |
Parameters
- n
- Type: System..::..Int32On entry: the number of observations.Constraint: .
- ip
- Type: System..::..Int32On entry: , the number of terms in the regression model.Constraint: .
- q
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, ]Note: dim1 must satisfy the constraint:
- if , ;
- otherwise .
- rss
- Type: System..::..Double%On entry: either the residual sum of squares or a value less than or equal to to indicate that the residual sum of squares is to be calculated by the method.
- idf
- Type: System..::..Int32%On exit: the degrees of freedom associated with the residual sum of squares.
- b
- Type: array<System..::..Double>[]()[][]An array of size [ip]On exit: the estimates of the parameters, .
- se
- Type: array<System..::..Double>[]()[][]An array of size [ip]On exit: the standard errors of the parameters given in b.
- cov
- Type: array<System..::..Double>[]()[][]An array of size []On exit: the upper triangular part of the variance-covariance matrix of the 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 .
- svd
- Type: System..::..Boolean%On exit: if a singular value decomposition has been performed, , otherwise .
- irank
- Type: System..::..Int32%
- p
- Type: array<System..::..Double>[]()[][]An array of size []
- tol
- Type: System..::..DoubleOn 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 , 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: .Constraint: .
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
A general linear regression model fitted by g02da may be adjusted by adding or deleting an observation using g02dc, adding a new independent variable using g02de or deleting an existing independent variable using g02df. Alternatively a model may be constructed by a forward selection procedure using (G02EEF not in this release). These methods compute the vector and the upper triangular matrix . g02dd 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 nonzero 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 parameters. These solutions can be obtained by calling g02dk after calling g02dd. Only certain linear combinations of the parameters will have unique estimates; these are known as estimable functions. These can be estimated using g02dn.
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.
References
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
Error Indicators and Warnings
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface
(LDQ) In these
cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry, , or , or .
- The degrees of freedom for error are less than or equal to . In this case the estimates of are returned but not the standard errors or covariances.
- The singular value decomposition, if used, has failed to converge, see (F02WUF not in this release). 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.
Parallelism and Performance
None.
Further Comments
None.