Overload List
Overload 1: procedure RegressTest(const Y: TVec; const YCalc: TVec; const ATA: TMtx; out RegStat: TRegStats; const Residuals: TVec; const BStdDev: TVec; Constant: Boolean; const Weights: TVec);
Regression tests.
| # | Name | Description |
|---|---|---|
| 1 | Y | Dependant variables. |
| 2 | YCalc | Estimated (calculated) dependant variables. |
| 3 | ATA | Inverse matrix of normal equations i.e [A(T)*A]^-1. |
| 4 | Weights | Model weights (optional). |
| 5 | Constant | If true then include intercept term b(0) in calculations. If false, set intercept term b(0) to 0.0. |
| 6 | RegStat | Returns regression statistics parameters. |
| 7 | Residuals | Returns residual errors. |
| 8 | BStdDev | Returns standard deviation. |
Result: stored in self (calling object)
Remarks:
Using regression results the routine calculates additional regression statistical parameters, together with model coefficients standard errors and model errors.
See Also: Regress.R2, Regress.PRESS
Overload 2: procedure RegressTest(const Y: TVec; const YCalc: TVec; NumPars: Integer; out RegStat: TRegStats; Constant: Boolean; const Weights: TVec);
Regression tests.
| # | Name | Description |
|---|---|---|
| 1 | Y | Dependant variables. |
| 2 | YCalc | Estimated (calculated) dependant variables. |
| 3 | Weights | Model weights (optional). |
| 4 | NumPars | Number of variables (parameters) in ML model A*b=y (number of columns in A matrix or number of rows in b). |
| 5 | Constant | If true then include intercept term b(0) in calculations. If false, set intercept term b(0) to 0.0. |
| 6 | RegStat | Returns regression statistics parameters. |
Result: stored in self (calling object)
Remarks:
Use regression results to calculate basic regression statistics for model:
A*b=Y
Examples
Uses Regress, MtxExpr;
procedure Example;
var y,b,w,yhat, resid, bstd: Vector;
A, ATA : Matrix;
RegStat : TRegStats;
begin
A.SetIt(4,2,false,[1.0, 2.0,
-3.2, 2.5,
8.0, -0.5,
-2.2, 1.8]); // independent variables
w.SetIt(false,[1,2,2,1]); // weights
y.SetIt(false,[-3.0, 0.25, 8.0, 5.5]); // dependent variables
MulLinRegress(y,A,b,w,true,yhat,ATA); //do regression
// b=(19.093757944, -2.0141843616, -10.082487055)
RegressTest(y,yhat,ATA,RegStat,resid, bstd, true,w); // do basic regression stats
// RegStat = (ResidualVar:0.037230395108; R2:0.99965713428;
// AdjustedR2:0.99897140285; F:1457.7968725; SignifProb: 0.01851663347)
end;
See Also: Regress.R2, Regress.PRESS