Gerber IQ covariance (b)

Statistics.cor — Method
Statistics.cor(
    ce::GerberIQCovariance,
    X::MatNum;
    dims::Int = 1,
    kwargs...
) -> MatNum

Compute the Gerber IQ correlation matrix with the squeezing template in ce.kind and the marker in ce.alg.

The method computes the standard deviations with ce.ve, and it centres the returns with ce.me. gerber_IQ then computes the correlation.

The standard deviations have two uses. They scale the thresholds through gerber_iq_scaling. In cov, they also scale the correlation into a covariance.

Algorithm

  1. Orient X to observations × assets with dims_oriented.
  2. Compute the standard deviation of each asset with ce.ve.
  3. Raise each standard deviation to at least eps(eltype(sd)). A constant asset then has a positive scale, and every scaled threshold is positive when c is positive.
  4. Centre the returns with ce.me through demean_returns.
  5. Return the matrix that gerber_IQ computes from the centred returns and the standard deviations.

Arguments

  • ce: Gerber IQ covariance estimator.
  • X: Data matrix observations × assets if the dims keyword does not exist or dims = 1, assets × observations when dims = 2.
  • dims: Dimension along which the computation runs.
  • kwargs...: Keyword arguments for the standard deviation estimator and for demean_returns.

Validation

  • dims is either 1 or 2.

Returns

  • rho::MatNum: The Gerber IQ correlation matrix. Its diagonal is one for every asset.
Note

An asset that never leaves its noise zone gets a zero row, because no observation adds to a pair that contains it. comovement_unit_diagonal! writes one on its diagonal entry. So the matrix stays a correlation matrix, and the asset is uncorrelated with every other asset. The sample gives no other information about the asset. To make the asset count, lower c. A short window and a quiet asset make this case more frequent.

Related

References

  • [36] S. Gerber, W. Smyth, H. Markowitz, Y. Miao, P. Ernst and P. Sargen. Squeezing financial noise: A novel approach to covariance matrix estimation. Available at SSRN 4986939 (2025). Section 3.5.
source
Statistics.cov — Method
Statistics.cov(
    ce::GerberIQCovariance,
    X::MatNum;
    dims::Int = 1,
    kwargs...
) -> MatNum

Compute the Gerber IQ covariance matrix with the squeezing template in ce.kind and the marker in ce.alg.

The method computes the standard deviations with ce.ve, and it centres the returns with ce.me. gerber_IQ then computes the correlation, and the method scales it by the standard deviations.

Mathematical definition

\[\begin{align} \hat{\mathbf{\Sigma}} &= \boldsymbol{\rho} \odot \left(\boldsymbol{\sigma} \boldsymbol{\sigma}^{\intercal}\right)\,. \end{align}\]

Where:

  • $\hat{\mathbf{\Sigma}}$: Estimated covariance matrix.
  • $\boldsymbol{\rho}$: Gerber IQ correlation matrix.
  • $\boldsymbol{\sigma}$: Vector of asset standard deviations.
  • $\odot$: Element-wise multiplication.

The covariance is the correlation of cor, scaled by the standard deviations that also scale its thresholds. So its diagonal is exactly $\boldsymbol{\sigma}^2$.

Algorithm

  1. Do the five steps of cor(ce::GerberIQCovariance, X::MatNum; dims::Int = 1, kwargs...) to get the correlation matrix and the standard deviations.
  2. Scale that matrix in place with StatsBase.cor2cov! and the standard deviations, and return it.

Arguments

  • ce: Gerber IQ covariance estimator.
  • X: Data matrix observations × assets if the dims keyword does not exist or dims = 1, assets × observations when dims = 2.
  • dims: Dimension along which the computation runs.
  • kwargs...: Keyword arguments for the standard deviation estimator and for demean_returns.

Validation

  • dims is either 1 or 2.

Returns

  • sigma::MatNum: The Gerber IQ covariance matrix. Its diagonal is the variance of each asset, because cor2cov! scales the unit diagonal of the correlation by $\boldsymbol{\sigma}^2$.

Related

References

  • [36] S. Gerber, W. Smyth, H. Markowitz, Y. Miao, P. Ernst and P. Sargen. Squeezing financial noise: A novel approach to covariance matrix estimation. Available at SSRN 4986939 (2025). Section 3.5.
source

References

[36]
S. Gerber, W. Smyth, H. Markowitz, Y. Miao, P. Ernst and P. Sargen. Squeezing financial noise: A novel approach to covariance matrix estimation. Available at SSRN 4986939 (2025).