Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nk027/bvar
Browse files Browse the repository at this point in the history
  • Loading branch information
oDNAudio committed May 5, 2020
2 parents 117dd88 + 464c32d commit 8916119
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 43 deletions.
58 changes: 35 additions & 23 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,40 @@
# v1.0.0, CRAN Update 5 / JSS Revision 2

add FRED-MD (Update datasets, compress em)
cond fcast
bugfixes (irf, vectorised scale_hess)
improve docs
add options to plots (area, t_back, x-labels, transparence)
add vignette (compressed to ebook quality, figures pdf/png)
add wrapper for parallelisation
add helper function for transformation
optimise speed (mvnorm, matrix operations, factor 2 to 10)
add unit tests
handle coda interface nicer (zzz.R, fix potential Windows bug)
remove deprecated functions
update citation
add mean argument to methods
facilitate minnesota prior mean changes
add replacement functions for irf() and predict()
move irf and predict out of main loop
speed up fevd calculation
add robustness checks
add helper functions
improve vars & co to work with regex
auto psi now tries increasing integration once
add verbosity to errors
- Add fancy **vignette** with background and demonstrations
- Add new features
- New **FRED-MD** database and updated FRED-QD (`data("fred_md")`)
- Transformation helper functions (`fred_transform()`, `fred_code()`)
- Add **Conditional forecasting** (see `?bv_fcast()`)
- New replacement functions for `irf()` and `predict()` (`irf(x) <- irf(x)`)
- Provide wrapper for parallelised execution (`par_bvar()`)
- Improve existing features
- Enhance IRF and forecast plotting
- `area` argument adds polygons for credible intervals
- `t_back` allows adding realised values before forecasts
- `col` and `fill` arguments allow changing colours
- transparence is applied to sequential lines / polygons
- Improved x-axis labelling
- Regex may be used for `vars`, `vars_response`, and `vars_impulse`
- New `type` for `coef()`, `fitted()`, etc, to retrieve means / quantiles
- Add constructors for the prior mean `b` argument in `bv_mn()`
- Auto `psi` now allows for one order of integration
- **Enhance speed** considerably (~2-10 times faster)
- Move IRF and forecasts out of MCMC
- Capitalise upon matrix properties
- Cached and customised multivariate normal drawing
- Optimised FEVD computation
- Fix bugs
- IRF calculation is now ordered properly (please recalculate)
- *coda* methods are now proper methods (potential issue on Windows)
- Vectorised `scale_hess` now works properly
- Remove deprecated functions and arguments
- Work on documentation and examples
- Update citation information
- Improve upon internal structure
- Unit tests with *tinytest* for development (skipped on CRAN)
- Outsource additional steps to dedicated functions
- More robustness checks and add verbosity to errors
- Tested extensively on R 4.0.0 and R 3.6.3.


# v0.2.2, CRAN Update 4 / Impulse Response Hotfix
Expand Down
11 changes: 1 addition & 10 deletions R/58_fcast_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#' Forecasts of all or a subset of the available variables can be plotted.
#'
#' @param x A code{bvar_fcast} object, obtained from \code{\link{predict.bvar}}.
#' @param conf_bands Deprecated. Use \code{\link{predict.bvar}}. Numeric vector
#' of desired confidence bands.
#' @param vars Optional numeric or character vector. Used to subset the plot to
#' certain variables by position or name (must be available). Defaults to
#' \code{NULL}, i.e. all variables.
Expand Down Expand Up @@ -69,7 +67,6 @@
#' }
plot.bvar_fcast <- function(
x,
conf_bands, # deprecated, see `predict.bvar()`
vars = NULL,
col = "#737373",
t_back = 1,
Expand All @@ -81,7 +78,7 @@ plot.bvar_fcast <- function(
...) {

if(!inherits(x, "bvar_fcast")) {stop("Please provide a `bvar_fcast` object.")}
plot_fcast(x = x, conf_bands = conf_bands, vars = vars,
plot_fcast(x = x, vars = vars,
variables = variables, orientation = orientation, mar = mar,
t_back = t_back, area = area, col = col, fill = fill, ...)
}
Expand All @@ -90,7 +87,6 @@ plot.bvar_fcast <- function(
#' @noRd
plot_fcast <- function(
x,
conf_bands, # deprecated, see `predict.bvar()`
vars = NULL,
variables = NULL,
orientation = c("vertical", "horizontal"),
Expand All @@ -108,11 +104,6 @@ plot_fcast <- function(
}
if(inherits(x, "bvar")) {x <- predict(x)}

if(!missing(conf_bands)) {
message("Parameter conf_bands is deprecated. Please use `predict()`.")
x <- predict(x, conf_bands = conf_bands)
}

orientation <- match.arg(orientation)

# Prepare data ---
Expand Down
11 changes: 1 addition & 10 deletions R/68_irf_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#' plotted.
#'
#' @param x A \code{bvar_irf} object, obtained from \code{\link{irf.bvar}}.
#' @param conf_bands Deprecated. Use \code{\link{irf.bvar}}. Numeric vector
#' of desired confidence bands.
#' @param vars_impulse,vars_response Optional numeric or character vector. Used
#' to subset the plot's impulses / responses to certain variables by position
#' or name (must be available). Defaults to \code{NULL}, i.e. all variables.
Expand Down Expand Up @@ -64,7 +62,6 @@
#' }
plot.bvar_irf <- function(
x,
conf_bands, # deprecated, see `irf.bvar()`
vars_response = NULL,
vars_impulse = NULL,
col = "#737373",
Expand All @@ -75,7 +72,7 @@ plot.bvar_irf <- function(
...) {

if(!inherits(x, "bvar_irf")) {stop("Please provide a `bvar_irf` object.")}
plot_irf(x = x, conf_bands = conf_bands,
plot_irf(x = x,
vars_response = vars_response, vars_impulse = vars_impulse,
variables = variables, mar = mar, area = area, col = col, fill = fill, ...)
}
Expand All @@ -84,7 +81,6 @@ plot.bvar_irf <- function(
#' @noRd
plot_irf <- function(
x,
conf_bands, # deprecated, see `irf.bvar()`
vars_response = NULL,
vars_impulse = NULL,
variables = NULL,
Expand All @@ -101,11 +97,6 @@ plot_irf <- function(
}
if(inherits(x, "bvar")) {x <- irf(x)}

if(!missing(conf_bands)) {
message("Parameter conf_bands is deprecated. Please use `irf()`.")
x <- irf(x, conf_bands = conf_bands)
}

# Prepare data ---

has_quants <- length(dim(x[["quants"]])) == 4L
Expand Down

0 comments on commit 8916119

Please sign in to comment.