Syntax
C# |
---|
public static void g02dc( string update, string mean, string weight, int m, int[] isx, double[,] q, int ip, double[] x, int ix, double y, double wt, ref double rss, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g02dc ( _ update As String, _ mean As String, _ weight As String, _ m As Integer, _ isx As Integer(), _ q As Double(,), _ ip As Integer, _ x As Double(), _ ix As Integer, _ y As Double, _ wt As Double, _ ByRef rss As Double, _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g02dc( String^ update, String^ mean, String^ weight, int m, array<int>^ isx, array<double,2>^ q, int ip, array<double>^ x, int ix, double y, double wt, double% rss, [OutAttribute] int% ifail ) |
F# |
---|
static member g02dc : update : string * mean : string * weight : string * m : int * isx : int[] * q : float[,] * ip : int * x : float[] * ix : int * y : float * wt : float * rss : float byref * ifail : int byref -> unit |
Parameters
- update
- Type: System..::..StringOn entry: indicates if an observation is to be added or deleted.
- The observation is added.
- The observation is deleted.
Constraint: or .
- mean
- Type: System..::..StringOn entry: indicates if a mean has been used in the model.Constraint: or .
- weight
- Type: System..::..StringOn entry: indicates if a weight is to be used.
- The new observation is unweighted.
- The new observation is to be weighted and the weight must be supplied in wt.
Constraint: or .
- m
- Type: System..::..Int32On entry: , the total number of independent variables in the dataset.Constraint: .
- isx
- Type: array<System..::..Int32>[]()[][]An array of size [m]On entry: if is greater than , the value contained in is to be included as a value of , for .
- q
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, ]Note: dim1 must satisfy the constraint:
- ip
- Type: System..::..Int32On entry: the number of linear terms in general linear regression model (including mean if there is one).Constraint: .
- x
- Type: array<System..::..Double>[]()[][]An array of size [dim1]Note: the dimension of the array x must be at least .
- ix
- Type: System..::..Int32On entry: the increment for elements of x.Constraint: .
- y
- Type: System..::..DoubleOn entry: the value of the dependent variable for the new observation, .
- wt
- Type: System..::..DoubleOn entry: if , wt must contain the weight to be used with the new observation.If , the observation is not included in the model.If , wt is not referenced.Constraint: if , .
- rss
- Type: System..::..Double%On entry: the value of the residual sums of squares for the original set of observations.Constraint: .On exit: the updated values of the residual sums of squares.Note: this will only be valid if the model is of full rank.
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
g02da fits a general linear regression model to a dataset. You may wish to change the model by either adding or deleting an observation from the dataset. g02dc takes the results from g02da and makes the required changes to the vector and the upper triangular matrix produced by g02da. The regression coefficients, standard errors and the variance-covariance matrix of the regression coefficients can be obtained from g02dd after all required changes to the dataset have been made.
g02da performs a decomposition on the (weighted) matrix of independent variables. To add a new observation to a model with parameters, the upper triangular matrix and vector (the first elements of ) are augmented by the new observation on independent variables in and dependent variable . Givens rotations are then used to restore the upper triangular form.
Note: only and the upper part of are updated the remainder of the matrix is unchanged.
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
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 , or , or or , or or , or or , or and there are not exactly nonzero values of isx, or and there are not exactly ip nonzero values of isx,
On entry, and .
- The matrix could not be updated. This may occur if an attempt is made to delete an observation which was not in the original dataset or to add an observation to a matrix with a zero diagonal element. This error is also possible when removing an observation which reduces the rank of design matrix. In such cases the model should be recomputed using g02da.
- The residual sums of squares cannot be updated. This will occur if the input residual sum of squares is less than the calculated decrease in residual sum of squares when the new observation is deleted.
Accuracy
Higher accuracy is achieved by updating the matrix rather than the traditional methods of updating .
Parallelism and Performance
None.
Further Comments
Care should be taken with the use of g02dc.
g02dc may also be used after g02de g02df (G02EEF not in this release).
(a) | It is possible to delete observations which were not included in the original model. |
(b) | If several additions/deletions have been performed you are advised to recompute the regression using g02da. |
(c) | Adding or deleting observations can alter the rank of the model. Such changes will only be detected when a call to g02dd has been made. g02dd should also be used to compute the new residual sum of squares when the model is not of full rank. |