Internal functions for the Cross-Sectionally augmented ARDL (CS-ARDL) estimator of Chudik, Mohaddes, Pesaran & Raissi (2016). Estimates an ARDL\((p_y, p_x)\) model with cross-sectional averages and recovers long-run coefficients and the speed of adjustment via the delta method.
The unit-level regression is $$y_{it} = \alpha_i + \sum_{p=1}^{P_y} \phi_{ip} y_{i,t-p} + \sum_{q=0}^{P_x} \beta'_{iq} x_{i,t-q} + \delta'_{i} \bar{z}_t + e_{it}.$$
The long-run coefficient on \(x_k\) is $$\theta_{ik} = \frac{\sum_{q=0}^{P_x} \beta_{ikq}}{1 - \sum_{p=1}^{P_y} \phi_{ip}}$$ and the implied speed of adjustment is $$\varphi_i = -\left(1 - \sum_{p=1}^{P_y} \phi_{ip}\right).$$