learn_beta_convergence

learn_beta_convergence(
    n_units=60,
    n_periods=6,
    convergence_rate=0.02,
    growth_const=0.05,
    noise=0.005,
    seed=0,
)

Plant a convergence rate, then watch the growth-on-initial regression find it.

Simulates log y_it = log y_i0 + t (a - b log y_i0) + noise so annualized growth is exactly a - b log y_i0 (up to noise) and the β-convergence slope is -b by construction. The figure is the real :func:geometrics.analyze_beta_convergence scatter with the planted-truth line drawn on top; the summary compares estimated and true β, speed and half-life.

Parameters

Name Type Description Default
n_units int Number of entities. 60
n_periods int Number of periods (the horizon is n_periods - 1). 6
convergence_rate float The planted b > 0: poorer units grow faster by b per unit of initial log level, so the regression slope is -b. 0.02
growth_const float The common growth constant a. 0.05
noise float Standard deviation of the per-period log noise. 0.005
seed int Random seed. 0

Returns

Name Type Description
SandboxResult df (β / speed / half-life, estimated vs true), fig, summary, topic and the simulated panel in data.

Examples

import geometrics as gm

res = gm.learn_beta_convergence(convergence_rate=0.03)
print(res.summary["est_beta"], res.summary["true_beta"])