run_model: Get nowcast from the bayesian DFM

Description Usage Arguments Value Examples

View source: R/run_model.R

Description

function extends the data matrix by the forecasting period, draws extended factor conditional on posterior parameters and makes forecast.

Usage

1
run_model(yt, k, q, m, n, Tt, Ttq, const, target, inventory, Xmat, flows)

Arguments

yt

A matrix of demeaned and standardized time series data.

k

Number of states (number of factors)

q

Lag length for state equation.

m

number of states (number of factors) x lag length for state equation (nxq)

n

Number of variables

Tt

Number of high-frequency periods.

Ttq

Number of high-frequency periods minus lag length for state equation

const

A scalar, where const = 1 for model with intercept, const = 0 for model without intercept.

target

Defines the target variable.

inventory

Inventory of the corresponding data.

Xmat

A data set containing all the time series.

flows

A list of time series variable (flow variables).

Value

A list with the mean and quantiles of the parameters, the forecast and the number of burns, draws and saves.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
yt <- as.matrix(t(Xmat))
flows = data$flows
inventory <- create_inventory(flows = data$flows, stocks = data$stocks)
k <- 2
n <- dim(yt)[1]
q <- 1
const <- 0
m <- k*q
Tt <- dim(yt)[2]
Ttq <- Tt-q
target <- c("UKGDPM.YQ")
out <- run_model(yt,k,q,m,n,Tt,Ttq,const,target,inventory,Xmat,flows)

h4sci/packagr documentation built on Jan. 7, 2021, 10:40 p.m.