learn_sigma_convergence

learn_sigma_convergence(n_units=60, n_periods=21, rho=0.93, noise=0.0, seed=0)

Plant a shrinking dispersion path, then watch the σ trend recover it.

Simulates log y_it = mu + (log y_i0 - mu) rho^t so the cross-sectional standard deviation of log y contracts geometrically — sigma_t = sigma_0 rho^t — and the log-dispersion trend of the standard deviation is exactly ln(rho) per period. :func:geometrics.analyze_sigma_convergence fits that trend (plus Gini and CV variants, which track it only approximately because they are computed on levels).

Parameters

Name Type Description Default
n_units int Number of entities. 60
n_periods int Number of periods. 21
rho float Per-period contraction factor of deviations, 0 < ρ < 1 (smaller = faster σ-convergence; the planted trend slope is ln ρ). 0.93
noise float Standard deviation of optional per-period log noise (0 keeps the geometric path exact). 0.0
seed int Random seed. 0

Returns

Name Type Description
SandboxResult df (trend slope per measure vs the planted ln ρ), fig, summary, topic and the simulated panel in data.

Examples

import geometrics as gm

res = gm.learn_sigma_convergence(rho=0.9)
print(res.summary["std_slope"], res.summary["true_slope"])