Home · Command reference

RainbowStats™ · Distribution comparison

GEOMETRIC_JS

Compare two multivariate economic regimes using geometric Jensen–Shannon divergence between fitted Gaussian distributions.

Syntax

GEOMETRIC_JS(pList,qList)
GEOMETRIC_JS(pList,qList,ridge)

Example

P=LIST(SERIES_BETWEEN(UNRATE,20000101,20071231),SERIES_BETWEEN(FEDFUNDS,20000101,20071231))
Q=LIST(SERIES_BETWEEN(UNRATE,20100101,20191231),SERIES_BETWEEN(FEDFUNDS,20100101,20191231))
M=GEOMETRIC_JS(P,Q)
SLIDE(M)
EXTRACT(M,"divergence")

What it measures

Each DataList is a sample of the same multivariate variables. The command fits a Gaussian to each sample and constructs their normalized geometric midpoint. It returns the average KL divergence from each fitted Gaussian to that midpoint, in nats. Zero indicates agreement of the fitted regularized Gaussians; larger values indicate more separation in means, variances, or covariances. It is not a p-value or a causal inference.

Unlike ordinary arithmetic-mixture Jensen–Shannon divergence, this geometric variant is not generally bounded by ln(2). The samples can cover different dates and have different observation counts, but variable order must match. Covariance ridge is applied after shared pooled standardization.

Extractable results

EXTRACT(M,"divergence")
EXTRACT(M,"kl_p")
EXTRACT(M,"kl_q")
EXTRACT(M,"means")
EXTRACT(M,"mean_p")
EXTRACT(M,"mean_q")
EXTRACT(M,"mean_g")
EXTRACT(M,"covariance_p")
EXTRACT(M,"covariance_q")
EXTRACT(M,"covariance_g")
EXTRACT(M,"summary")
EXTRACT(M,"slideshow")

Econometric cautions

Choose economically meaningful transformations for trending data. Check Gaussian fit, outliers, autocorrelation and near-collinearity. Divergence is descriptive; testing a regime break requires a separate time-series-aware inference procedure. This finite-dimensional implementation is not the paper's infinite-dimensional Hilbert-space construction.