Description Usage Arguments Details Value Author(s) References Examples
Estimate restricted MIDAS regression using nonlinear least squares.
1 2 
formula 
formula for restricted MIDAS regression or 
data 
a named list containing data with mixed frequencies 
start 
the starting values for optimisation. Must be a list with named elements. 
Ofunction 
the list with information which R function to use for optimisation. The list must have element named 
weight_gradients 
a named list containing gradient functions of weights. The weight gradient function must return the matrix with dimensions
d_k \times q, where d_k and q are the number of coefficients in unrestricted and restricted regressions correspondingly.
The names of the list should coincide with the names of weights used in formula.
The default value is NULL, which means that the numeric approximation of weight function gradient is calculated. If the argument is not NULL, but the
name of the weight used in formula is not present, it is assumed that there exists an R function which has
the name of the weight function appended with 
... 
additional arguments supplied to optimisation function 
Given MIDAS regression:
y_t = ∑_{j=1}^pα_jy_{tj} +∑_{i=0}^{k}∑_{j=0}^{l_i}β_{j}^{(i)}x_{tm_ij}^{(i)} + u_t,
estimate the parameters of the restriction
β_j^{(i)}=g^{(i)}(j,λ).
Such model is a generalisation of so called ADLMIDAS regression. It is not required that all the coefficients should be restricted, i.e the function g^{(i)} might be an identity function. Model with no restrictions is called UMIDAS model. The regressors x_τ^{(i)} must be of higher (or of the same) frequency as the dependent variable y_t.
MIDASAR* (a model with a common factor, see (Clements and Galvao, 2008)) can be estimated by specifying additional argument, see an example.
The restriction function must return the restricted coefficients of the MIDAS regression.
a midas_r
object which is the list with the following elements:
coefficients 
the estimates of parameters of restrictions 
midas_coefficients 
the estimates of MIDAS coefficients of MIDAS regression 
model 
model data 
unrestricted 
unrestricted regression estimated using 
term_info 
the named list. Each element is a list with the information about the term, such as its frequency, function for weights, gradient function of weights, etc. 
fn0 
optimisation function for nonlinear least squares problem solved in restricted MIDAS regression 
rhs 
the function which evaluates the righthand side of the MIDAS regression 
gen_midas_coef 
the function which generates the MIDAS coefficients of MIDAS regression 
opt 
the output of optimisation procedure 
argmap_opt 
the list containing the name of optimisation function together with arguments for optimisation function 
start_opt 
the starting values used in optimisation 
start_list 
the starting values as a list 
call 
the call to the function 
terms 
terms object 
gradient 
gradient of NLS objective function 
hessian 
hessian of NLS objective function 
gradD 
gradient function of MIDAS weight functions 
Zenv 
the environment in which data is placed 
use_gradient 
TRUE if user supplied gradient is used, FALSE otherwise 
nobs 
the number of effective observations 
convergence 
the convergence message 
fitted.values 
the fitted values of MIDAS regression 
residuals 
the residuals of MIDAS regression 
Virmantas Kvedaras, Vaidotas Zemlys
Clements, M. and Galvao, A., Macroeconomic Forecasting With MixedFrequency Data: Forecasting Output Growth in the United States, Journal of Business and Economic Statistics, Vol.26 (No.4), (2008) 546554
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47  ##The parameter function
theta_h0 < function(p, dk, ...) {
i < (1:dk1)/100
pol < p[3]*i + p[4]*i^2
(p[1] + p[2]*i)*exp(pol)
}
##Generate coefficients
theta0 < theta_h0(c(0.1,10,10,10),4*12)
##Plot the coefficients
plot(theta0)
##Generate the predictor variable
xx < ts(arima.sim(model = list(ar = 0.6), 600 * 12), frequency = 12)
##Simulate the response variable
y < midas_sim(500, xx, theta0)
x < window(xx, start=start(y))
##Fit restricted model
mr < midas_r(y~fmls(x,4*121,12,theta_h0)1,
list(y=y,x=x),
start=list(x=c(0.1,10,10,10)))
##Include intercept and trend in regression
mr_it < midas_r(y~fmls(x,4*121,12,theta_h0)+trend,
list(data.frame(y=y,trend=1:500),x=x),
start=list(x=c(0.1,10,10,10)))
data("USrealgdp")
data("USunempr")
y.ar < diff(log(USrealgdp))
xx < window(diff(USunempr), start = 1949)
trend < 1:length(y.ar)
##Fit AR(1) model
mr_ar < midas_r(y.ar ~ trend + mls(y.ar, 1, 1) +
fmls(xx, 11, 12, nealmon),
start = list(xx = rep(0, 3)))
##First order MIDASAR* restricted model
mr_arstar < midas_r(y.ar ~ trend + mls(y.ar, 1, 1, "*")
+ fmls(xx, 11, 12, nealmon),
start = list(xx = rep(0, 3)))

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.