Table of Contents

Class FactorReductionFunctions

Namespace
NanoQL.Numerics
Assembly
NanoQL.dll

The reduction of a correlation matrix to a single factor's loadings by the principal factor iteration (Harman, Modern Factor Analysis, 1976, chapter 9): the diagonal replaced by the communalities, the loadings the principal eigenvector scaled by the root of its eigenvalue, until they settle.

public static class FactorReductionFunctions
Inheritance
FactorReductionFunctions
Inherited Members

Remarks

It assumes the reduction is possible: where the dependence isn't one factor's, loadings may exceed 1. QuantLib reads the loadings from the matrix's row at the largest eigenvalue's index, the input's first row, where its own commented-out eigenvectors belong: on a one-factor matrix with loadings (0.9, 0.7, 0.5, 0.3, 0.8) it returns (0.546, 0.63, 0.45, 0.27, 0.72). Here the loadings are the principal eigenvector, its sign the decomposition's (the first loading positive), times the root of its eigenvalue, on the diagonal patched with their squares, which returns the one-factor matrix's loadings exactly; the relative change that stops the iteration divides by the previous loading's magnitude, so a negative loading converges too, and a loading of exactly 0 counts its successor's magnitude, where 0/0 would stop the iteration at its first pass whenever the first loading is 0. And QuantLib refuses a reduction that converges on its last allowed pass; here only one that hasn't converged is refused (a documented divergence). A matrix below 2 × 2, where QuantLib's initial guess divides by 0, is refused.

Methods

FactorReduction(Matrix, int)

The single factor's loadings of the correlation matrix mtrx.

public static ImmutableArray<double> FactorReduction(Matrix mtrx, int maxIters = 25)

Parameters

mtrx Matrix

The correlation matrix, square, at least 2 × 2; it is copied.

maxIters int

The most iterations after the first.

Returns

ImmutableArray<double>

The loadings, one per variable.

Exceptions

ArgumentNullException

mtrx is null.

ArgumentException

mtrx isn't square, or is below 2 × 2.

ArgumentOutOfRangeException

maxIters is negative.

NanoQLException

The loadings haven't converged after the iterations allowed.