Learn R Programming

dLagM (version 1.0.2)

ardlDlm: Implement finite autoregressive distributed lag model

Description

A function that applies autoregressive distributed lag models of order (p , q) with one predictor.

Usage

ardlDlm(formula = NULL , data = NULL , x = NULL , y = NULL , p = 1 , q = 1 , 
         remove.p = NULL , remove.q = NULL , show.summary = TRUE)

Arguments

formula

A formula object for the model to be fitted. In the case of multiple predictor series, the model should be entered via a formula object.

data

A data.frame including all dependent and independent series. In the case of multiple predictor series, the data should be entered via the data argument.

x

A vector including the observations of predictor time series. This is not restricted to ts objects.

y

A vector including the observations of dependent time series. This is not restricted to ts objects.

p

An integer representing the order of autoregressive process.

q

An integer representing finite lag length.

remove.p

A matrix or vector showing the lags of independent series to be removed from the full model for each independent series. Please see the details for the construction of this argument.

remove.q

A vector showing the autoregressive lags to be removed from the full model. Please see the details for the construction of this argument.

show.summary

If TRUE, prints standard model summary for the model of interest.

Value

model

An object of class lm. See the details of lm function.

order

A vector composed of \(p\) and \(q\) orders.

removed.p

A matrix or vector showing the lags of independent series to be removed from the full model.

removed.q

A vector showing the autoregressive lags to be removed from the full model.

formula

Model formula of the fitted model. This is returned if multiple independent series are entered.

data

A data.frame including all dependent and independent series. This is returned if multiple independent series are entered.

Details

The autoregressive DLM is a flexible and parsimonious infinite distributed lag model. The model ARDL\((p, q)\) is written as

$$ Y_{t} = \mu+ \beta_{0}X_{t}+\beta_{1}X_{t-1}+\cdots +\beta_{p}X_{t-p}+\gamma_{1}Y_{t-1}+\cdots+\gamma_{q}Y_{t-q}+e_{t}. $$

When there is only one predictor series, both of model and formula objects can be used. But when they are supplied, both x and y arguments should be NULL.

The variable names in formula must match with the names of variables in data argument and it must be in the form of a generic formula for R functions.

The argument data contains dependent series and independent series.

The argument remove.p is used to specify which lags of each independent series will be removed from the full model. Each row of remove.p includes the numbers of lags to be removed in its columns and the rest of the elements should be set to NA.

The argument remove.q is used to specify the autoregressive lags of dependent series to be removed from the full model.

References

B.H. Baltagi. Econometrics, Fifth Ed. Springer, 2011.

R.C. Hill, W.E. Griffiths, G.G. Judge. Undergraduate Econometrics. Wiley, 2000.

Examples

Run this code
# NOT RUN {
# Only one independent series
data(warming)
model.ardl = ardlDlm(x = warming$NoMotorVehicles, 
y = warming$Warming, p = 1 , q = 1 , show.summary = TRUE)

# Remove some lags
rem.p = c(1)
rem.q = c(1,3)
model.ardl = ardlDlm(x = warming$NoMotorVehicles, 
y = warming$Warming, p = 2 , q = 3 , remove.p = rem.p, 
remove.q = rem.q, show.summary = TRUE)

# Multiple independent series
data(M1Germany)
data = M1Germany[1:144,]
model.ardlDlm  = ardlDlm(formula = logprice ~ interest + logm1, 
       data = data.frame(data) , p = 2 , q = 1 , show.summary = TRUE)
       
rem.p = matrix(c(1,2, NA), 3 , 1)
rem.q = c(1)
model.ardlDlm  = ardlDlm(formula = logprice ~ interest + logm1, 
       data = data.frame(data) , p = 2 , q = 2 , remove.p = rem.p, 
       remove.q = rem.q , show.summary = TRUE)
# }

Run the code above in your browser using DataLab