R Under development (unstable) (2026-01-28 r89344) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "bayesianVARs" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('bayesianVARs') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("bvar") > ### * bvar > > flush(stderr()); flush(stdout()) > > ### Name: bvar > ### Title: Markov Chain Monte Carlo Sampling for Bayesian > ### Vectorautoregressions > ### Aliases: bvar > > ### ** Examples > > # Access a subset of the usmacro_growth dataset > data <- usmacro_growth[,c("GDPC1", "CPIAUCSL", "FEDFUNDS")] > > # Estimate a model > mod <- bvar(data, sv_keep = "all", quiet = TRUE) > > # Plot > plot(mod) > > # Summary > summary(mod) Posterior median of reduced-form coefficients: GDPC1 CPIAUCSL FEDFUNDS GDPC1.l1 0.216 0.000 0.030 CPIAUCSL.l1 -0.044 0.613 -0.002 FEDFUNDS.l1 0.009 0.039 1.000 intercept 0.006 0.001 0.000 Posterior interquartile range of of reduced-form coefficients: GDPC1 CPIAUCSL FEDFUNDS GDPC1.l1 0.096 0.030 0.025 CPIAUCSL.l1 0.100 0.086 0.015 FEDFUNDS.l1 0.017 0.013 0.007 intercept 0.001 0.001 0.000 Posterior median of factor loadings: factor1 GDPC1 0 CPIAUCSL 0 FEDFUNDS 0 Posterior interquartile range of factor loadings: factor1 GDPC1 0.001 CPIAUCSL 0.000 FEDFUNDS 0.000 > > > > > cleanEx() > nameEx("coef") > ### * coef > > flush(stderr()); flush(stdout()) > > ### Name: coef > ### Title: Extract VAR coefficients > ### Aliases: coef coef.bayesianVARs_bvar > > ### ** Examples > > # Access a subset of the usmacro_growth dataset > data <- usmacro_growth[,c("GDPC1", "CPIAUCSL", "FEDFUNDS")] > > # Estimate a model > mod <- bvar(data, sv_keep = "all", quiet = TRUE) > > # Extract posterior draws of VAR coefficients > bvar_coefs <- coef(mod) > > > > cleanEx() > nameEx("extractB0") > ### * extractB0 > > flush(stderr()); flush(stdout()) > > ### Name: extractB0 > ### Title: Retrieve the structural parameter \boldsymbol{B}_0 samples from > ### an IRF object. > ### Aliases: extractB0 > > ### ** Examples > > train_data <- 100 * usmacro_growth[,c("GDPC1", "GDPCTPI", "GS1", "M2REAL", "CPIAUCSL")] > prior_sigma <- specify_prior_sigma(train_data, type="cholesky", cholesky_heteroscedastic=FALSE) Since argument 'type' is specified with 'cholesky', all arguments starting with 'factor_' are being ignored. Argument 'cholesky_priorhomoscedastic' not specified. Setting both shape and rate of inverse gamma prior equal to 0.01. > mod <- bvar(train_data, lags=5L, prior_sigma=prior_sigma, quiet=TRUE) > > structural_restrictions <- specify_structural_restrictions( + mod, + restrictions_B0=rbind( + c(1 ,NA,0 ,NA,NA), + c(0 ,1 ,0 ,NA,NA), + c(0 ,NA,1 ,NA,NA), + c(0 ,0 ,NA,1 ,NA), + c(0 ,0 ,0 ,0 ,1 ) + ) + ) > irf_structural <- irf( + mod, ahead=8, + structural_restrictions=structural_restrictions + ) /data/gannet/ripley/R/test-dev/RcppArmadillo/include/current/armadillo_bits/Mat_meat.hpp:7005:13: runtime error: reference binding to null pointer of type 'const double' #0 0x7bee34872424 in arma::Mat::at(unsigned int, unsigned int) const /data/gannet/ripley/R/test-dev/RcppArmadillo/include/current/armadillo_bits/Mat_meat.hpp:7005 #1 0x7bee34872424 in void arma::op_strans::apply_mat_noalias >(arma::Mat&, arma::Mat const&) /data/gannet/ripley/R/test-dev/RcppArmadillo/include/current/armadillo_bits/op_strans_meat.hpp:208 #2 0x7bee34a5b054 in void arma::op_strans::apply_direct, arma::subview > >(arma::Mat_noalias, arma::subview >::elem_type>&, arma::subview_elem2, arma::subview > const&) /data/gannet/ripley/R/test-dev/RcppArmadillo/include/current/armadillo_bits/op_strans_meat.hpp:445 #3 0x7bee34a5b054 in void arma::op_htrans::apply, arma::subview > >(arma::Mat_noalias, arma::subview >::elem_type>&, arma::Op, arma::subview >, arma::op_htrans> const&, arma::arma_not_cx, arma::subview >::elem_type>::result const*) /data/gannet/ripley/R/test-dev/RcppArmadillo/include/current/armadillo_bits/op_htrans_meat.hpp:388 #4 0x7bee34a5b054 in arma::Mat::Mat, arma::subview >, arma::op_htrans>(arma::Op, arma::subview >, arma::op_htrans> const&) /data/gannet/ripley/R/test-dev/RcppArmadillo/include/current/armadillo_bits/Mat_meat.hpp:5309 #5 0x7bee34a5b054 in find_rotation_cpp(arma::field > const&, arma::field > const&, std::__cxx11::basic_string, std::allocator > const&, unsigned int, double) /data/gannet/ripley/R/packages/tests-gcc-SAN/bayesianVARs/src/irf.cpp:412 #6 0x7bee349550cb in _bayesianVARs_find_rotation_cpp /data/gannet/ripley/R/packages/tests-gcc-SAN/bayesianVARs/src/RcppExports.cpp:85 #7 0x00000074f282 in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:766 #8 0x0000008e54da in bcEval_loop /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:8682 #9 0x0000008bbd1b in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7515 #10 0x00000085c572 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1167 #11 0x0000008722ba in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2389 #12 0x00000087637a in applyClosure_core /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2302 #13 0x00000085cc13 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2324 #14 0x00000085cc13 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1280 #15 0x00000088ab2e in do_set /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:3581 #16 0x00000085d036 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1232 #17 0x000000a023c8 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264 #18 0x000000a023c8 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:317 #19 0x000000a104aa in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1235 #20 0x000000a10542 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1242 #21 0x00000041318f in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29 #22 0x7fee49e115f4 in __libc_start_call_main (/lib64/libc.so.6+0x35f4) (BuildId: a1dda014206b55b07f58fe8db80121b752dc3d03) #23 0x7fee49e116a7 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x36a7) (BuildId: a1dda014206b55b07f58fe8db80121b752dc3d03) #24 0x000000413b74 in _start (/data/gannet/ripley/R/gcc-SAN3/bin/exec/R+0x413b74) (BuildId: 73c7cee504a4b282e7858c1889deba9aeb17d8e0) ================================================================= ==783922==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x7d4e468a1580 in thread T0: object passed to delete has wrong type: size of the allocated type: 560 bytes; size of the deallocated type: 8 bytes. #0 0x7fee4b6e897b in operator delete(void*, unsigned long) (/lib64/libasan.so.8+0xe897b) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a) #1 0x7bee34a5ef4d in std::default_delete::operator()(Solver*) const /usr/include/c++/15/bits/unique_ptr.h:93 #2 0x7bee34a5ef4d in std::unique_ptr >::~unique_ptr() /usr/include/c++/15/bits/unique_ptr.h:399 #3 0x7bee34a5ef4d in find_rotation_cpp(arma::field > const&, arma::field > const&, std::__cxx11::basic_string, std::allocator > const&, unsigned int, double) /data/gannet/ripley/R/packages/tests-gcc-SAN/bayesianVARs/src/irf.cpp:459 #4 0x7bee349550cb in _bayesianVARs_find_rotation_cpp /data/gannet/ripley/R/packages/tests-gcc-SAN/bayesianVARs/src/RcppExports.cpp:85 #5 0x00000074f282 in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:766 #6 0x0000008e54da in bcEval_loop /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:8682 #7 0x0000008bbd1b in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7515 #8 0x00000085c572 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1167 #9 0x0000008722ba in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2389 #10 0x00000087637a in applyClosure_core /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2302 #11 0x00000085cc13 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2324 #12 0x00000085cc13 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1280 #13 0x00000088ab2e in do_set /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:3581 #14 0x00000085d036 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1232 #15 0x000000a023c8 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264 #16 0x000000a023c8 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:317 #17 0x000000a104aa in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1235 #18 0x000000a10542 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1242 #19 0x00000041318f in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29 #20 0x7fee49e115f4 in __libc_start_call_main (/lib64/libc.so.6+0x35f4) (BuildId: a1dda014206b55b07f58fe8db80121b752dc3d03) #21 0x7fee49e116a7 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x36a7) (BuildId: a1dda014206b55b07f58fe8db80121b752dc3d03) #22 0x000000413b74 in _start (/data/gannet/ripley/R/gcc-SAN3/bin/exec/R+0x413b74) (BuildId: 73c7cee504a4b282e7858c1889deba9aeb17d8e0) 0x7d4e468a1580 is located 0 bytes inside of 560-byte region [0x7d4e468a1580,0x7d4e468a17b0) allocated by thread T0 here: #0 0x7fee4b6e7a1b in operator new(unsigned long) (/lib64/libasan.so.8+0xe7a1b) (BuildId: 7f1aa7e2e600e8c9d54ce6e3d36f3d31bfe7949a) #1 0x7bee34a58b1d in find_rotation_cpp(arma::field > const&, arma::field > const&, std::__cxx11::basic_string, std::allocator > const&, unsigned int, double) /data/gannet/ripley/R/packages/tests-gcc-SAN/bayesianVARs/src/irf.cpp:374 #2 0x7bee349550cb in _bayesianVARs_find_rotation_cpp /data/gannet/ripley/R/packages/tests-gcc-SAN/bayesianVARs/src/RcppExports.cpp:85 #3 0x00000074f282 in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:766 #4 0x0000008e54da in bcEval_loop /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:8682 #5 0x0000008bbd1b in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7515 #6 0x00000085c572 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1167 #7 0x0000008722ba in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2389 #8 0x00000087637a in applyClosure_core /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2302 #9 0x00000085cc13 in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:2324 #10 0x00000085cc13 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1280 #11 0x00000088ab2e in do_set /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:3581 #12 0x00000085d036 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1232 #13 0x000000a023c8 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264 #14 0x000000a023c8 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:317 #15 0x000000a104aa in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1235 #16 0x000000a10542 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1242 #17 0x00000041318f in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29 #18 0x7fee49e115f4 in __libc_start_call_main (/lib64/libc.so.6+0x35f4) (BuildId: a1dda014206b55b07f58fe8db80121b752dc3d03) #19 0x7fee49e116a7 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x36a7) (BuildId: a1dda014206b55b07f58fe8db80121b752dc3d03) #20 0x000000413b74 in _start (/data/gannet/ripley/R/gcc-SAN3/bin/exec/R+0x413b74) (BuildId: 73c7cee504a4b282e7858c1889deba9aeb17d8e0) SUMMARY: AddressSanitizer: new-delete-type-mismatch /data/gannet/ripley/R/packages/tests-gcc-SAN/bayesianVARs/src/irf.cpp:459 in find_rotation_cpp(arma::field > const&, arma::field > const&, std::__cxx11::basic_string, std::allocator > const&, unsigned int, double) ==783922==HINT: if you don't care about these errors you may set ASAN_OPTIONS=new_delete_type_mismatch=0 ==783922==ABORTING