Class GLMModelSelection

  • Direct Known Subclasses:
    BackwardElimination, ForwardSelection

    public abstract class GLMModelSelection
    extends Object
    Given a set of observations {y, X}, we would like to construct a GLM to explain the data. One way to do it is to examine each factor (a column in X) one by one, and include in the model the significant ones, i.e., those with z-value bigger than some critical value.
    • Constructor Detail

      • GLMModelSelection

        protected GLMModelSelection​(GLMProblem problem)
        Constructs automatically a GLM model to explain the observations.
        Parameters:
        problem - a GLM problem
    • Method Detail

      • problem

        public GLMProblem problem()
        Returns the original GLM problem.
        Returns:
        the original GLM problem
      • addFactor

        protected void addFactor​(int factorIndex)
        Adds the indexed factor.
        Parameters:
        factorIndex - index
      • dropFactor

        protected void dropFactor​(int factorIndex)
        Drops the indexed factor.
        Parameters:
        factorIndex - index relative in the current selected factor set
      • getFlags

        public int[] getFlags()
        Gets the factor flags. A positive value indicates that the factor is selected; 0 otherwise.
        Returns:
        factor flags
      • isSelected

        public boolean isSelected​(int factorIndex)
        Checks whether a particular indexed factor is selected in the model.

        The indices count from 1.

        Parameters:
        factorIndex - the factor index
        Returns:
        true if the particular index is selected in the model
      • subA

        protected Matrix subA()
        Constructs a covariates subset.
        Returns:
        the columns corresponding to the selected variables