Methods and tools for mixed frequency time series data analysis. Allows estimation, model selection and forecasting for MIDAS regressions.
The midasr R package provides econometric methods for working with mixed frequency data. The package provides tools for estimating time series MIDAS regression, where response and explanatory variables are of different frequency, e.g. quarterly vs monthly. The fitted regression model can be tested for adequacy and then used for forecasting. More specifically, the following main functions are available:
midas_r-- MIDAS regression estimation using NLS
mls-- time series embedding to lower frequency, flexible function for specifying MIDAS models
hAhr.test-- adequacy testing of MIDAS regression
forecast-- forecasting MIDAS regression
midasr_ic_table-- lag selection using information criteria
average_forecast-- calculate weighted forecast combination
select_and_forecast-- perform model selection and then use the selected model for forecasting.
The package provides the usual methods for generic functions which can be used on fitted MIDAS regression object:
logLik. It also
has additional methods for estimating robust standard errors:
The package also provides all the popular MIDAS regression restrictions such as normalized Almon exponential, normalized beta and etc.
The package development was influenced by features of the MIDAS Matlab toolbox created by Eric Ghysels.
The detailed description of the package features can be found in the User guide. All of the code examples in the user guide and some additional examples together with the user guide .Rnw file can be found in the midasr-user-guide github repository.
To install the development version of midasr, it's easiest to use the
# install.packages("devtools") library(devtools) install_github("midasr","mpiktas")
A bug fix release
Add a CITATION referencing JSS article
Fix a few minor bugs in documentation
A bug fix release
Adapt to new CRAN policy, where all the functions not belonging to base must be imported.
Add generalized exponential lag specification function
Fix a small bug in forecast.midas_r, now correct start is set when time series info is added.
Start using testthat for testing the code.
Do not lose time series information in forecast
Remove unexported code
Remove confusing functions dedicated for working with various parameters of MIDAS regression. All of the parameters can now be accessed with coef method. By default coef returns the parameters of NLS problem. With option midas=TRUE, coef returns the MIDAS weights.
Add function plot_midas_coef for graphical inspection of MIDAS weights.
Refactor simulation code, so it is more like arima.sim.
Make forecast return the object of class forecast. Add an option of calculating prediction intervals for forecasts. Currently they are computed via simple bootstraping. This allows using print, summary and plot methods from package forecast.
Move to more consistent naming convention a la Hadley Wickham, this means that dot (.) is only used for S3 method dispatch. If there is no S3 dispatch, the underscore (_) is used. This changes a lot of functions, such as hAhr.test -> hAh_test, all the gradient functions, so revisit your code for possible breakages.
Add ability to pass user defined weight gradients. See the documentation for weight_gradients option for midas_r function.
Add experimental support for nonparametric MIDAS, see Breitung et al. http://www.ect.uni-bonn.de/mitarbeiter/joerg-breitung/npmidas
Add dependency and support to the package optimx. This gives more flexibility in chosing the optimisation method.
Add data sets needed for midasr user guide.
Add GPL-2 licencing
Add function midas_r_simple for fitting MIDAS regressions without formula interface. It can be considerably faster than midas_r.
A bug fix release
Fix a bug, where the midas_r_ic_table would not work with formula containing only one term
More explicit error messages are displayed when optimisation fails or when robust covariance matrix cannot be calculated
Add progress indicator to average_forecast function
Fix a bug in data_to_list function, make forecast.midas_r work with midas_u objects.
Fix a bug in average_forecast, rolling samples were turning to recursive ones, thanks to Michael Swan for pointing it out.
Release to CRAN.
Support for the lagged dependent variable.
Support for the forecasting and forecast combinations.
Support for the model selection based on the information criteria
First version of the user guide
Milestone release. Full-fledged support for fitting MIDAS regressions without lagged dependent variable.
Robust and non-robust tests for MIDAS restriction.
The fitted model object has methods for generic functions
vcov. Additionally it has method
logLik for use with
BIC and methods
bread for use with
vcovHAC from package sandwich, i.e. there is support for computing robust standard errors for the coefficients
Three demos illustrating the use of the package. They reproduce the results from the article "The statistical content and empirical testing of the MIDAS restrictions".
Support for exogenous variables. Supply using
Option for using numerical gradients. New dependency on package numDeriv.