dfosr_nig: MCMC Sampling Algorithm for the Dynamic Function-on-Scalars...

Description Usage Arguments Value

View source: R/mcmc_sampler.R

Description

Runs the MCMC for the dynamic function-on-scalars regression model based on an reduced-rank expansion. Here, we assume the factor regression has AR(1) errors. This particular sampler loops over the k=1,...,K factors, so the sampler is O(T*K*p^3) instead of O(T*(K*p)^3). For this variation, we assume normal-inverse-gamma priors on the innovations.

Usage

1
2
3
4
dfosr_nig(Y, tau, X = NULL, K = NULL, use_dynamic_reg = TRUE,
  nsave = 1000, nburn = 1000, nskip = 2, mcmc_params = list("beta",
  "fk", "alpha", "mu_k", "ar_phi"), X_Tp1 = 1, use_obs_SV = FALSE,
  includeBasisInnovation = FALSE, Con_mat = NULL)

Arguments

Y

the T x m data observation matrix, where T is the number of time points and m is the number of observation points (NAs allowed)

tau

the m x d matrix of coordinates of observation points

X

the T x p matrix of predictors; if NULL, only include an intercept

K

the number of factors; if NULL, use SVD-based proportion of variability explained

use_dynamic_reg

logical; if TRUE, regression coefficients are dynamic (with random walk models), otherwise independent

nsave

number of MCMC iterations to record

nburn

number of MCMC iterations to discard (burin-in)

nskip

number of MCMC iterations to skip between saving iterations, i.e., save every (nskip + 1)th draw

mcmc_params

named list of parameters for which we store the MCMC output; must be one or more of

  • "beta" (dynamic factors)

  • "fk" (loading curves)

  • "alpha" (regression coefficients; possibly dynamic)

  • "mu_k" (intercept term for factor k)

  • "ar_phi" (AR coefficients for each k under AR(1) model)

  • "sigma_et" (observation error SD; possibly dynamic)

  • "Yhat" (fitted values)

  • "Ypred" (posterior predictive values)

  • "Yfore" (one-step forecast; includes the estimate and the distribution)

X_Tp1

the p x 1 matrix of predictors at the forecasting time point T + 1

use_obs_SV

logical; when TRUE, include a stochastic volatility model for the observation error variance

includeBasisInnovation

logical; when TRUE, include an iid basis coefficient term for residual correlation (i.e., the idiosyncratic error term for a factor model on the full basis matrix)

Con_mat

a Jc x m matrix of constraints for the loading curves such that Con_mat*fk = 0 for each loading curve fk; default is NULL for no constraints.

Value

A named list of the nsave MCMC samples for the parameters named in mcmc_params


drkowal/dfosr documentation built on May 7, 2020, 3:09 p.m.