covbayesvar.large_bvar

Functions

FIS(Y, Z, R, T, S)

Fixed Interval Smoother (FIS) based on Durbin and Koopman, 2001, p.

MissData(y, C, R, c1)

Eliminates the rows in y, matrices C, R, and vector c1 that correspond to missing data (NaN) in y.

SKF(Y, Z, R, T, Q, A_0, P_0, c1, c2)

Kalman filter for stationary systems with time-varying system matrices and missing data.

TypecastToArray(variables)

Converts a list of variables to their array equivalents, if applicable.

VARcf_DKcks(X, p, beta, Su[, nDraws])

Computes conditional forecasts for the missing observations in X using a VAR, Kalman filter and the Durban and Koopman smoother.

beta_coef(x, mosd)

Computes the coefficients for the Beta distribution.

bfgsi(H0, dg, dx)

Perform a Broyden-Fletcher-Goldfarb-Shanno (BFGS) update on the inverse Hessian matrix.

bvarFcst(y, beta, hz)

Computes the forecasts for a vector autoregression (VAR) model at the specified forecast horizons.

bvarGLP(y, lags, **kwargs)

Estimate the BVAR model of Giannone, Lenza and Primiceri (2015)

bvarGLP_covid(y, lags[, priors_params])

Estimate the BVAR model of Giannone, Lenza and Primiceri (2015), augmented for changes in volatility due to Covid (March 2020).

bvarIrfs(beta, sigma, nshock, hmax[, structural])

Computes structural or reduced form Impulse Response Functions (IRFs) using Cholesky ordering.

check_params(par)

Check the parameters for acceptability and fill in defaults for unspecified ones.

cholred(S)

Compute the reduced Cholesky decomposition of a matrix.

cols(x)

Return the number of columns in a matrix x.

computeIrfs(beta, G, nshock, hmax)

Computes Impulse Response Functions (IRFs) up to a specified horizon.

csminit(fcn, x0, f0, g0, badg, H0, *varargin)

Performs a line search to find a suitable step size for optimization.

csminwel(fcn, x0, H0, grad, crit, nit, *varargin)

Minimizes a function using a quasi-Newton method.

csolve(FUN, x, gradfun, crit, itmax, *varargin)

Finds the solution to a system of nonlinear equations using iterative methods.

derivest(fun, x0, varargin)

Estimate the n'th derivative of fun at x0 and provide an error estimate.

disturbance_smoother_var(y, c, Z, G, C, B, ...)

Performs draws from the posterior of the disturbances and unobservable states of a state-space model.

drsnbrck(x)

Compute the derivative for the Rosenbrock problem.

fdamat(sr, parity, nterms)

Compute matrix for finite difference approximation (FDA) derivation.

form_companion_matrices(betadraw, G, n, ...)

Forms the matrices of the VAR companion form.

form_companion_matrices_covid(betadraw, G, ...)

Forms the matrices of the VAR companion form with COVID-related adjustments.

gamma_coef(mode, sd, plotit)

Computes the coefficients of Gamma distribution coefficients and makes plots, if requested The parameters of the Gamma distribution are k = shape parameter: affects the PDF of the Gamma distribution, including skewness and mode theta = scale parameter: affects the spread of the distribution i.e. it shrinks or stretches the distribution along the x-axis.

gradest(fun, x0)

Estimate the gradient vector of an analytical function of n variables.

hessdiag(fun, x0)

Compute the diagonal elements of the Hessian matrix (vector of second partials)

hessian(fun, x0)

Compute the Hessian matrix of second partial derivatives for a scalar function.

kfilter_const(y, c, Z, G, C, T, H, shat, sig)

Kalman filter with constant variance for the state-space model.

lag(x[, n, v])

Create a matrix or vector of lagged values.

lag_matrix(Y, lags)

Create a matrix of lagged (time-shifted) series.

logMLVAR_formcmc(par, y, x, lags, T, n, b, ...)

Compute the log-posterior (or logML if hyperpriors=0), and draws from the posterior distribution of the coefficients and of the covariance matrix of the residuals of the BVAR model by Giannone, Lenza, and Primiceri (2015).

logMLVAR_formcmc_covid(par, y, x, lags, T, ...)

Compute the log-posterior (or logML if hyperpriors=0), and draws from the posterior distribution of the coefficients and of the covariance matrix of the residuals of the BVAR model by Giannone, Lenza, and Primiceri (2015).

logMLVAR_formin(par, y, x, lags, T, n, b, ...)

Compute the log-posterior, posterior mode of the coefficients, and covariance matrix of the residuals for

logMLVAR_formin_covid(par, y, x, lags, T, n, ...)

Compute the log-posterior, posterior mode of the coefficients, and covariance matrix of the residuals for

log_beta_pdf(x, al, bet)

Compute the log probability density function (PDF) of the Beta distribution.

log_gamma_pdf(x, k, theta)

Computes the log of the Gamma probability density function (PDF) for given values.

log_ig2pdf(x, alpha, beta)

Compute the log probability density function (PDF) of the Inverse Gamma distribution.

make_positive_definite(matrix)

Ensures that a given square matrix is positive definite.

numgrad(fcn, x, *args)

Compute the numerical gradient of a given function using a central difference approximation.

ols1(y, x)

Perform Ordinary Least Squares (OLS) regression.

parse_pv_pairs(default_params, pv_pairs)

Parses sets of property-value pairs and allows defaults.

plot_joint_marginal(YY, Y1CondLim, xlab, ...)

Plots the joint distribution in the center, with marginals on the side.

plot_joint_marginal_overlay(YY_unc, YY_con, ...)

plot_joint_marginal_overlay2(YY_unc, YY_con, ...)

plot_weighted_joint_and_marginals(YY, wStar, ...)

Plots the joint distribution in the center, with marginals on the side.

printpdf(h, outfilename)

Saves the given figure as a PDF file with specified dimensions.

quantile_plot(time, quantiles[, base_color, ...])

Plots a line chart with filled quantile bands.

rombextrap(StepRatio, der_init, rombexpon)

Do Romberg extrapolation for each estimate.

rosenbrock(x)

Rosenbrock function.

runKF_DK(y, A, C, Q, R, x_0, Sig_0, c1, c2)

Runs Kalman filter using the Durbin and Koopman simulation smoother.

set_priors(y, lags, **kwargs)

This function sets up the default choices for the priors of the BVAR of Giannone, Lenza and Primiceri (2015)

set_priors_covid([priors_params])

This function sets up the default choices for the priors of the BVAR of Giannone, Lenza and Primiceri (2015), augmented with a change in volatility at the time of Covid (March 2020).

swap2(vec, ind1, val1, ind2, val2)

Swap the values at the specified indices in the input vector.

swapelement(vec, ind, val)

Replace the element at a specified index 'ind' with a new 'val' in the vector vec.

transform_data(spec, data_raw)

Transforms the raw data based on the specified transformation.

trimr(x, n1, n2)

Return a matrix (or vector) x stripped of the specified rows.

vec2mat(vec, n, m)

Forms the matrix M, such that M[i, j] = vec[i + j - 1].

verify_bvar_results(bvar_results)

Check if the first beta and sigma matrices are all zeros.

wquantile(X, p, w)

Calculate weighted quantiles for each time period.