drasys.or.stat.model
Class PolynomialMatrix

java.lang.Object
  |
  +--drasys.or.matrix.RealContainer
        |
        +--drasys.or.matrix.Matrix
              |
              +--drasys.or.matrix.FunctionMatrix
                    |
                    +--drasys.or.stat.model.PolynomialMatrix

public class PolynomialMatrix
extends FunctionMatrix

Adds virtual columns to a matrix for polynomial modeling. The new array contains the original columns followed by the degree-2 terms, etc. The method 'getTermIndex' can be used to find the index of the degreed terms from the original column index and the degree. If the original matrix has 'n' columns and the polynomial degree is 'd' then the polynomial matrix will have 'n*d' columns and be defined as:

Q[i][ 0,..., n-1] = M[i][0,...,n-1] (Original variables)
Q[i][ n,...,2n-1] = M[i][0,...,n-1]^2 (Degree-2 terms)
Q[i][2n,...,3n-1] = M[i][0,...,n-1]^3 (Degree-3 terms)

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

See Also:
Serialized Form

Fields inherited from class drasys.or.matrix.FunctionMatrix
_sizeOfColumns, _sizeOfRows
 
Fields inherited from class drasys.or.matrix.RealContainer
_epsilon, _globalEpsilon
 
Constructor Summary
PolynomialMatrix(MatrixI matrix, int degree)
          Add columns to matrix to create a quadratic design matrix.
 
Method Summary
 double functionElementAt(int row, int column)
          Computes the values for the additional columns.
 int getTermIndex(int column, int degree)
          Returns the column index in the polynomial matrix of a term given its degree and original column index in the underlying matrix.
 
Methods inherited from class drasys.or.matrix.FunctionMatrix
elementAt, isColumnMajor, isNull, isRowMajor, setElementAt, setElements, sizeOfColumns, sizeOfElements, sizeOfRows
 
Methods inherited from class drasys.or.matrix.Matrix
columnElements, elements, equals, equals, getArray, rowElements, setColumn, setDiagonal, setElements, setRow, sum, sum, sum, sumOfSquaredDifferences, sumOfSquaredDifferences, sumOfSquaredDifferences, sumOfSquares, sumOfSquares, sumOfSquares, toString
 
Methods inherited from class drasys.or.matrix.RealContainer
equals, getEpsilon, getGlobalEpsilon, setEpsilon, setGlobalEpsilon
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PolynomialMatrix

public PolynomialMatrix(MatrixI matrix,
                        int degree)
Add columns to matrix to create a quadratic design matrix.
Method Detail

getTermIndex

public int getTermIndex(int column,
                        int degree)
Returns the column index in the polynomial matrix of a term given its degree and original column index in the underlying matrix.

functionElementAt

public double functionElementAt(int row,
                                int column)
Computes the values for the additional columns.
Overrides:
functionElementAt in class FunctionMatrix


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