% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/restrict_beta.R
\name{restrict_beta}
\alias{restrict_beta}
\title{Restrict VAR coefficients to zero}
\usage{
restrict_beta(x, restriction_matrix)
}
\arguments{
\item{x}{A steady-state \code{bvar} object that has been passed through \code{\link{priors}}.}

\item{restriction_matrix}{A numeric matrix of dimension \code{k*p x k} where
entries of \code{0} indicate coefficients to be restricted to zero and
entries of \code{1} indicate unrestricted coefficients.}
}
\value{
The steady-state \code{bvar} object with the restriction matrix stored in
\code{setup} and the prior covariance matrix \code{Omega_beta} updated accordingly.
}
\description{
Applies zero restrictions to the VAR coefficient matrix \eqn{\beta} by setting the
corresponding prior variances in \code{Omega_beta} to a value near zero (prior means are zero by default in the Minnesota prior).
}
\details{
The steady-state BVAR model takes the form

\deqn{y_t = \Psi d_t + \Pi_1(y_{t-1}-\Psi d_{t-1})+\dots+\Pi_p(y_{t-p}-\Psi d_{t-p})+u_t}

where \eqn{y_t} is an \eqn{k}-dimensional vector of endogenous variables at time \eqn{t}, and \eqn{d_t} is
a \eqn{q}-dimensional vector of deterministic (exogenous) variables at time \eqn{t}.
Here \eqn{\Pi_\ell} for \eqn{\ell=1,\dots,p} is a \eqn{(k \times k)} matrix of autoregressive parameters,
and \eqn{\Psi} is a \eqn{(k \times q)} matrix of steady-state parameters.
One can stack the (transposed) \eqn{\Pi_i} matrices in the \eqn{(kp \times k)} matrix \eqn{\beta}
\deqn{\beta=\begin{bmatrix}\Pi'_1 \\ \vdots  \\\Pi'_p\end{bmatrix}}

This function puts zero restrictions on the elements of \eqn{\beta}.
}
\examples{
yt <- matrix(rnorm(50), 25, 2)

bvar_obj <- bvar(data = yt)

bvar_obj <- setup(bvar_obj, p=2)

bvar_obj <- priors(bvar_obj,
                   theta_Psi = rep(0, 2),
                   Omega_Psi = diag(0.1, 2, 2))
                   
p <- bvar_obj$setup$p
k <- bvar_obj$setup$k

restriction_matrix <- matrix(1,k*p,k, dimnames=list(NULL,c("y1","y2")))

#restrict beta so y2 does not granger-cause y1

restriction_matrix[2, 1] <- 0
restriction_matrix[4, 1] <- 0

print(restriction_matrix)

bvar_obj <- restrict_beta(bvar_obj, restriction_matrix)
}
