Bayesian Unit Root Testing for Panel Data: BayesPanelUR

Shikhar Tyagi, Arvind Pandey, Bhupendra Singh, Vrijesh Tripathi

2026-07-29

1. Introduction

Unit root testing in panel time series datasets is crucial in econometrics, financial modeling, and social sciences. Traditional single-equation Dickey-Fuller tests often suffer from low statistical power, especially over short time horizons. Panel unit root tests exploit cross-sectional information to significantly boost test power.

The BayesPanelUR package implements the Bayesian unit root test for Panel Autoregressive (PAR) time series models developed by Kumar, Chaturvedi, and Afifa (2016). The testing procedure evaluates the difference stationarity (\(H_0: \rho = 1\)) against trend stationarity (\(H_1: \rho \in (-a, 1)\)) using the exact Posterior Odds Ratio (POR).

2. Model & Methodology

Consider a panel time series observation \(y_{i,t}\) for cross-sectional units \(i = 1, \dots, n\) and time periods \(t = 1, \dots, T\):

\[y_{i,t} = \mu_i + \delta_i t + u_{i,t}\]

where \(u_{i,t}\) is a stochastic error term following an AR(1) process:

\[u_{i,t} = \rho u_{i,t-1} + \epsilon_{i,t}, \quad \epsilon_{i,t} \sim iid \, N(0, \tau^{-1})\]

Incorporating augmentation terms of order \(p\), the model under the alternative hypothesis \(H_1\) is given by:

\[y_{i,t} - \rho y_{i,t-1} = \alpha_i + \beta_i t + \sum_{j=1}^p \theta_{i,j} \Delta y_{i,t-j} + \epsilon_{i,t}\]

and under the unit root null hypothesis \(H_0: \rho = 1\):

\[\Delta y_{i,t} = \delta_i + \sum_{j=1}^p \theta_{i,j} \Delta y_{i,t-j} + \epsilon_{i,t}\]

Using natural conjugate prior distributions, the Posterior Odds Ratio (\(\beta_{01}\)) is derived via analytical marginalization and 1D numerical quadrature over \(\rho \in (-a, 1)\).

3. Package Usage Example

We demonstrate BayesPanelUR using the included dataset nps_nav, which contains monthly Net Asset Value (NAV) records of Indian pension fund managers (ICICI, KM, SBI, UTI).

# Load sample dataset
data("nps_nav", package = "BayesPanelUR")
head(nps_nav)
#>         Date   ICICI      KM     SBI     UTI
#> 1 2010-02-01 10.5813 10.1184 10.0655 10.1031
#> 2 2010-03-01 10.5819 10.4867 10.2472 10.3917
#> 3 2010-04-01 10.8608 10.3029 10.3214 10.5337
#> 4 2010-05-01 11.2207 10.2629 10.8231 10.6214
#> 5 2010-06-01 11.5120 10.6163 10.8784 11.2240
#> 6 2010-07-01 11.6501 11.0352 10.9471 11.2845

# Extract matrix of NAV time series for 4 pension funds
nav_mat <- as.matrix(nps_nav[, 2:5])

# Perform Bayesian panel unit root test with linear trend
res <- bayes_panel_ur(nav_mat, p = 0)
print(res)
#> 
#>   Bayesian Panel Unit Root Test (Kumar et al., 2016) [Linear Trend] 
#> 
#> data:  nav_mat 
#> Posterior Odds Ratio (beta_01) = 4463645777.876607, p-value = 1.000000
#> Bayes Factor (BF_01)           = 4463645777.876609
#> Bayes Factor (BF_10)           = 0.000000
#> Posterior Prob H0 (Unit Root)  = 1.000000
#> Posterior Prob H1 (Stationary) = 0.000000
#> Estimated AR Coefficient (rho)  = 0.8636 (SE: 0.0258)
#> 
#> Conclusion: Accept H0 (Evidence supports Unit Root / Difference Stationarity)

# View detailed summary of structural parameter estimates
summary(res)
#> 
#> =========================================================
#>      Bayesian Panel Unit Root Test Summary
#> =========================================================
#> 
#> Model Description:  Bayesian Panel Unit Root Test (Kumar et al., 2016) [Linear Trend] 
#> Data Name:          nav_mat 
#> Panel Dimensions:  n = 4 cross sections, T = 71 time periods
#> Augmentation Order p = 0, Hyperparameter theta = 1.00
#> 
#> --- Hypothesis Test Statistics ---
#> Posterior Odds Ratio (beta_01) : 4.463646e+09
#> Bayes Factor (BF_01)           : 4.463646e+09
#> Bayes Factor (BF_10)           : 0.000000
#> Posterior Prob P(H0 | Data)    : 1.000000
#> Posterior Prob P(H1 | Data)    : 0.000000
#> Bayesian P-value               : 1.000000
#> 
#> --- AR Parameter Estimate ---
#> Pooled AR Coefficient (rho)    : 0.8636
#> Standard Error SE(rho)         : 0.0258
#> 
#> --- Unit-Specific Structural Parameter Estimates ---
#>  Unit Intercept_alpha Trend_beta Mu_Level Delta_Trend
#>     1           1.732    0.01977   11.777      0.1449
#>     2           1.696    0.01371   11.796      0.1005
#>     3           1.473    0.02457    9.657      0.1802
#>     4           1.486    0.01862   10.031      0.1365
#> 
#> =========================================================

4. Model with Augmentation Terms

To capture serial correlation in first differences, an augmentation term of order \(p = 1\) or \(p = 2\) can be included:

# Test with augmentation order p = 2
res_aug <- bayes_panel_ur(nav_mat, p = 2)
print(res_aug)
#> 
#>   Bayesian Panel Unit Root Test (Kumar et al., 2016) [Linear Trend with Augmentation p = 2] 
#> 
#> data:  nav_mat 
#> Posterior Odds Ratio (beta_01) = 757262636.684352, p-value = 1.000000
#> Bayes Factor (BF_01)           = 757262636.684351
#> Bayes Factor (BF_10)           = 0.000000
#> Posterior Prob H0 (Unit Root)  = 1.000000
#> Posterior Prob H1 (Stationary) = 0.000000
#> Estimated AR Coefficient (rho)  = 0.8485 (SE: 0.0284)
#> 
#> Conclusion: Accept H0 (Evidence supports Unit Root / Difference Stationarity)

5. Visualizing Posterior Density

The posterior distribution of the pooled autoregressive coefficient \(\rho\) can be visualized using the plot() S3 method:

plot(res_aug, type = "posterior")

6. References