File Exchange

image thumbnail

"MIDAS Analytic'' extension to the MIDAS MATLAB Toolbox

version 0.1.0 (531 KB) by Alexander Kostrov
"MIDAS Analytic'' extension supports estimating MIDAS regressions via MIDAS-NLS with revised optimization.


Updated 16 Oct 2020

View License

The "MIDAS Analytic'' extension contains functions to perform MIDAS regression analysis with Beta or Exponential Almon lags and to make predictions based on the estimated parameters.
The user manual attached explains how to handle the main functions for
- a classical MIDAS regression (incl. DL-MIDAS, ADL-MIDAS, and FADL-MIDAS): reg_midas_analytic,
- a multivariate MIDAS regression: reg_mvmidas_analytic,
- a MIDAS logit regression: logit_midas_analytic,
- a MIDAS VAR regression: var_midas_analytic.
This extension can be used autonomously or alongside the MIDAS MATLAB Toolbox which is available on the MATLAB Central File Exchange (No. 45150) webpage.

Cite As

A. Kostrov (2020) Estimating MIDAS regressions via MIDAS-NLS with revised optimization. Working paper.

Comments and Ratings (10)

Alexander Kostrov

Dear Cheng,
1,3) Design of the forecasting procedure is defined by the user. You should code it up manually: Use a loop for recursive estimation and select the “horizon” by shifting data accordingly.
2) If you need the out-of-sample prediction only, then you should apply predict_reg_mvmidas() function to 1000 observations left out.

zhou lan cheng

Dear Alexander Kostrov,
Thank you for your sharing.I have some questions when I run the codes about Multivariate MIDAS model.
1.There is no setting of "Horizon"(number of (high frequency) lags from which lagged high frequency regressors start.)
2.Assuming the full sample is 4000, I want to use the first 3000 data for in-sample estimation, and the remaining 1000 data for out-of-sample prediction. I first use reg_mvmidas_analytic.m to run the 3000 data, and then use predict_reg_mvmidas.m to run the full sample. Is my understanding correct?
3.If I want to use recursive estimation, what should I do?


Dear Alexander Kostrov,
Thank you. The issue has been solved!


Dear Alexander Kostrov,
I sincerely thank you for your reply. I executed lines 1-31 of Example_logit_MIDAS.m. And the reuslts show that y is the 2000x1 vector and Z is the 2000x22 matrix. However, when i run lines 33-35, the error appeared,which is "The value of 'y' is not valid. Matrix dimensions must be consistent."
How to solve this question? Thank you very much.

Alexander Kostrov

Dear CHU ZX,

This code runs smoothly on my machine. Let's try to figure out what goes wrong.
The error that you encounter means that the dimensions of y and Z are not consistent.
You might execute lines 1-31 of Example_logit_MIDAS.m and check these two objects in the output
of sim_logit_midas() function: By default, y should be the 2000x1 vector and Z should be the 2000x22 matrix.
If y is empty, you are probably missing the Statistics and Machine Learning Toolbox and binornd() function is not available.
Please reply with an update on your issue.


Dear Alexander Kostrov,
Thank you very much for sharing. When I try to run your "Example_logit_MIDAS.m", it always reports an error:
Wrong use of Logit_ midas_ analytic (line 33)
The value of 'y' is not valid. Matrix dimensions must be consistent.

璐 王

Dear Alexander Kostrov,
I sincerely thank you for your reply, which is very helpful to me and the problem has been solved.
Wish you all the best!

Alexander Kostrov

Dear Lu Wang,
Thanks for your question. If I understand correctly, the error is caused by predict_weights_mv()
function in "Example_reg_mvMIDAS.m". Predict_weights_mv() calls another function, predict_weights(), which
is in the "Classical MIDAS" folder.
One should specify the path to that folder using addpath('D:\MIDAS analytic0.1\Classical MIDAS') with an adjusted path. Another solution is to copy predict_weights() function from the "Classical MIDAS" folder to the "Multivariate MIDAS" folder. I hope this helps.

璐 王

错误使用 predict_weights (line 17)
Wrong polynomial: should be "beta"
Hello, thank you very much for sharing your valuable code. When I try to run your "Example_reg_mvMIDAS.m", it always reports an error:
出错 predict_weights_mv (line 16)
[temp_weights_mat,temp_bweights_mat] = predict_weights(args_temp, 'expalm',pZ(i));

出错 Example_reg_mvMIDAS (line 42)
[w_mat, bw_mat] = predict_weights_mv(args_hat,'expalm', pZ);
I hope you can give some guidance, what went wrong?

xiaodong yan

very nice update for MIDAS toolbox!

MATLAB Release Compatibility
Created with R2016b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Inspired by: MIDAS Matlab Toolbox

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!