Skip to content

Commit

Permalink
Wrap up for CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolas Kuschnig committed Feb 16, 2024
1 parent 728778c commit 6919c2f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

# v1.0.5, CRAN Update 9
# v1.0.5, CRAN Update 10
- Add historical decompositions and RMSE/LPS, and WAIC for analysis
- Improve the algorithm to draw sign restrictions
- Shocks are now built and checked per variable
- Fix the CRAN *NOTE* on missing "tangle output"
- Keep older FRED-datasets due to small changes in naming
- Update FRED-datasets to 2023-10 vintage
- Newer FRED-QD files include (unannounced) small naming changes


# v1.0.4, CRAN Update 9
Expand Down
9 changes: 3 additions & 6 deletions R/64_irf_method.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,9 @@ irf.bvar <- function(x, ..., conf_bands, n_thin = 1L, verbose = FALSE) {
sigma <- x[["sigma"]]

# Check sign restrictions
if(!is.null(irf[["sign_restr"]]) && length(irf[["sign_restr"]]) != M ^ 2) {
stop("Dimensions of provided sign restrictions do not fit the data.")
}
if(!is.null(irf[["zero_restr"]]) && length(irf[["zero_restr"]]) != M ^ 2) {
stop("Dimensions of provided zero and sign restrictions ",
"do not fit the data.")
if(!is.null(irf[["sign_restr"]]) && length(irf[["sign_restr"]]) != M ^ 2 ||
!is.null(irf[["zero_restr"]]) && length(irf[["zero_restr"]]) != M ^ 2) {
stop("Dimensions of provided restrictions do not fit the data.")
}

# Sampling ---
Expand Down
8 changes: 5 additions & 3 deletions inst/tinytest/test_BVAR.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ expect_silent(irfs3 <- irf(run2, opt_irf3))

expect_silent(print(irfs1))
expect_silent(print(summary(irfs1)))
expect_silent(print(fevd(run))) # Access
expect_silent(print(fevd(run) <- fevd(run))) # Access
expect_silent(print(fevd(run2))) # Recalculates
expect_silent(print(fevd(irfs2))) # Recalculates
expect_silent(plot(irfs1, vars_res = 1, vars_imp = 1))
Expand Down Expand Up @@ -250,6 +250,8 @@ expect_silent(print(companion(run, conf_bands = 0.1)))

expect_silent(print(hist_decomp(run, type = "mean")))
expect_silent(print(hist_decomp(run, type = "quantile")))
expect_silent(print(rmse(run, type = "mean")))
expect_silent(print(lps(run, conf_bands = 0.1)))
expect_silent(print(rmse(run)))
expect_silent(print(rmse(run, holdout = data2[1:10, ])))
expect_silent(print(lps(run)))
expect_silent(print(lps(run, holdout = data2[1:10, ])))
expect_silent(print(WAIC(run)))
2 changes: 1 addition & 1 deletion tests/tinytest.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if(requireNamespace("tinytest", quietly = TRUE)) {

set.seed(42)
home <- length(unclass(packageVersion("BVAR"))[[1]]) == 4 # 0.0.0.9000
home <- TRUE
# home <- TRUE
if(home) { # Only run locally, let CRAN test examples and the vignette
tinytest::test_package("BVAR", at_home = home, pattern = "^.*\\.[rR]$")
}
Expand Down

0 comments on commit 6919c2f

Please sign in to comment.