import expdpy as ex
res = ex.learn_beta_convergence()
res.figlearn_beta_convergence
learn_beta_convergence(
n_units=60,
n_years=21,
rho=0.9,
gamma=0.6,
corr=0.7,
noise=0.05,
seed=0,
)Show unconditional vs conditional β-convergence on a known-parameter panel.
Simulates an AR(1) panel in logs x_{t+1} = a + rho*x_t + gamma*z_i + e where z_i is a fixed steady-state determinant correlated (corr) with each unit’s initial level. The AR(1) persistence pins the truth exactly: over a horizon T = n_years - 1 the slope of growth on the initial level is beta = (rho**T - 1) / T and the structural speed of convergence is lambda = -ln(rho) (half-life ln 2 / lambda). Because z_i is omitted, the unconditional regression is biased — units look like they barely converge (or even diverge); conditioning on z_i recovers the true convergence slope. This is the classic distinction between absolute and conditional convergence, demonstrated with :func:expdpy.analyze_beta_convergence.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| n_units | int | Panel dimensions (units and annual periods). The horizon is T = n_years - 1. |
60 |
| n_years | int | Panel dimensions (units and annual periods). The horizon is T = n_years - 1. |
60 |
| rho | float | AR(1) persistence in (0, 1); it sets the true speed -ln(rho) (closer to 1 means slower convergence). |
0.9 |
| gamma | float | Loading of the steady-state determinant z (drives the omitted-variable bias of the unconditional estimate). |
0.6 |
| corr | float | Correlation between z and the initial level (also drives the bias). |
0.7 |
| noise | float | Idiosyncratic shock standard deviation. | 0.05 |
| seed | int | Random seed. | 0 |
Returns
| Name | Type | Description |
|---|---|---|
| SandboxResult | df (unconditional vs conditional vs true slope), fig, summary and topic. |
Examples
This sandbox simulates its own AR(1) panel, so the call needs no DataFrame: