get_startvals() can be used to obtain starting values for bvar(). If you
want to specify your own starting values, it is recommended to first run
get_startvals(), and then adapt the resulting bayesianVARs_startvals
object accordingly.
Usage
get_startvals(
prior_phi,
prior_sigma,
intercept,
data = NULL,
nobs = nrow(data)
)Arguments
- prior_phi
bayesianVARs_prior_phiobject. Best use constructorspecify_prior_phi().- prior_sigma
bayesianVARs_prior_sigmaobject. Best use constructorspecify_prior_sigma().- intercept
single logical or numeric indicating whether a constant term (intercept) will be included. In case of numeric input, a value of 0 is interpreted as
FALSEand a positive non-zero value asTRUE.- data
Optional. Data matrix.
- nobs
single integer, indicating the number of observations of
data.
Examples
# Access a subset of the usmacro_growth dataset
data <- usmacro_growth[,c("GDPC1", "CPIAUCSL", "FEDFUNDS")]
# Specify priors
prior_phi <- specify_prior_phi(data, lags = 1L)
prior_sigma <- specify_prior_sigma(data, quiet = TRUE)
# Get starting values
startvals <- get_startvals(prior_phi, prior_sigma, intercept = 10, data = data)
# Estimate a model
mod <- bvar(data, lags = 1L, prior_intercept = 10, draws = 10L, burnin = 0L,
startvals = startvals, quiet = TRUE)
