PearsonsCorrelation
on the ranked data.
By default, ranks are computed using NaturalRanking with default
strategies for handling NaNs and ties in the data (NaNs maximal, ties averaged).
The ranking algorithm can be set using a constructor argument.
| Modifier and Type | Field and Description |
|---|---|
| private final RealMatrix | data
Input data |
| private final PearsonsCorrelation | rankCorrelation
Rank correlation |
| private final RankingAlgorithm | rankingAlgorithm
Ranking algorithm |
| Access | Constructor and Description |
|---|---|
| public | |
| public | SpearmansCorrelation(final RankingAlgorithm
ranking algorithm rankingAlgorithm)Create a SpearmansCorrelation with the given ranking algorithm. |
| public | SpearmansCorrelation(final RealMatrix
matrix of data with columns representing
variables to correlate dataMatrix)Create a SpearmansCorrelation from the given data matrix. |
| public | SpearmansCorrelation(final RealMatrix
matrix of data with columns representing
variables to correlate dataMatrix, final RankingAlgorithm ranking algorithm rankingAlgorithm)Create a SpearmansCorrelation with the given input data matrix and ranking algorithm. |
| Modifier and Type | Method and Description |
|---|---|
| public RealMatrix | Returns: correlation matrixmatrix with columns representing variables to correlate matrix)Computes the Spearman's rank correlation matrix for the columns of the input matrix. |
| public RealMatrix | Returns: correlation matrixmatrix with columns representing variables to correlate matrix)Computes the Spearman's rank correlation matrix for the columns of the input rectangular array. |
| public double | Returns: Returns Spearman's rank correlation coefficient for the two arraysfirst data array xArray, final double[] second data array yArray)Computes the Spearman's rank correlation coefficient between the two arrays. |
| public RealMatrix | Returns: Spearman Rank Correlation MatrixCalculate the Spearman Rank Correlation Matrix. |
| private List | Returns: a list of NaN positions in the input arraythe input array input)Returns a list containing the indices of NaN values in the input array. |
| public PearsonsCorrelation | Returns: PearsonsCorrelation among ranked column dataReturns a |
| private RealMatrix | Returns: a rank-transformed matrixmatrix to transform matrix)Applies rank transform to each of the columns of |
| private double[] | Returns: the input array without the values at the specified indicesthe input array input, final Set<Integer> a set containing the indices to be removed indices)Removes all values from the input array at the specified indices. |
| data | back to summary |
|---|---|
| private final RealMatrix data Input data | |
| rankCorrelation | back to summary |
|---|---|
| private final PearsonsCorrelation rankCorrelation Rank correlation | |
| rankingAlgorithm | back to summary |
|---|---|
| private final RankingAlgorithm rankingAlgorithm Ranking algorithm | |
| SpearmansCorrelation | back to summary |
|---|---|
| public SpearmansCorrelation() Create a SpearmansCorrelation without data. | |
| SpearmansCorrelation | back to summary |
|---|---|
| public SpearmansCorrelation(final RankingAlgorithm rankingAlgorithm) Create a SpearmansCorrelation with the given ranking algorithm.
From version 4.0 onwards this constructor will throw an exception
if the provided
| |
| SpearmansCorrelation | back to summary |
|---|---|
| public SpearmansCorrelation(final RealMatrix dataMatrix) Create a SpearmansCorrelation from the given data matrix.
| |
| SpearmansCorrelation | back to summary |
|---|---|
| public SpearmansCorrelation(final RealMatrix dataMatrix, final RankingAlgorithm rankingAlgorithm) Create a SpearmansCorrelation with the given input data matrix and ranking algorithm.
From version 4.0 onwards this constructor will throw an exception
if the provided
| |
| computeCorrelationMatrix | back to summary |
|---|---|
| public RealMatrix computeCorrelationMatrix(final RealMatrix matrix) Computes the Spearman's rank correlation matrix for the columns of the input matrix.
| |
| computeCorrelationMatrix | back to summary |
|---|---|
| public RealMatrix computeCorrelationMatrix(final double[][] matrix) Computes the Spearman's rank correlation matrix for the columns of the input rectangular array. The columns of the array represent values of variables to be correlated.
| |
| correlation | back to summary |
|---|---|
| public double correlation(final double[] xArray, final double[] yArray) Computes the Spearman's rank correlation coefficient between the two arrays.
| |
| getCorrelationMatrix | back to summary |
|---|---|
| public RealMatrix getCorrelationMatrix() Calculate the Spearman Rank Correlation Matrix.
| |
| getNaNPositions | back to summary |
|---|---|
| private List Returns a list containing the indices of NaN values in the input array. | |
| getRankCorrelation | back to summary |
|---|---|
| public PearsonsCorrelation getRankCorrelation() Returns a Returns null if this instance was created with no data.
| |
| rankTransform | back to summary |
|---|---|
| private RealMatrix rankTransform(final RealMatrix matrix) Applies rank transform to each of the columns of
| |
| removeValues | back to summary |
|---|---|
| private double[] removeValues(final double[] input, final Set<Integer> indices) Removes all values from the input array at the specified indices. | |