Learn R Programming

⚠️There's a newer version (0.9) of this package.Take me there.

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

License

GPL-2 | MIT + file LICENCE

Maintainer

Vaidotas Zemlys

Last Published

February 23rd, 2021

Functions in midasr (0.8)

almonp_gradient

Gradient function for Almon polynomial MIDAS weights
USrealgdp

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

US quartely seasonaly adjusted consumer price index
agk.test

Andreou, Ghysels, Kourtellos LM test
amidas_table

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

Almon polynomial MIDAS weights specification
USeffrw

US weekly effective federal funds rate.
USunempr

US monthly unemployment rate
USpayems

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

MIDAS lag structure for unit root processes
check_mixfreq

Check data for MIDAS regression
hAhr_test

Test restrictions on coefficients of MIDAS regression using robust version of the test
coef.midas_r

Extract coefficients of MIDAS regression
midas_auto_sim

Simulate simple autoregressive MIDAS model
fmls

Full MIDAS lag structure
deriv_tests

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

HAR(3)-RV model MIDAS weights specification
forecast.midas_r

Forecast MIDAS regression
coef.midas_sp

Extract coefficients of MIDAS regression
USqgdp

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

Weights for aggregates based MIDAS regressions
deviance.midas_r

MIDAS regression model deviance
coef.midas_nlpr

Extract coefficients of MIDAS regression
midas_mmm_plain

MMM (Mean-Min-Max) MIDAS regression
genexp

Generalized exponential MIDAS coefficients
get_estimation_sample

Get the data which was used to etimate MIDAS regression
gompertzp

Normalized Gompertz probability density function MIDAS weights specification
midas_lstr_sim

Simulate LSTR MIDAS regression model
deviance.midas_sp

Semi-parametric MIDAS regression model deviance
genexp_gradient

Gradient of generalized exponential MIDAS coefficient generating function
expand_weights_lags

Create table of weights, lags and starting values
expand_amidas

Create table of weights, lags and starting values for Ghysels weight schema
deviance.midas_nlpr

Non-linear parametric MIDAS regression model deviance
average_forecast

Average forecasts of MIDAS models
midas_nlpr.fit

Fit restricted MIDAS regression
extract.midas_r

Extract coefficients and GOF measures from MIDAS regression object
mls

MIDAS lag structure
midasr-package

Mixed Data Sampling Regression
midas_pl_plain

MIDAS Partialy linear non-parametric regression
lcauchyp

Normalized log-Cauchy probability density function MIDAS weights specification
imidas_r

Restricted MIDAS regression with I(1) regressors
gompertzp_gradient

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

Create a weight and lag selection table for MIDAS regression model
lstr

Compute LSTR term for high frequency variable
+.lws_table

Combine lws_table objects
hAh_test

Test restrictions on coefficients of MIDAS regression
fitted.midas_nlpr

Fitted values for non-linear parametric MIDAS regression model
harstep_gradient

Gradient function for HAR(3)-RV model MIDAS weights specification
fitted.midas_sp

Fitted values for semi-parametric MIDAS regression model
hf_lags_table

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

Simulate MMM MIDAS regression model
midas_nlpr

Non-linear parametric MIDAS regression
lcauchyp_gradient

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

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

Restricted MIDAS regression
midas_r.fit

Fit restricted MIDAS regression
nbetaMT

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

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

Restricted MIDAS regression
midas_lstr_plain

LSTR (Logistic Smooth TRansition) MIDAS regression
midas_r_np

Estimate non-parametric MIDAS regression
midas_si_sim

Simulate SI MIDAS regression model
midas_pl_sim

Simulate PL MIDAS regression model
modsel

Select the model based on given information criteria
midas_qr

Restricted MIDAS quantile regression
nakagamip

Normalized Nakagami probability density function MIDAS weights specification
mlsd

MIDAS lag structure with dates
nealmon_gradient

Gradient function for normalized exponential Almon lag weights
nakagamip_gradient

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

Simulate simple MIDAS regression response variable
nbeta

Normalized beta probability density function MIDAS weights specification
mmm

Compute MMM term for high frequency variable
predict.midas_nlpr

Predict method for non-linear parametric MIDAS regression fit
predict.midas_r

Predict method for MIDAS regression fit
oos_prec

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

Calculate data for hAh_test and hAhr_test
predict.midas_sp

Predict method for semi-parametric MIDAS regression fit
select_and_forecast

Create table for different forecast horizons
nealmon

Normalized Exponential Almon lag MIDAS coefficients
nbeta_gradient

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

Realized volatility of S&P500 index
midas_si_plain

MIDAS Single index regression
polystep

Step function specification for MIDAS weights
midas_sp

Semi-parametric MIDAS regression
polystep_gradient

Gradient of step function specification for MIDAS weights
simulate.midas_r

Simulate MIDAS regression response
update_weights

Updates weights in MIDAS regression formula
split_data

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

Plot MIDAS coefficients
midas_u

Estimate unrestricted MIDAS regression
plot_midas_coef.midas_nlpr

Plot MIDAS coefficients
plot_sp

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

Plot MIDAS coefficients
weights_table

Create a weight function selection table for MIDAS regression model