Learn R Programming

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.
  • midas_nlpr -- Non-linear parametric MIDAS regression estimation.
  • midas_sp -- Semi-parametric and partialy linear MIDAS regression.
  • midas_qr -- Quantile MIDAS regression.
  • mls -- time series embedding to lower frequency, flexible function for specifying MIDAS models.
  • mlsd -- time series embedding to lower frequency using available date information.
  • 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 JSS article.

Development

The stable versions of the package have version numbers x.y. All the stable versions are submitted to CRAN. The development versions have version numbers x.y.z.

To install the development version of midasr, it's easiest to use the devtools package:

# install.packages("devtools")
library(devtools)
install_github("midasr","mpiktas")

Copy Link

Version

Install

install.packages('midasr')

Monthly Downloads

702

Version

0.9

License

GPL-2 | MIT + file LICENCE

Maintainer

Vaidotas Zemlys

Last Published

April 7th, 2025

Functions in midasr (0.9)

deviance.midas_r

MIDAS regression model deviance
average_forecast

Average forecasts of MIDAS models
coef.midas_r

Extract coefficients of MIDAS regression
deviance.midas_sp

Semi-parametric MIDAS regression model deviance
fmls

Full MIDAS lag structure
expand_weights_lags

Create table of weights, lags and starting values
extract.midas_r

Extract coefficients and GOF measures from MIDAS regression object
genexp_gradient

Gradient of generalized exponential MIDAS coefficient generating function
coef.midas_sp

Extract coefficients of MIDAS regression
genexp

Generalized exponential MIDAS coefficients
harstep

HAR(3)-RV model MIDAS weights specification
imidas_r

Restricted MIDAS regression with I(1) regressors
forecast.midas_r

Forecast MIDAS regression
fitted.midas_nlpr

Fitted values for non-linear parametric MIDAS regression model
coef.midas_nlpr

Extract coefficients of MIDAS regression
check_mixfreq

Check data for MIDAS regression
fitted.midas_sp

Fitted values for semi-parametric MIDAS regression model
lcauchyp

Normalized log-Cauchy probability density function MIDAS weights specification
gompertzp

Normalized Gompertz probability density function MIDAS weights specification
get_estimation_sample

Get the data which was used to etimate MIDAS regression
hAhr_test

Test restrictions on coefficients of MIDAS regression using robust version of the test
hAh_test

Test restrictions on coefficients of MIDAS regression
midas_mmm_sim

Simulate MMM MIDAS regression model
midas_mmm_plain

MMM (Mean-Min-Max) MIDAS regression
midas_lstr_sim

Simulate LSTR MIDAS regression model
lstr

Compute LSTR term for high frequency variable
gompertzp_gradient

Gradient function for normalized Gompertz probability density function MIDAS weights specification
midas_auto_sim

Simulate simple autoregressive MIDAS model
deriv_tests

Check whether non-linear least squares restricted MIDAS regression problem has converged
midas_nlpr

Non-linear parametric MIDAS regression
midas_lstr_plain

LSTR (Logistic Smooth TRansition) MIDAS regression
midas_r

Restricted MIDAS regression
midas_r_ic_table

Create a weight and lag selection table for MIDAS regression model
+.lws_table

Combine lws_table objects
midas_r_plain

Restricted MIDAS regression
modsel

Select the model based on given information criteria
nakagamip

Normalized Nakagami probability density function MIDAS weights specification
midas_r_np

Estimate non-parametric MIDAS regression
midas_nlpr.fit

Fit restricted MIDAS regression
midas_pl_plain

MIDAS Partialy linear non-parametric regression
nealmon_gradient

Gradient function for normalized exponential Almon lag weights
midas_r.fit

Fit restricted MIDAS regression
midas_sp

Semi-parametric MIDAS regression
midas_u

Estimate unrestricted MIDAS regression
oos_prec

Out-of-sample prediction precision data on simulation example
mls

MIDAS lag structure
lcauchyp_gradient

Gradient function for normalized log-Cauchy probability density function MIDAS weights specification
midasr-package

Mixed Data Sampling Regression
harstep_gradient

Gradient function for HAR(3)-RV model MIDAS weights specification
deviance.midas_nlpr

Non-linear parametric MIDAS regression model deviance
dmls

MIDAS lag structure for unit root processes
expand_amidas

Create table of weights, lags and starting values for Ghysels weight schema
nbetaMT

Normalized beta probability density function MIDAS weights specification (MATLAB toolbox compatible)
hf_lags_table

Create a high frequency lag selection table for MIDAS regression model
midas_si_plain

MIDAS Single index regression
midas_sim

Simulate simple MIDAS regression response variable
lf_lags_table

Create a low frequency lag selection table for MIDAS regression model
midas_si_sim

Simulate SI MIDAS regression model
predict.midas_sp

Predict method for semi-parametric MIDAS regression fit
nbetaMT_gradient

Gradient function for normalized beta probability density function MIDAS weights specification (MATLAB toolbox compatible)
nakagamip_gradient

Gradient function for normalized Nakagami probability density function MIDAS weights specification
update_weights

Updates weights in MIDAS regression formula
polystep

Step function specification for MIDAS weights
midas_qr

Restricted MIDAS quantile regression
plot_lstr

Plot MIDAS coefficients
prep_hAh

Calculate data for hAh_test and hAhr_test
weights_table

Create a weight function selection table for MIDAS regression model
nbeta

Normalized beta probability density function MIDAS weights specification
predict.midas_r

Predict method for MIDAS regression fit
predict.midas_nlpr

Predict method for non-linear parametric MIDAS regression fit
midas_pl_sim

Simulate PL MIDAS regression model
mlsd

MIDAS lag structure with dates
plot_midas_coef.midas_nlpr

Plot MIDAS coefficients
simulate.midas_r

Simulate MIDAS regression response
plot_midas_coef

Plot MIDAS coefficients
nealmon

Normalized Exponential Almon lag MIDAS coefficients
nbeta_gradient

Gradient function for normalized beta probability density function MIDAS weights specification
plot_sp

Plot non-parametric part of the single index MIDAS regression
mmm

Compute MMM term for high frequency variable
split_data

Split mixed frequency data into in-sample and out-of-sample
rvsp500

Realized volatility of S&P500 index
polystep_gradient

Gradient of step function specification for MIDAS weights
select_and_forecast

Create table for different forecast horizons
agk.test

Andreou, Ghysels, Kourtellos LM test
USpayems

United States total employment non-farms payroll, monthly, seasonally adjusted.
almonp

Almon polynomial MIDAS weights specification
almonp_gradient

Gradient function for Almon polynomial MIDAS weights
amidas_table

Weight and lag selection table for aggregates based MIDAS regression model
amweights

Weights for aggregates based MIDAS regressions
USunempr

US monthly unemployment rate
UScpiqs

US quartely seasonaly adjusted consumer price index
USrealgdp

US annual gross domestic product in billions of chained 2005 dollars
USqgdp

United States gross domestic product, quarterly, seasonaly adjusted annual rate.
USeffrw

US weekly effective federal funds rate.