Regress.RegressTest Method

Overload List

#SignatureDescription
1procedure 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.
2procedure RegressTest(const Y: TVec; const YCalc: TVec; NumPars: Integer; out RegStat: TRegStats; Constant: Boolean; const Weights: TVec);Regression tests.

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.

#NameDescription
1YDependant variables.
2YCalcEstimated (calculated) dependant variables.
3ATAInverse matrix of normal equations i.e [A(T)*A]^-1.
4WeightsModel weights (optional).
5ConstantIf true then include intercept term b(0) in calculations. If false, set intercept term b(0) to 0.0.
6RegStatReturns regression statistics parameters.
7ResidualsReturns residual errors.
8BStdDevReturns 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.

#NameDescription
1YDependant variables.
2YCalcEstimated (calculated) dependant variables.
3WeightsModel weights (optional).
4NumParsNumber of variables (parameters) in ML model A*b=y (number of columns in A matrix or number of rows in b).
5ConstantIf true then include intercept term b(0) in calculations. If false, set intercept term b(0) to 0.0.
6RegStatReturns 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