Estimate restricted MIDAS regression using non-linear least squares, when the regressor is I(1)
imidas_r(
formula,
data,
start,
Ofunction = "optim",
weight_gradients = NULL,
...
)
a midas_r
object which is the list with the following elements:
the estimates of parameters of restrictions
the estimates of MIDAS coefficients of MIDAS regression
model data
unrestricted regression estimated using midas_u
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.
optimisation function for non-linear least squares problem solved in restricted MIDAS regression
the function which evaluates the right-hand side of the MIDAS regression
the function which generates the MIDAS coefficients of MIDAS regression
the output of optimisation procedure
the list containing the name of optimisation function together with arguments for optimisation function
the starting values used in optimisation
the starting values as a list
the call to the function
terms object
gradient of NLS objective function
hessian of NLS objective function
gradient function of MIDAS weight functions
the environment in which data is placed
TRUE if user supplied gradient is used, FALSE otherwise
the number of effective observations
the convergence message
the fitted values of MIDAS regression
the residuals of MIDAS regression
formula for restricted MIDAS regression. Formula must include fmls
function
a named list containing data with mixed frequencies
the starting values for optimisation. Must be a list with named elements
the list with information which R function to use for optimisation
The list must have element named Ofunction
which contains character string of chosen R
function. Other elements of the list are the arguments passed to this function.
The default optimisation function is optim
with argument method="BFGS"
.
Other supported functions are nls
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 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 .gradient
.
additional arguments supplied to optimisation function
Virmantas Kvedaras, Vaidotas Zemlys
Given MIDAS regression:
$$y_t=\sum_{j=0}^k\sum_{i=0}^{m-1}\theta_{jm+i} x_{(t-j)m-i}+\mathbf{z_t}\beta+u_t$$
estimate the parameters of the restriction
$$\theta_h=g(h,\lambda),$$ where \(h=0,...,(k+1)m\), together with coefficients \(\beta\) corresponding to additional low frequency regressors.
It is assumed that \(x\) is a I(1) process, hence the special transformation is made. After the transformation midas_r is used for estimation.
MIDAS regression involves times series with different frequencies.
The restriction function must return the restricted coefficients of the MIDAS regression.
midas_r.midas_r
theta.h0 <- function(p, dk) {
i <- (1:dk-1)/100
pol <- p[3]*i + p[4]*i^2
(p[1] + p[2]*i)*exp(pol)
}
theta0 <- theta.h0(c(-0.1,10,-10,-10),4*12)
xx <- ts(cumsum(rnorm(600*12)), frequency = 12)
##Simulate the response variable
y <- midas_sim(500, xx, theta0)
x <- window(xx, start=start(y))
imr <- imidas_r(y~fmls(x,4*12-1,12,theta.h0)-1,start=list(x=c(-0.1,10,-10,-10)))
Run the code above in your browser using DataLab