ivxj.xj
Functions
|
Compute the XJ estimate for unbalanced panel data with a single regressor. |
|
Auxiliary function to handle time series with odd lengths. |
Module Contents
- ivxj.xj.xj(xlong, Tlens)[source]
Compute the XJ estimate for unbalanced panel data with a single regressor.
This function applies the X-jackknife method to panel data following an AR(1) process, allowing for unbalanced panels where individuals may have different time lengths.
- Parameters:
xlong (array-like of shape (n_total,), dtype=float64) – Stacked column vector of the regressor for all individuals: (x_1, …, x_n)’.
Tlens (array-like of shape (n,), dtype=int) – Vector of individual time lengths: (T_1, …, T_n).
- Returns:
rho_hat – The XJ estimate of the AR(1) coefficient rho.
- Return type:
float
- ivxj.xj.xjackk_for_odd_time_len(x, xx_for_correction, x0_for_correction)[source]
Auxiliary function to handle time series with odd lengths.
This function adjusts calculations when the time series length is odd, using correction terms to ensure accurate estimation of the AR(1) coefficient.
- Parameters:
x (array-like, dtype=float64) – The time series data.
xx_for_correction (float) – Correction term applied to adjust for odd-length series in the calculation.
x0_for_correction (float) – Additional correction term for adjustment in the calculation.
- Returns:
numer (float) – Numerator used in the calculation of rho_hat.
denom (float) – Denominator used in the calculation of rho_hat.