FactorSVResult.conditional_correlation#

FactorSVResult.conditional_correlation()[source]#

Conditional correlations implied by conditional_covariance(), (T, k, k).

The posterior-mean covariance scaled by its own diagonal, so this is the correlation of the posterior-mean covariance, not the posterior mean of the correlation. Correlations move only because factor volatilities move against idiosyncratic ones.

Return type:

NDArray[double]

Returns:

An array of shape (T, k, k) with unit diagonals.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> f = rng.standard_normal(200)
>>> y = np.outer(f, [1.0, 0.8, 0.6]) + 0.3 * rng.standard_normal((200, 3))
>>> res = FactorSV(y, n_factors=1).fit(n_draws=200, n_burn=50, seed=0)
>>> corr = res.conditional_correlation()
>>> bool(np.allclose(np.einsum("tii->ti", corr), 1.0))
True
>>> bool(corr[:, 0, 1].mean() > corr[:, 0, 2].mean() > 0.5)
True