|
finMath lib documentation | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.finmath.functions.LinearAlgebra
public class LinearAlgebra
This class implements some methods from linear algebra (e.g. solution of a linear equation, PCA). It is basically a functional wrapper using either the Colt library or Apache commons math. I am currently preferring to use Colt, due to better performance in some situations, however it allows to easily switch some parts to Apache commons math (this is the motivation for this class).
Constructor Summary | |
---|---|
LinearAlgebra()
|
Method Summary | |
---|---|
static double[][] |
factorReduction(double[][] correlationMatrix,
int numberOfFactors)
Returns a correlation matrix which has rank < n and for which the first n factors agree with the factors of correlationMatrix. |
static cern.colt.matrix.DoubleMatrix2D |
factorReductionUsingColt(cern.colt.matrix.DoubleMatrix2D correlationMatrix,
int numberOfFactors)
Returns a correlation matrix which has rank < n and for which the first n factors agree with the factors of correlationMatrix. |
static double[][] |
factorReductionUsingCommonsMath(double[][] correlationMatrix,
int numberOfFactors)
Returns a correlation matrix which has rank < n and for which the first n factors agree with the factors of correlationMatrix. |
static double[][] |
getFactorMatrix(double[][] correlationMatrix,
int numberOfFactors)
Returns the matrix of the n Eigenvectors corresponding to the first n largest Eigenvalues of a correlation matrix. |
static double[][] |
invert(double[][] matrix)
Returns the inverse of a given matrix. |
static double[] |
solveLinearEquation(double[][] A,
double[] b)
Find a solution of the linear equation A x = b where A is an n x m - matrix given as double[n][m] b is an m - vector given as double[m], x is an n - vector given as double[n], |
static double[] |
solveLinearEquationLeastSquare(double[][] matrix,
double[] vector)
Find a solution of the linear equation A x = b in the least square sense where A is an n x m - matrix given as double[n][m] b is an m - vector given as double[m], x is an n - vector given as double[n], |
static double[] |
solveLinearEquationSymmetric(double[][] matrix,
double[] vector)
Find a solution of the linear equation A x = b where A is an symmetric n x n - matrix given as double[n][n] b is an n - vector given as double[n], x is an n - vector given as double[n], |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LinearAlgebra()
Method Detail |
---|
public static double[] solveLinearEquation(double[][] A, double[] b)
A
- The matrix (left hand side of the linear equation).b
- The vector (right hand of the linear equation).
public static double[][] invert(double[][] matrix)
matrix
- A matrix given as double[n][n].
public static double[] solveLinearEquationSymmetric(double[][] matrix, double[] vector)
matrix
- The matrix A (left hand side of the linear equation).vector
- The vector b (right hand of the linear equation).
public static double[] solveLinearEquationLeastSquare(double[][] matrix, double[] vector)
matrix
- The matrix A (left hand side of the linear equation).vector
- The vector b (right hand of the linear equation).
public static double[][] getFactorMatrix(double[][] correlationMatrix, int numberOfFactors)
correlationMatrix
- The given correlation matrix.numberOfFactors
- The requested number of factors (eigenvectors).
public static double[][] factorReduction(double[][] correlationMatrix, int numberOfFactors)
correlationMatrix
- The given correlation matrix.numberOfFactors
- The requested number of factors (Eigenvectors).
public static double[][] factorReductionUsingCommonsMath(double[][] correlationMatrix, int numberOfFactors)
correlationMatrix
- The given correlation matrix.numberOfFactors
- The requested number of factors (Eigenvectors).
public static cern.colt.matrix.DoubleMatrix2D factorReductionUsingColt(cern.colt.matrix.DoubleMatrix2D correlationMatrix, int numberOfFactors)
correlationMatrix
- The given correlation matrix.numberOfFactors
- The requested number of factors (Eigenvectors).
|
Copyright © 2014 Christian P. Fries. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |