Skip to content

Commit

Permalink
debug sign restriction for B #11
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwang15 committed Mar 17, 2024
1 parent 12dbf94 commit 1a438b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/bsvars_sign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Rcpp::List bsvar_sign_cpp(
aux_B = bsvars::sample_B_homosk1(aux_B, aux_A, aux_hyper, Y, X, prior, VB);

if (s % thin == 0) {
// aux_w, aux_A, aux_B are updated by referencing
Q = sample_Q(lags, Y, X,
aux_w, aux_A, aux_B, aux_hyper,
prior, VB,
Expand Down
2 changes: 1 addition & 1 deletion src/sample_Q.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ arma::mat sample_Q(
while (n_tries < max_tries && !success) {
Q = rortho_cpp(N);

if (match_sign_irf(Q, sign_irf, irf) && match_sign(aux_B, sign_B)) {
if (match_sign_irf(Q, sign_irf, irf) && match_sign(Q.t() * aux_B, sign_B)) {
if (!has_narrative) {
success = true;
} else {
Expand Down

0 comments on commit 1a438b1

Please sign in to comment.