Skip to content

Commit

Permalink
change example
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwang15 committed Jul 16, 2024
1 parent 8328f01 commit cc608dc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 33 deletions.
24 changes: 8 additions & 16 deletions R/bsvarSIGNs-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,12 @@
#'
#' Antolín-Díaz & Rubio-Ramírez (2018) Narrative Sign Restrictions for SVARs, American Economic Review, 108(10), 2802-29, <doi:10.1257/aer.20161852>.
#' @examples
#' # upload data
#' data(oil)
#'
#' # restrictions as in Antolín-Díaz & Rubio-Ramírez (2018)
#' sign_narrative = matrix(c(2, -1, 3, 2, 236, 0), ncol = 6)
#' sign_irf = array(matrix(c(-1, -1, 1, 1, 1, 1, 1, -1, 1), nrow = 3),
#' dim = c(3, 3, 1))
#'
#' # specify the model and set seed
#' set.seed(123)
#' specification = specify_bsvarSIGN$new(oil,
#' p = 12,
#' sign_irf = sign_irf,
#' sign_narrative = sign_narrative
#' )
#' posterior = estimate(specification, S = 10)
#' sign_irf = matrix(NA, 5, 5)
#' sign_irf[2, 1] = 1
#' sign_irf[1, 1] = 0
#' spec = specify_bsvarSIGN$new(optimism * 100,
#' p = 4,
#' sign_irf = sign_irf)
#' spec$prior$estimate_hyper()
#' post = estimate(spec, S = 1000)
NULL
24 changes: 8 additions & 16 deletions man/bsvarSIGNs-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/sample_hyper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ arma::mat sample_hyper(
S, start, narrow_hyper(model, init), W,

[init, model, Y, X, prior](const vec& x) {

vec extended = extend_hyper(init, model, x);
return log_posterior_hyper(extended, model, Y, X, prior);
}
Expand Down

0 comments on commit cc608dc

Please sign in to comment.