All Packages Class Hierarchy This Package Previous Next Index WEKA's home
java.lang.Object
|
+----weka.classifiers.functions.pace.Matrix
|
+----weka.classifiers.functions.pace.PaceMatrix
REFERENCES
Wang, Y. (2000). "A new approach to fitting linear models in high dimensional spaces." PhD Thesis. Department of Computer Science, University of Waikato, New Zealand.
Wang, Y. and Witten, I. H. (2002). "Modeling for optimal probability prediction." Proceedings of ICML'2002. Sydney.
public PaceMatrix(int m,
int n)
m - Number of rows.
n - Number of colums.
public PaceMatrix(int m,
int n,
double s)
m - Number of rows.
n - Number of colums.
s - Fill the matrix with this scalar value.
public PaceMatrix(double A[][])
A - Two-dimensional array of doubles.
public PaceMatrix(double A[][],
int m,
int n)
A - Two-dimensional array of doubles.
m - Number of rows.
n - Number of colums.
public PaceMatrix(double vals[],
int m)
vals - One-dimensional array of doubles, packed by columns (ala Fortran).
m - Number of rows.
public PaceMatrix(DoubleVector v)
v - DoubleVector
public PaceMatrix(Matrix X)
X - Matrix
public void setRowDimension(int rowDimension)
rowDimension - the row dimension
public void setColumnDimension(int columnDimension)
columnDimension - the column dimension
public java.lang.Object clone()
public void setPlus(int i,
int j,
double s)
i - the row number of the element
j - the column number of the element
s - the double value to be added with
public void setTimes(int i,
int j,
double s)
i - the row number of the element
j - the column number of the element
s - the double value to be multiplied with
public void setMatrix(int i0,
int i1,
int j0,
int j1,
double s)
i0 - the index of the first element of the column
i1 - the index of the last element of the column
j0 - the index of the first column
j1 - the index of the last column
s - the value to be set to
public void setMatrix(int i0,
int i1,
int j,
DoubleVector v)
i0 - the index of the first element of the column
i1 - the index of the last element of the column
j - the index of the column
v - the vector that stores the values
public void setMatrix(double v[],
boolean columnFirst)
v - 1-D array of doubles
columnFirst - Whether to fill the column first or the row.
public double maxAbs()
public double maxAbs(int i0,
int i1,
int j)
i0 - the index of the first element of the column
i1 - the index of the last element of the column
j - the index of the column
public double minAbs(int i0,
int i1,
int column)
i0 - the index of the first element of the column
i1 - the index of the last element of the column
j - the index of the column
public boolean isEmpty()
public DoubleVector getColumn(int j)
j - the index of the column
public DoubleVector getColumn(int i0,
int i1,
int j)
i0 - the index of the first element of the column
i1 - the index of the last element of the column
j - the index of the column
public double times(int i,
int j0,
int j1,
PaceMatrix B,
int l)
i - the index of the row in the first matrix
j0 - the index of the first column in the first matrix
j1 - the index of the last column in the first matrix
B - the second matrix
l - the index of the column in the second matrix
public java.lang.String toString()
public java.lang.String toString(int digits,
boolean trailing)
digits - number of digits after decimal point
trailing - true if trailing zeros are padded
public double sum2(int j,
int i0,
int i1,
boolean col)
j - the index of the column or row
i0 - the index of the first element
i1 - the index of the last element
col - if true, sum over a column; otherwise, over a row
public double[] sum2(boolean col)
col - if true, sum over columns; otherwise, over rows
public double[] h1(int j,
int k)
j - the index of the column
k - the index of the row
public void h2(int j,
int k,
double q,
PaceMatrix b,
int l)
j - the index of the column
k - the index of the row
q - q = - u'u/2; must be negative
b - the matrix to be transformed
l - the column of the matrix b
public double[] g1(double a,
double b)
a -
b -
public void g2(double cs[],
int i0,
int i1,
int j)
public void forward(PaceMatrix b,
IntVector pvt,
int k0)
b - the PaceMatrix b
pvt - the pivoting vector
k0 - the first k0 columns (in pvt) of A are not to be changed
public int mostExplainingColumn(PaceMatrix b,
IntVector pvt,
int ks)
b - response
pvt - pivoting index of A
ks - columns pvt[ks:] of A are to be tested
public void backward(PaceMatrix b,
IntVector pvt,
int ks,
int k0)
b - PaceMatrix b
pvt - pivoting vector
ks - number of QR-transformed columns; psuedo-rank of A
k0 - first k0 columns in pvt[] are not to be ordered.
public int leastExplainingColumn(PaceMatrix b,
IntVector pvt,
int ks,
int k0)
b - response
pvt - pivoting index of A
ks - psudo-rank of A
k0 - A[][pvt[0:(k0-1)]] are excluded from the testing.
public double columnResponseExplanation(PaceMatrix b,
IntVector pvt,
int j,
int ks)
b - PaceMatrix b
pvt - pivoting vector
j - the column A[pvt[j]][] is to be moved
ks - the target column A[pvt[ks]][]
public void lsqr(PaceMatrix b,
IntVector pvt,
int k0)
b - PaceMatrix b
pvt - pivoting vector
k0 - the first k0 columns of A (indexed by pvt) are pre-chosen.
(But subject to rank examination.)
For example, the constant term may be reserved, in which
case k0 = 1.
public void lsqrSelection(PaceMatrix b,
IntVector pvt,
int k0)
b - PaceMatrix b
pvt - pivoting vector
k0 - the first k0 columns of A (indexed by pvt) are pre-chosen.
(But subject to rank examination.)
For example, the constant term may be reserved, in which
case k0 = 1.
public void positiveDiagonal(PaceMatrix Y,
IntVector pvt)
Y - the response
pvt - the pivoted column index
public void steplsqr(PaceMatrix b,
IntVector pvt,
int ks,
int j,
boolean adjoin)
b - PaceMatrix b
pvt - pivoting vector
ks - number of transformed columns
j - pvt[j], the column to adjoin or delete
adjoin - to adjoin if true; otherwise, to delete
public void rsolve(PaceMatrix b,
IntVector pvt,
int kp)
b - the response
pvt - the pivoting vector
kp - the number of the first columns involved
public PaceMatrix rbind(PaceMatrix b)
b - the second matrix
public PaceMatrix cbind(PaceMatrix b)
b - the second matrix
public DoubleVector nnls(PaceMatrix b,
IntVector pvt)
For algorithm, refer to P161, Chapter 23 of C. L. Lawson and R. J. Hanson (1974). "Solving Least Squares Problems". Prentice-Hall.
b - the response
pvt - vector storing pivoting column indices
public DoubleVector nnlse(PaceMatrix b,
PaceMatrix c,
PaceMatrix d,
IntVector pvt)
b - the response
c - coeficients of equality constraints
d - constants of equality constraints
pvt - vector storing pivoting column indices
public DoubleVector nnlse1(PaceMatrix b,
IntVector pvt)
b - the response
pvt - vector storing pivoting column indices
public static Matrix randomNormal(int m,
int n)
m - Number of rows.
n - Number of colums.
public static void main(java.lang.String args[])
All Packages Class Hierarchy This Package Previous Next Index WEKA's home