## ----setup, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(BayesPanelUR)

## ----example------------------------------------------------------------------
# Load sample dataset
data("nps_nav", package = "BayesPanelUR")
head(nps_nav)

# 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)

# View detailed summary of structural parameter estimates
summary(res)

## ----augmentation-------------------------------------------------------------
# Test with augmentation order p = 2
res_aug <- bayes_panel_ur(nav_mat, p = 2)
print(res_aug)

## ----plot_posterior, fig.width = 6, fig.height = 4----------------------------
plot(res_aug, type = "posterior")

