Mixed Data Sampling Regression

Methods and tools for mixed frequency time series data analysis. Allows estimation, model selection and forecasting for MIDAS regressions.

Travis-CI Build Status codecov.io CRAN_Status_Badge Downloads

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
  • hAh.test and 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: summary, coef, residuals, deviance, fitted, predict, logLik. It also has additional methods for estimating robust standard errors: estfun and bread.

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 package has the project webpage and you can follow its development on github.

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 devtools package:

# install.packages("devtools")


midasr 0.6

A bug fix release

  • Add a CITATION referencing JSS article

  • Fix a few minor bugs in documentation

midasr 0.5

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

midasr 0.4

  • 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.

midasr 0.3

  • 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.

midasr 0.2

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.

midasr 0.1

Release to CRAN.

midasr 0.0.8

  • Milestone release.

  • 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

midasr 0.0.6

  • 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 coef, deviance, fitted, residuals, predict, print, residuals, summary and vcov. Additionally it has method logLik for use with AIC and BIC and methods estfun and 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".

midasr 0.0.2

  • Support for exogenous variables. Supply using exo parameter.

  • Option for using numerical gradients. New dependency on package numDeriv.

midasr 0.0.1

  • Initial release. Very basic functionality. Currently only one predictor variable is allowed. Full functionality of the package is reflected in help page of function hAh.test.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.6 by Vaidotas Zemlys, 3 years ago


Report a bug at https://github.com/mpiktas/midasr/issues

Browse source code at https://github.com/cran/midasr

Authors: Virmantas Kvedaras <[email protected]> , Vaidotas Zemlys <[email protected]>

Documentation:   PDF Manual  

Task views: Econometrics

GPL-2 | MIT + file LICENCE license

Imports MASS, numDeriv, Matrix, forecast, stats, graphics, utils

Depends on sandwich, optimx

Suggests testthat

See at CRAN