Skip to content

Commit

Permalink
corrected sampler for nu #2
Browse files Browse the repository at this point in the history
  • Loading branch information
donotdespair committed May 12, 2024
1 parent 906a6bd commit c87b42e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/specify_bvarpanel.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ specify_prior_bvarPANEL = R6::R6Class(
self$S_Sigma_inv = diag(N)
self$eta = N + 1
self$mu_Sigma = N + 1
self$lambda = 0.1
self$lambda = 0.01385
self$mu_m = 1
self$sigma2_m = 1
self$s_w = 1
Expand Down Expand Up @@ -210,7 +210,7 @@ specify_starting_values_bvarPANEL = R6::R6Class(
self$A = matrix(stats::rnorm(K * N, sd = 0.001), K, N) + diag(K)[,1:N]
self$V = stats::rWishart(1, K + 1, diag(K))[,,1]
self$Sigma = stats::rWishart(1, N + 1, diag(N))[,,1]
self$nu = stats::rgamma(1, 3)
self$nu = 30 #stats::rgamma(1, shape = 1, scale = 30)
self$m = stats::rnorm(1, sd = 0.001)
self$w = stats::rgamma(1, 1)
self$s = stats::rgamma(1, 1)
Expand Down
1 change: 1 addition & 0 deletions src/sample_mniw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ double sample_nu (
Cov_nu_tmp += R::psigamma( 0.5 * (aux_nu + 1 - n), 1);
} // END n loop
Cov_nu += 1 / Cov_nu_tmp;
Cov_nu = sqrt(Cov_nu);

// Metropolis-Hastings
double aux_nu_star = RcppTN::rtn1( aux_nu, Cov_nu, N + 1, R_PosInf );
Expand Down

0 comments on commit c87b42e

Please sign in to comment.