Bayesian Nonlinear Ornstein-Uhlenbeck Models with Stochastic Volatility
Align matrix columns to reference
bayesianOU: Bayesian Nonlinear Ornstein-Uhlenbeck Models
Build accounting block for TMG
Build beta(TMG_t) table by sector and time
Check availability of Stan backend
Compare models using PSIS-LOO
Compute common factor from matrix
Count HMC divergences
Drift decomposition over grid
Evaluate out-of-sample forecast metrics
Export posterior draws to CSV
Export model comparison to Excel
Export model summary to text file
Extract convergence evidence for kappa parameters
Extract posterior summary from fitted model
Fit Bayesian nonlinear OU model with TMG effect and SV
Stan code for nonlinear OU model with SV and Student-t
Plot beta(TMG_t) evolution by sector
Plot cubic OU drift curves
Plot posterior distributions of key parameters
Plot stochastic volatility evolution
Summarize stochastic volatility sigmas
Validate OU model fit
Verbose message helper
Z-score standardization using training period statistics
Fits Bayesian nonlinear Ornstein-Uhlenbeck models with cubic drift, stochastic volatility, and Student-t innovations. The package implements hierarchical priors for sector-specific parameters and supports parallel MCMC sampling via 'Stan'. Model comparison is performed using Pareto Smoothed Importance Sampling Leave-One-Out (PSIS-LOO) cross-validation following Vehtari, Gelman, and Gabry (2017) <doi:10.1007/s11222-016-9696-4>. Prior specifications follow recommendations from Gelman (2006) <doi:10.1214/06-BA117A> for scale parameters.
Useful links