drasys.or.stat.model
Class QuadraticMatrix
java.lang.Object
|
+--drasys.or.matrix.RealContainer
|
+--drasys.or.matrix.Matrix
|
+--drasys.or.matrix.FunctionMatrix
|
+--drasys.or.stat.model.QuadraticMatrix
- public class QuadraticMatrix
- extends FunctionMatrix
Adds virtual columns to a matrix for quadratic modeling.
The new array contains the original columns followed by all pair-wise product terms.
The method 'getProductIndex' can be used to find the index of the product terms from the original column indices.
If the original matrix has 'n' columns then the quadratic matrix will have 'n+n^2' columns and be defined as:
Q[i][0,...,n-1] = M[i][0,...,n-1] (Original variables)
Q[i][n + j*n + k] = M[i][j]*M[i][k] (Products)
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
Constructor Summary |
QuadraticMatrix(MatrixI matrix)
Add columns to matrix to create a new matrix containing the original variables plus the quadratic variables. |
Method Summary |
double |
functionElementAt(int row,
int column)
Computes the values for the additional columns. |
int |
getProductIndex(int column1,
int column2)
Return the index of the column in the quadratic matrix for the product term for column-1 and column-2. |
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 java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
QuadraticMatrix
public QuadraticMatrix(MatrixI matrix)
- Add columns to matrix to create a new matrix containing the original variables plus the quadratic variables.
getProductIndex
public int getProductIndex(int column1,
int column2)
- Return the index of the column in the quadratic matrix for the product term for column-1 and column-2.
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