/// <summary> /// Получить множественный коэффициент корреляции /// </summary> /// <param name="idx"></param> /// <returns></returns> public double GetOneMultipleCorrelation(int idx) { if (pairMatrix == null) { pairMatrix = GetPairCorrelationsMatrix(); } return(Math.Sqrt(1 - MatrixOperations.DeterminantLU(pairMatrix) / MatrixOperations.ExtraMinor(pairMatrix, idx, idx))); }
/// <summary> /// Получить матрицу частных корреляций /// </summary> /// <returns></returns> public double[][] GetParticalCorrelationsMatrix() { if (pairMatrix == null) { pairMatrix = GetPairCorrelationsMatrix(); } double[][] r = new double[pairMatrix.Length][].Select(e => e = new double[pairMatrix.Length]).ToArray(); for (int i = 0; i < pairMatrix.Length; i++) { for (int j = 0; j < pairMatrix.Length; j++) { if (i == j) { r[i][j] = 1; } else { r[i][j] = -Math.Pow(-1, i + j) * MatrixOperations.ExtraMinor(pairMatrix, i, j) / Math.Sqrt(MatrixOperations.ExtraMinor(pairMatrix, i, i) * MatrixOperations.ExtraMinor(pairMatrix, j, j)); } } } return(particalMatrix = r); }