| Type: | Package |
| Title: | Bayesian Unit Root Test for Panel Data Models |
| Version: | 0.1.0 |
| Description: | Implements the Bayesian unit root test for Panel Autoregressive (PAR) time series models developed by Kumar et al. (2016) https://hdl.handle.net/10419/179393. The package evaluates the unit root hypothesis (difference stationarity versus trend stationarity) in panel data using the Posterior Odds Ratio (POR). It accommodates PAR models with linear time trend as well as linear time trend with augmentation terms of arbitrary order. Full posterior probabilities, Bayes factors, and individual panel estimates are computed automatically. |
| License: | GPL (≥ 3) |
| Encoding: | UTF-8 |
| LazyData: | true |
| Depends: | R (≥ 4.0.0) |
| Imports: | stats, graphics |
| Suggests: | testthat (≥ 3.0.0), knitr, rmarkdown |
| VignetteBuilder: | knitr |
| RoxygenNote: | 7.3.1 |
| NeedsCompilation: | no |
| Packaged: | 2026-07-29 02:15:59 UTC; shikhar tyagi |
| Author: | Shikhar Tyagi |
| Maintainer: | Shikhar Tyagi <shikhar1093tyagi@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-08-06 13:30:07 UTC |
Bayesian Unit Root Test for Panel Data Models
Description
Implements the Bayesian unit root test for Panel Autoregressive (PAR) time series models developed by Kumar et al. (2016) <https://hdl.handle.net/10419/179393>. The package evaluates the unit root hypothesis (difference stationarity versus trend stationarity) in panel data using the Posterior Odds Ratio (POR). It accommodates PAR models with linear time trend as well as linear time trend with augmentation terms of arbitrary order. Full posterior probabilities, Bayes factors, and individual panel estimates are computed automatically.
Details
The main function of the package is bayes_panel_ur, which performs the Bayesian panel unit root test and computes posterior odds ratios, Bayes factors, and structural parameter estimates.
Author(s)
Shikhar Tyagi, Arvind Pandey, Bhupendra Singh, Vrijesh Tripathi
Maintainer: Shikhar Tyagi <shikhar1093tyagi@gmail.com>
References
Kumar, J., Chaturvedi, A., & Afifa, U. (2016). Bayesian unit root test for panel data. EERI Research Paper Series, No. 14/2016, Economics and Econometrics Research Institute (EERI), Brussels. <https://hdl.handle.net/10419/179393>
Levin, A., Lin, C. F., & Chu, C. S. J. (2002). Unit root tests in panel data: asymptotic and finite-sample properties. Journal of Econometrics, 108(1), 1-24.
Im, K. S., Pesaran, M. H., & Shin, Y. (2003). Testing for unit roots in heterogeneous panels. Journal of Econometrics, 115(1), 53-74.
Bayesian Unit Root Test for Panel Data Models
Description
Evaluates the unit root hypothesis for panel data autoregressive (PAR) models using the Bayesian Posterior Odds Ratio (POR) approach of Kumar et al. (2016).
Usage
bayes_panel_ur(
data,
id = NULL,
time = NULL,
y = NULL,
trend = TRUE,
p = 0,
a = 0.999,
vtheta = 1,
p0 = 0.5,
lower = 0,
upper = 0.9999
)
Arguments
data |
A numeric matrix (T x n), wide data.frame, or long data.frame containing panel time series data. |
id |
Character string or column index for cross-sectional unit identifier (if data is in long format). |
time |
Character string or column index for time period identifier (if data is in long format). |
y |
Character string or column index for dependent variable (if data is in long format). |
trend |
Logical. If |
p |
Non-negative integer specifying the order of augmentation terms (lagged differences). Default is 0. |
a |
Numeric bound parameter specifying the alternative hypothesis domain |
vtheta |
Numeric prior hyperparameter |
p0 |
Numeric prior probability of the null hypothesis |
lower |
Numeric lower integration limit for |
upper |
Numeric upper integration limit for |
Details
The function computes the Posterior Odds Ratio (POR) for testing the panel unit root hypothesis:
H_0: \rho = 1 \quad \text{vs} \quad H_1: \rho \in (-a, 1)
under a Panel Autoregressive PAR(1) process with cross-sectional heterogeneity in drift and trend,
as well as optional augmentation terms of order p.
The posterior odds ratio \beta_{01} is calculated via exact 1D numerical integration of the marginal posterior integrand.
The posterior probability of the null hypothesis P(H_0 | \text{data}) = \beta_{01} / (1 + \beta_{01}) serves as the Bayesian p-value.
Value
An S3 object of class "bayes_panel_ur" containing:
statistic |
The test statistic value (Posterior Odds Ratio |
p.value |
The posterior probability of the null hypothesis |
bayes_factor |
Bayes factor |
bf10 |
Bayes factor |
prob_H0 |
Posterior probability of difference stationarity |
prob_H1 |
Posterior probability of trend stationarity |
rho_hat |
Estimated AR coefficient |
se_rho |
Standard error of |
method |
Character string describing the test method. |
data.name |
Character string giving the name of the dataset. |
estimates |
Data frame containing unit-specific structural parameter estimates. |
grid |
Data frame containing |
parameter |
List of input hyperparameter settings. |
References
Kumar, J., Chaturvedi, A., & Afifa, U. (2016). Bayesian unit root test for panel data. EERI Research Paper Series, No. 14/2016, Economics and Econometrics Research Institute (EERI), Brussels. <https://hdl.handle.net/10419/179393>
Examples
set.seed(123)
# Generate stationary panel data (T = 30, n = 3)
T_len <- 30
n <- 3
y_mat <- matrix(0, nrow = T_len, ncol = n)
for (i in 1:n) {
y_mat[, i] <- 2 + 0.05 * (1:T_len) + stats::arima.sim(list(ar = 0.7), n = T_len)
}
colnames(y_mat) <- paste0("Unit_", 1:n)
# Run Bayesian panel unit root test
res <- bayes_panel_ur(y_mat, p = 0)
print(res)
summary(res)
Net Asset Value (NAV) Data of Indian National Pension Scheme (NPS)
Description
Panel dataset containing daily and monthly Net Asset Value (NAV) time series data for various pension fund managers across Tier-I and Tier-II schemes in India.
Usage
data(nps_nav)
Format
A data frame with 71 rows and 5 variables:
- Date
Date of observation (monthly average).
- ICICI
Monthly average NAV of ICICI Pension Fund.
- KM
Monthly average NAV of Kotak Mahindra (KM) Pension Fund.
- SBI
Monthly average NAV of State Bank of India (SBI) Pension Fund.
- UTI
Monthly average NAV of UTI Retirement Solutions.
Source
Economics and Econometrics Research Institute (EERI) Research Paper Series No. 14/2016. <https://hdl.handle.net/10419/179393>
References
Kumar, J., Chaturvedi, A., & Afifa, U. (2016). Bayesian unit root test for panel data. EERI Research Paper Series, No. 14/2016.
Plot Method for bayes_panel_ur
Description
Visualizes the posterior density of the AR coefficient \rho or panel data series.
Usage
## S3 method for class 'bayes_panel_ur'
plot(x, type = c("posterior", "series"), ...)
Arguments
x |
An object of class |
type |
Character string indicating plot type: |
... |
Further graphical parameters passed to |
Value
No return value, called for side effects (plotting).
Examples
set.seed(123)
data_mat <- matrix(rnorm(100), nrow = 25, ncol = 4)
fit <- bayes_panel_ur(data_mat)
plot(fit, type = "posterior")
Print Method for bayes_panel_ur
Description
Print Method for bayes_panel_ur
Usage
## S3 method for class 'bayes_panel_ur'
print(x, ...)
Arguments
x |
An object of class |
... |
Further arguments passed to or from other methods. |
Value
Invisibly returns the input object x.
Examples
set.seed(123)
data_mat <- matrix(rnorm(100), nrow = 25, ncol = 4)
fit <- bayes_panel_ur(data_mat)
print(fit)
Summary Method for bayes_panel_ur
Description
Summary Method for bayes_panel_ur
Usage
## S3 method for class 'bayes_panel_ur'
summary(object, ...)
Arguments
object |
An object of class |
... |
Further arguments passed to or from other methods. |
Value
Invisibly returns the input object object.
Examples
set.seed(123)
data_mat <- matrix(rnorm(100), nrow = 25, ncol = 4)
fit <- bayes_panel_ur(data_mat)
summary(fit)