drasys.or.stat.model
Class StepwiseLinear

java.lang.Object
  |
  +--drasys.or.stat.model.LinearRegression
        |
        +--drasys.or.stat.model.StepwiseLinear

public class StepwiseLinear
extends LinearRegression
implements LinearRegressionI

A stepwise multiple linear regression model. This algorithm starts by selecting all of the required variables. A non-selected variable is a candidate for entry if it is in the set 'enteringVariables' and if its p-value after addition is less than 'enterPValue'. The algorithm adds the entering candidate with the lowest potential p-value. A selected varable is a candidate for removal if its p-value exceeds 'exitPValue' and it isn't a required variable. The algorithm removes the candidate with the highest p-value and solves the model with the new set of variables. After adding each entering variable the algorithm continues removing candidates until all p-values are below 'exitPValue'. Then it adds the next entering variable and continues until there are no more entering candidates.

References:

Applied Linear Statistical Models (Irwin Series in Statistics)
    Michael H. Kutner, et al / Hardcover / Published 1996
Numerical Recipes in C : The Art of Scientific Computing
    William H. Press, et al / Hardcover / Published 1993


Fields inherited from class drasys.or.stat.model.LinearRegression
_cfstat, _coef, _cov, _dependent, _enteringVariables, _enterPValue, _exitPValue, _glm, _independent, _lastConfidenceLevel, _lower, _m, _n, _requiredVariables, _selectedVariables, _stdv, _tpvalue, _tstat, _upper, _zeroIntercept
 
Constructor Summary
StepwiseLinear(GeneralLinearModelI glm)
          Initialize the regression with an explicit general linear model.
StepwiseLinear(VectorI dependent, MatrixI independent)
          Initialize the regression with the sample data.
 
Method Summary
 int solve()
          Solve for the significant variables and coefficients.
 java.lang.String toString()
          Creates a string representation of this object.
 
Methods inherited from class drasys.or.stat.model.LinearRegression
allVariables, getCoefficients, getEnteringThreshold, getEnteringVariables, getExitingThreshold, getF, getFPV, getGLM, getLowerBounds, getRequiredVariables, getSelectedVariables, getT, getTPV, getTStatistic, getUpperBounds, setEnteringThreshold, setEnteringVariables, setExitingThreshold, setRequiredVarables, setSelectedVariables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StepwiseLinear

public StepwiseLinear(VectorI dependent,
                      MatrixI independent)
Initialize the regression with the sample data. The model will use 'GeneralLinearModel' for the underlying GLM algorithm.

StepwiseLinear

public StepwiseLinear(GeneralLinearModelI glm)
Initialize the regression with an explicit general linear model. The GLM should be initialized with the sample data.
Method Detail

solve

public int solve()
Solve for the significant variables and coefficients. Returns the number of independent variables selected in the final model. This algorithm uses 'setSelectedVariables' to solve the model and will leave the final solution variables selected. The solution can be retrieved with 'getSelectedVariables' and the column indices will be in ascending order.
Specified by:
solve in interface LinearRegressionI

toString

public java.lang.String toString()
Creates a string representation of this object. The string is composed of 'super.toString()' followed by the details of the iterations used to solve the regression.
Overrides:
toString in class LinearRegression


Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com