cultivars.multivariate.reduced_form.mixed_frequency#

Mixed-frequency vector autoregressions: two models for two different problems.

Both models here relate series sampled at different frequencies, and that is the whole of their resemblance. They differ in which frequency the model lives at, and the difference decides everything else – estimator, result surface, and whether a maximum-likelihood fit is defensible at all.

MFVAR puts the model at the high frequency,

\[z_t = c + \sum_{i=1}^{p} A_i\, z_{t-i} + u_t, \qquad y^{\text{obs}}_{it} = \sum_{j=0}^{m-1} w_j\, z_{i,t-j} \;\;\text{on the dates a reading lands,}\]

so the monthly path is latent, a quarterly reading is a linear functional of it, and the Kalman smoother recovers the path. This is the Mariano-Murasawa state-space formulation. Its one structural elegance is that the observation matrix is constant: with the state stacking \(\max(p, m)\) lags, the calendar is not in \(Z\), it is in the missing-value pattern of the sample, and the filter already masks missing rows. Nothing about the model changes between a month in which the quarterly series is observed and one in which it is not.

MIDASVAR puts the model at the low frequency,

\[y_t = D d_t + \sum_{i=1}^{p} A_i\, y_{t-i} + B\, x_t(\theta) + u_t, \qquad x_t(\theta)_q = \sum_{j=1}^{L} w_j(\theta_q)\, x^{(q)}_{t,j}, \quad w_j \propto e^{\theta_1 j + \theta_2 j^2},\]

so each high-frequency regressor is compressed into one column per low-frequency date by a lag polynomial with two parameters, and a year of daily history costs two degrees of freedom rather than two hundred and fifty. This is Ghysels-Santa-Clara-Valkanov.

Two commitments shape the surface. First, the asymmetry in what the two classes expose is deliberate and is documented at each class. MIDASVAR estimates, by profiling the polynomial out of a Gaussian likelihood that identifies everything it touches. MFVAR does not, and the reason is recorded in its docstring rather than buried in a release note: with a temporally aggregated variable, the Gaussian likelihood is not merely flat in that variable’s own innovation variance, it is maximized away from the truth, and the error grows with the sample. A model that returns a confident wrong number is worse than one that declines, so MFVAR takes its parameters – from a VAR fitted on whatever high-frequency sample exists, through from_result – and filters with them. Second, both results are honest about what is conditional. The MIDAS standard errors condition on the estimated polynomial and say so, with joint_stderr() as the full-information alternative; both forecasts condition on a supplied future high-frequency path and refuse to invent one; and the MFVAR record, which carries the whole propagation surface because the smoothed path is complete, labels its coefficients as supplied rather than estimated.

Layout. MFVAR validates its parameters and calendar in place, builds the stacked system through _mixed_frequency_system in _core._converters with the per-kind weights of _aggregation_weights, and runs the filter and the Durbin-Koopman smoother of _LinearGaussianStateSpace from the state-space layer; smooth() packs the path into MFVARResult, which takes its summary from _SummaryMixin and its propagation surface from _VectorPropagationMixin. MIDASVAR extends _VectorAutoRegressionModel in _internals, stacks the sub-period windows with _midas_windows and the weight curves with _midas_weights from _core._polynomials, hands the profile problem to _MidasProfileObjective and _maximize_likelihood, and reuses the base’s Gaussian moments for everything conditional on theta; MIDASVARResult is a full _VectorResult with the summary, comparison, inference and propagation mixins. The closed-system estimator both lean on is vector_autoregression; the filtering substrate is state_space; the Bayesian route to an estimated mixed-frequency VAR belongs to bayes.

References

Mariano, R. S., & Murasawa, Y. (2003). A new coincident index of business cycles based on monthly and quarterly series. Journal of Applied Econometrics, 18(4), 427-443.

Ghysels, E., Santa-Clara, P., & Valkanov, R. (2004). The MIDAS touch: Mixed data sampling regression models. CIRANO Working Paper 2004s-20.

Ghysels, E., Sinko, A., & Valkanov, R. (2007). MIDAS regressions: Further results and new directions. Econometric Reviews, 26(1), 53-90.

Ghysels, E. (2016). Macroeconomics and the reality of mixed frequency data. Journal of Econometrics, 193(2), 294-314.

Schorfheide, F., & Song, D. (2015). Real-time forecasting with a mixed-frequency VAR. Journal of Business & Economic Statistics, 33(3), 366-380.

Example

One monthly indicator, two quarterly questions. A monthly pair shares a VAR(1) whose second variable is read only as a quarterly average: MFVAR, given the parameters, infers the missing months. A quarterly spending series loads on the indicator’s three months with weights rising toward the quarter’s end: MIDASVAR estimates the curve from the quarterly sample and the full monthly history:

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> A = np.array([[[0.5, 0.2], [0.3, 0.6]]])
>>> z = np.zeros((240, 2))
>>> for t in range(1, 240):
...     z[t] = A[0] @ z[t - 1] + rng.standard_normal(2)
>>> monthly = z.copy()
>>> monthly[:, 1] = np.nan
>>> quarters = np.arange(2, 240, 3)
>>> monthly[quarters, 1] = [z[t - 2 : t + 1, 1].mean() for t in quarters]
>>> latent = MFVAR(A, np.eye(2), kinds=["high", "flow"], period=3).smooth(monthly)
>>> error = latent.endog[:, 1] - z[:, 1]
>>> bool(np.sqrt(np.mean(error**2)) < 0.5 * z[:, 1].std())
True
>>> months = z[:, 0].reshape(80, 3)
>>> spending = months @ [0.2, 0.3, 0.5] + 0.2 * rng.standard_normal(80)
>>> quarterly = np.column_stack([spending, monthly[quarters, 1]])
>>> names, exog_names = ["spend", "gdp"], ["ip"]
>>> midas = MIDASVAR(quarterly, z[:, :1], order=1, period=3, names=names, exog_names=exog_names)
>>> res = midas.fit()
>>> res.midas_weights.ravel().round(2), res.midas_coefficients.round(1).ravel()
(array([0.47, 0.27, 0.25]), array([1. , 0.5]))
>>> res.forecast(1, exog_high_future=np.zeros((3, 1))).shape
(1, 2)

Classes#

MFVAR

A latent high-frequency VAR observed through temporal aggregation.

MIDASVAR

A low-frequency VAR reading high-frequency data through a lag polynomial.

MFVARResult

The latent high-frequency path implied by a mixed-frequency sample.

MIDASVARResult

A fitted MIDAS vector autoregression.