public class StatisticalUtility
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
StatisticalUtility.TypeMatrixR |
Constructor and Description |
---|
StatisticalUtility() |
Modifier and Type | Method and Description |
---|---|
static Matrix |
combineMatrices(Matrix mat1,
Matrix mat2)
This method combines two row vectors of dummy variables.
|
static Matrix |
constructRMatrix(Matrix coordinates,
double rho,
double gamma,
double residual,
StatisticalUtility.TypeMatrixR type)
Construct a within-subject correlation matrix using a rho parameter, a gamma parameter, a residual parameter and a column vector of coordinates.
|
static Matrix |
constructRMatrix(Matrix coordinates,
double varianceParameter,
double covarianceParameter,
StatisticalUtility.TypeMatrixR type)
Construct a within-subject correlation matrix using a variance parameter, a correlation parameter and a column vector of coordinates.
|
static Matrix |
drawRandomVector(int nrow,
Distribution.Type type)
This method generates a random vector
|
static Matrix |
drawRandomVector(int nrow,
Distribution.Type type,
java.util.Random random)
This method generates a random vector
|
static long |
getCombinations(int n,
int d)
This method returns the number of combinations.
|
static REpiceaRandom |
getRandom()
This method returns a Random generator.
|
static Matrix |
performSpecialAdd(Matrix originalMatrix,
Matrix matrixToAdd)
This method performs a special addition in which only the elements different from 0 and 1
are involved.
|
public static Matrix constructRMatrix(Matrix coordinates, double varianceParameter, double covarianceParameter, StatisticalUtility.TypeMatrixR type)
coordinates
- a column vector of coordinates from which the distances are calculatedvarianceParameter
- the variance parametercovarianceParameter
- the covariance parametertype
- the type of correlationpublic static Matrix constructRMatrix(Matrix coordinates, double rho, double gamma, double residual, StatisticalUtility.TypeMatrixR type)
coordinates
- a column vector of coordinates from which the distances are calculatedrho
- the rho parametergamma
- the gamma parameterresidual
- the residual parametertype
- the type of correlationpublic static Matrix drawRandomVector(int nrow, Distribution.Type type)
nrow
- the number of elements to be generatedtype
- the distribution type (a Distribution.Type enum variable)public static REpiceaRandom getRandom()
public static Matrix drawRandomVector(int nrow, Distribution.Type type, java.util.Random random)
nrow
- the number of elements to be generatedtype
- the distribution type (a Distribution enum variable)random
- a Random instancepublic static Matrix performSpecialAdd(Matrix originalMatrix, Matrix matrixToAdd)
originalMatrix
- the matrix of parametersmatrixToAdd
- the matrix of parameter deviatespublic static Matrix combineMatrices(Matrix mat1, Matrix mat2)
mat1
- the first row vectormat2
- the second row vectorpublic static long getCombinations(int n, int d)
n
- the number of unitsd
- the number of units drawn in each combination