Unit
StatTools
Hierarchy
TMtxMulLinReg
Direct subclasses
TMtxStepwiseReg
SS = Sum [y(k) - ycalc(k)]^2 ,
where y(k) and ycalc(k) are respectively the observed and calculated value of the dependent variable for observation k. ycalc(k) is a function of the regression parameters b(0), b(1) ... Here the observed values obey the following equation:
y(k) = b(0) + b(1) * x(1,k) + b(2) * x(2,k) + ...
i.e
y = A * b
Results:
1) RegressResult : regression coefficients (b), regression coefficients confidence intervals (BConfInt) and standard deviation (BStdDev), residuals (Residuals) and calculated dependent variables (YCalc).
2) RegressStatistics : basic regression statistics (R2, Adjusted R2, residuals variance, F statistics, significance probability)
| See Also |
|---|
| StatToolsDialogs |
Uses Statistics, StatTools, MtxVec; procedure Example(MtxMLReg: TMtxMulLinReg); begin // y = A*b MtxMLReg.A.SetIt(3,2,false,[-5,2, 1,4, 8,0.5]); MtxMLReg.Y.SetIt(false,[-2, 1, 11]); MtxMLReg.Weights.SetIt(false,[2,6,1]); MtxMLReg.UseWeights := true; MtxMLReg.Recalc; // Result ==> b = ( 4.586, 0.871, -1.114 ) end;
#include "MtxVec.hpp" #include "Math387.hpp" #include "Statistics.hpp" #include "StatTools.hpp" void __fastcall Example(TMtxMulLinReg* mlr) { // y = A*b mlr->A->SetIt(3,2,false,OPENARRAY(TSample,(-5,2, 1,4, 8,0.5))); mlr->Y->SetIt(false,OPENARRAY(TSample,(-2,1,11))); mlr->Weights->SetIt(false,OPENARRAY(TSample,(2,6,1))); mlr->UseWeights = true; mlr->Recalc(); // Result ==> b = ( 4.586, 0.871, -1.114 ) }
using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples { private void Example(StatTools.TMtxMulLinReg mlr) { // y = A*b mlr.A.SetIt(3,2,false,new double[] {-5,2, 1,4, 8,0.5}); mlr.Y.SetIt(false,new double[] {-2,1,11}); mlr.Weights.SetIt(false, new double[] {2,6,1}); mlr.UseWeights = true; mlr.Recalc(); // Result ==> b = ( 4.586, 0.871, -1.114 ) } }
| Name | Summary |
|---|---|
| A | Matrix of independent variables. |
| Alpha | Desired significant value for the statistical tests. |
| AutoUpdate | |
| Constant | Intercept term. |
| Dirty | |
| RegressResult | Regression results. |
| RegressStatistics | Regression results statistics. |
| SolveMethod | Defines A*x=b solving method. |
| UseWeights | Weighted multiple linear regression. |
| Weights | Weights for MLR. |
| Y | Vector of dependent variables. |
| Name | Summary |
|---|---|
| Loaded | |
| Recalc | Triggers multiple linear regression recalculation. |
| ValidSystem | Checks if system is valid. |
| Copyright 2008 Dew Research |