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

1,237

Version

0.6

License

GPL-2 | MIT + file LICENCE

Maintainer

Vaidotas Zemlys

Last Published

August 8th, 2016

Functions in midasr (0.6)

almonp

Almon polynomial MIDAS weights specification
average_forecast

Average forecasts of MIDAS models
deviance.midas_r

MIDAS regression model deviance
almonp_gradient

Gradient function for Almon polynomial MIDAS weights
agk.test

Andreou, Ghysels, Kourtellos LM test
amidas_table

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

Full MIDAS lag structure
genexp_gradient

Gradient of feneralized exponential MIDAS coefficient generating function
forecast.midas_r

Forecast 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 Calculate MIDAS weights according to normalized Gompertz probability density function specification
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.
harstep_gradient

Gradient function for HAR(3)-RV model MIDAS weights specification
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
midas_r_ic_table

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

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

HAR(3)-RV model MIDAS weights specification
midas_r_simple

Restricted MIDAS regression
midas_auto_sim

Simulate simple autoregressive MIDAS model
hf_lags_table

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

Estimate non-parametric MIDAS regression
+.lws_table

Combine lws_table objects
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.
lcauchyp

Normalized log-Cauchy probability density function MIDAS weights specification Calculate MIDAS weights according to normalized log-Cauchy probability density function specification
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.
nakagamip

Normalized Nakagami probability density function MIDAS weights specification Calculate MIDAS weights according to normalized Nakagami probability density function specification
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.
mls

MIDAS lag structure
nbeta

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

Select the model based on given information criteria
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
midasr-package

Mixed Data Sampling Regression
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.
polystep_gradient

Gradient of step function specification for MIDAS weights
plot_midas_coef

Plot MIDAS coefficients
prep_hAh

rvsp500

Realized volatility of S&P500 index
nealmon_gradient

Gradient function for normalized exponential Almon lag weights
select_and_forecast

Create table for different forecast horizons
simulate.midas_r

Simulate MIDAS regression response
predict.midas_r

Predict method for MIDAS regression fit
polystep

Step function specification for MIDAS weights
oos_prec

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

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

Create a weight function selection table for MIDAS regression model
update_weights

Updates weights in MIDAS regression formula
USrealgdp

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

US monthly unemployment rate
USpayems

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

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

Check data for MIDAS regression
dmls

MIDAS lag structure for unit root processes
deriv_tests

Check whether non-linear least squares restricted MIDAS regression problem has converged
coef.midas_r

Extract coefficients of MIDAS regression
amweights

Weights for aggregates based MIDAS regressions
midas_sim

Simulate simple MIDAS regression response variable
midas_u

Estimate unrestricted MIDAS regression
nealmon

Normalized Exponential Almon lag MIDAS coefficients
midas_r

Restricted MIDAS regression
hAh_test

Test restrictions on coefficients of MIDAS regression
hAhr_test

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

Restricted MIDAS regression with I(1) regressors