Skip to content

Commit

Permalink
fixed the bug with as_scalar #1
Browse files Browse the repository at this point in the history
  • Loading branch information
donotdespair committed Jan 18, 2024
1 parent ad66aab commit 710e88a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
Binary file modified src/bsvarSIGNs.so
Binary file not shown.
3 changes: 2 additions & 1 deletion src/bsvars_in_sign.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

#include <RcppArmadillo.h>
#include "progress.hpp"
#include "Rcpp/Rmath.h"

using namespace Rcpp;
using namespace arma;
Expand Down Expand Up @@ -91,7 +92,7 @@ void sample_hyperparameters (
shape_tmp = prior_hyper_a_B + prior_hyper_nu_B / 2;
aux_hyper(N + n, 0) = R::rgamma(shape_tmp, scale_tmp);

scale_tmp = aux_hyper(N + n, 0) + as_scalar(aux_B * prior_B_V_inv * aux_B.t());
scale_tmp = aux_hyper(N + n, 0) + as_scalar(aux_B.row(n) * prior_B_V_inv * aux_B.row(n).t());
shape_tmp = prior_hyper_nu_B + rn;
aux_hyper(n, 0) = scale_tmp / R::rchisq(shape_tmp);

Expand Down
Binary file modified src/bsvars_in_sign.o
Binary file not shown.

0 comments on commit 710e88a

Please sign in to comment.