Chapter Contents Previous Next
 Language Reference

## INVUPDT Function

INVUPDT( matrix, vector<, scalar>)

The inputs to the INVUPDT function are as follows:
matrix
is an n ×n positive definite matrix.

vector
is an n ×1 or 1 ×n vector.

scalar
is a numeric scalar.
The INVUPDT function updates a matrix inverse. For example, let
```   r=invupdt(a,x,w);
```
where R is an n ×w matrix; A is an n ×n positive definite matrix; X is an n ×1 or 1 ×n vector; and w is an optional scalar (if not specified, w has default value 1).

The INVUPDT function computes the matrix expression
R = A - wAX (1 + w X'AX)-1 X'A-1X'A
or, in matrix language,
```   r=a-w*a*x*inv(1+w*x`*a*x)*x`*a;
```
The INVUPDT function is used primarily to update a matrix inverse because the function has the property
INVUPDT(B-1,X,w) = (B + wXX')-1   .
If Z is a design matrix and X is a new observation to be used in estimating the parameters of a linear model, then the inverse crossproducts matrix that includes the new observation can be updated from the old inverse by
```   c2=invupdt(c,x);
```
where C = INV(Z'Z). Note that
```   c2=inv((z//x)`*(z//x));
```
If w is 1, the function adds an observation to the inverse; if w is -1, the function removes an observation from the inverse. If weighting is used, w is the weight.

To perform the computation, the INVUPDT function uses about 2n2 multiplications and additions, where n is the row dimension of the positive definite argument matrix.

 Chapter Contents Previous Next Top