Bayesian Dynamic Factor Model Objects
dfm
is used to create objects of class "dfm"
.
A plot function for objects of class "dfm"
.
dfm(x, lambda = NULL, fac, sigma_u = NULL, a = NULL, sigma_v = NULL) ## S3 method for class 'dfm' plot(x, ci = 0.95, ...)
x |
an object of class |
lambda |
an MN \times S matrix of MCMC coefficient draws of factor loadings of the measurement equation. |
fac |
an NT \times S matrix of MCMC draws of the factors in the transition equation, where the first N rows correspond to the N factors in period 1 and the next N rows to the factors in period 2 etc. |
sigma_u |
an M \times S matrix of MCMC draws for the error variances of the measurement equation. |
a |
a pN^2 \times S matrix of MCMC coefficient draws of the transition equation. |
sigma_v |
an N \times S matrix of MCMC draws for the error variances of the transition equation. |
ci |
interval used to calculate credible bands. |
... |
further graphical parameters. |
The function produces a standardised object from S draws of a Gibbs sampler (after the burn-in phase) for the dynamic factor model (DFM) with measurement equation
x_t = λ f_t + u_t,
where x_t is an M \times 1 vector of observed variables, f_t is an N \times 1 vector of unobserved factors and λ is the corresponding M \times N matrix of factor loadings. u_t is an M \times 1 error term.
The transition equation is
f_t = ∑_{i=1}^{p} A_i f_{t - i} + v_t,
where A_i is an N \times N coefficient matrix and v_t is an N \times 1 error term.
An object of class "dfm"
containing the following components, if specified:
x |
the standardised time-series object of observable variables. |
lambda |
an S \times MN "mcmc" object of draws of factor loadings of the measurement equation. |
factor |
an S \times NT "mcmc" object of draws of factors. |
sigma_u |
an S \times M "mcmc" object of variance draws of the measurement equation. |
a |
an S \times pN^2 "mcmc" object of coefficient draws of the transition equation. |
sigma_v |
an S \times N "mcmc" object of variance draws of the transition equation. |
specifications |
a list containing information on the model specification. |
# Load data data("bem_dfmdata") # Generate model data model <- gen_dfm(x = bem_dfmdata, p = 1, n = 1, iterations = 20, burnin = 10) # Number of iterations and burnin should be much higher. # Add prior specifications model <- add_priors(model, lambda = list(v_i = .01), sigma_u = list(shape = 5, rate = 4), a = list(v_i = .01), sigma_v = list(shape = 5, rate = 4)) # Obtain posterior draws object <- dfmpost(model) # Load data data("bem_dfmdata") # Generate model data model <- gen_dfm(x = bem_dfmdata, p = 1, n = 1, iterations = 20, burnin = 10) # Number of iterations and burnin should be much higher. # Add prior specifications model <- add_priors(model, lambda = list(v_i = .01), sigma_u = list(shape = 5, rate = 4), a = list(v_i = .01), sigma_v = list(shape = 5, rate = 4)) # Obtain posterior draws object <- draw_posterior(model) # Plot factors plot(object)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.