You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,7 @@
1
+
# dfms 0.3.0
2
+
3
+
* Added argument `quarterly.vars`, enabling mixed-frequency estimation with monthly and quarterly data following Banbura and Modugno (2014). The data matrix should contain the quarterly variables at the end of the matrix (after the monthly ones).
4
+
1
5
# dfms 0.2.2
2
6
3
7
* Replace Armadillo `inv_sympd()` by Armadillo `inv()` in C++ Kalman Filter to improve numerical robustness at a minor performance cost.
Copy file name to clipboardExpand all lines: R/DFM.R
+39-11Lines changed: 39 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
.EM_DGR<- quote(EMstepDGR(X, A, C, Q, R, F_0, P_0, cpX, n, r, sr, TT, rQi, rRi))
3
3
.EM_BM<- quote(EMstepBMOPT(X, A, C, Q, R, F_0, P_0, XW0, W, n, r, sr, TT, dgind, dnkron, dnkron_ind, rQi, rRi))
4
4
.EM_BM_idio<- quote(EMstepBMidio(X, A, C, Q, R, F_0, P_0, XW0, W, dgind, dnkron, dnkron_ind, r, p, n, sr, TT, rQi, rRi))
5
+
.EMstepBMMQ<- quote(EMstepBMMQ(X, A, C, Q, R, F_0, P_0, XW0, NW, dgind, dnkron, dnkron_ind, r, p, R_mat, n, nq, sr, TT, rQi, rRi))
5
6
.KFS<- quote(SKFS(X, A, C, Q, R, F_0, P_0))
6
7
7
8
@@ -15,6 +16,7 @@
15
16
#' @param p integer. number of lags in factor VAR.
16
17
#' @param \dots (optional) arguments to \code{\link{tsnarmimp}}.
17
18
#' @param idio.ar1 logical. Model observation errors as AR(1) processes: \eqn{e_t = \rho e_{t-1} + v_t}{e(t) = rho e(t-1) + v(t)}. \emph{Note} that this substantially increases computation time, and is generaly not needed if \code{n} is large (>30). See theoretical vignette for details.
19
+
#' @param quarterly.vars character. Names of quarterly variables in \code{X} (if any). Monthly variables should be to the left of the quarterly variables in the data matrix and quarterly observations should be provided every 3rd period.
18
20
#' @param rQ character. restrictions on the state (transition) covariance matrix (Q).
19
21
#' @param rR character. restrictions on the observation (measurement) covariance matrix (R).
20
22
#' @param em.method character. The implementation of the Expectation Maximization Algorithm used. The options are:
@@ -115,7 +117,7 @@
115
117
#' Stock, J. H., & Watson, M. W. (2016). Dynamic Factor Models, Factor-Augmented Vector Autoregressions, and Structural Vector Autoregressions in Macroeconomics. \emph{Handbook of Macroeconomics, 2}, 415–525. https://doi.org/10.1016/bs.hesmac.2016.04.002
if(!is.logical(idio.ar1) || is.na(idio.ar1)) stop("idio.ar1 needs to be logical")
231
234
if(!is.logical(pos.corr) || is.na(pos.corr)) stop("pos.corr needs to be logical")
232
235
if(!is.logical(check.increased) || is.na(check.increased)) stop("check.increased needs to be logical")
236
+
if(!is.null(quarterly.vars) &&!is.character(quarterly.vars)) stop("quarterly.vars needs to be a character vector with the names of quarterly variables in X")
# This is because after removing missing rows, the data could be complete, e.g. differencing data with diff.xts() of collapse::fdiff() just gives a NA row
263
272
if(anymiss&& length(rm.rows)) anymiss<- any(W)
264
-
BMl<-switch(tolower(em.method[1L]), auto=anymiss, dgr=FALSE, bm=TRUE, none=NA, stop("Unknown EM option:", em.method[1L]))
0 commit comments