Learn R Programming

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

midasr

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.

Development

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

733

Version

0.5

License

GPL-2 | MIT + file LICENCE

Maintainer

Vaidotas Zemlys

Last Published

July 16th, 2015

Functions in midasr (0.5)

fmls

Full MIDAS lag structure
amweights

Weights for aggregates based MIDAS regressions
almonp

Almon polynomial MIDAS weights specification
get_estimation_sample

Get the data which was used to etimate MIDAS regression
dmls

MIDAS lag structure for unit root processes
deviance.midas_r

MIDAS regression model deviance
check_mixfreq

Check data for MIDAS regression
midas_auto_sim

Simulate simple autoregressive MIDAS model
genexp

Generalized exponential MIDAS coefficients
USrealgdp

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

Gradient function for HAR(3)-RV model MIDAS weights specification
hAh_test

Test restrictions on coefficients of MIDAS regression
polystep

Step function specification for MIDAS weights
simulate.midas_r

Simulate MIDAS regression response
prep_hAh

plot_midas_coef

Plot MIDAS coefficients
midas_r

Restricted MIDAS regression
select_and_forecast

Create table for different forecast horizons
nbetaMT

Normalized beta probability density function MIDAS weights specification (MATLAB toolbox compatible) Calculate MIDAS weights according to normalized beta probability density function specification. Compatible with the specification in MATLAB toolbox.
harstep

HAR(3)-RV model MIDAS weights specification
split_data

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

Restricted MIDAS regression
midas_sim

Simulate simple MIDAS regression response variable
USunempr

US monthly unemployment rate
lcauchyp

Normalized log-Cauchy probability density function MIDAS weights specification Calculate MIDAS weights according to normalized log-Cauchy probability density function specification
oos_prec

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

Gradient function for normalized Gompertz probability density function MIDAS weights specification Calculate gradient function for normalized Gompertz probability density function specification of MIDAS weights.
gompertzp

Normalized Gompertz probability density function MIDAS weights specification Calculate MIDAS weights according to normalized Gompertz probability density function specification
midas_r_ic_table

Create a weight and lag selection table for MIDAS regression model
forecast.midas_r

Forecast MIDAS regression
almonp_gradient

Gradient function for Almon polynomial MIDAS weights
nbetaMT_gradient

Gradient function for normalized beta probability density function MIDAS weights specification (MATLAB toolbox compatible) Calculate gradient function for normalized beta probability density function specification of MIDAS weights.
genexp_gradient

Gradient of feneralized exponential MIDAS coefficient generating function
coef.midas_r

Extract coefficients of MIDAS regression
weights_table

Create a weight function selection table for MIDAS regression model
modsel

Select the model based on given information criteria
midas_u

Estimate unrestricted MIDAS regression
imidas_r

Restricted MIDAS regression with I(1) regressors
deriv_tests

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

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

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

Normalized Nakagami probability density function MIDAS weights specification Calculate MIDAS weights according to normalized Nakagami probability density function specification
midasr-package

Mixed Data Sampling Regression
expand_weights_lags

Create table of weights, lags and starting values
hAhr_test

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

Gradient function for normalized log-Cauchy probability density function MIDAS weights specification Calculate gradient function for normalized log-Cauchy probability density function specification of MIDAS weights.
nakagamip_gradient

Gradient function for normalized Nakagami probability density function MIDAS weights specification Calculate gradient function for normalized Nakagami probability density function specification of MIDAS weights.
rvsp500

Realized volatility of S&P500 index
mls

MIDAS lag structure
agk.test

Andreou, Ghysels, Kourtellos LM test
nbeta

Normalized beta probability density function MIDAS weights specification Calculate MIDAS weights according to normalized beta probability density function specification
average_forecast

Average forecasts of MIDAS models
hf_lags_table

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

Gradient of step function specification for MIDAS weights
+.lws_table

Combine lws_table objects
midas_r_np

Estimate non-parametric MIDAS regression
expand_amidas

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

Gradient function for normalized beta probability density function MIDAS weights specification Calculate gradient function for normalized beta probability density function specification of MIDAS weights.
midas_r.fit

Fit restricted MIDAS regression
nealmon_gradient

Gradient function for normalized exponential Almon lag weights
USqgdp

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

Updates weights in MIDAS regression formula
predict.midas_r

Predict method for MIDAS regression fit
amidas_table

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

Normalized Exponential Almon lag MIDAS coefficients