
Fits finite DLMs for a range of lag lengths and orders the fitted models according to a desired measure.
finiteDLMauto(formula , data, x, y, q.min = 1, q.max = 10, k.order = NULL,
model.type = c("dlm","poly"), error.type = c("MASE","AIC",
"BIC","GMRAE", "MBRAE", "radj"),
trace = FALSE , type)
Returns a data.frame
including the values of goodness-of-fit measures and corresponding lag lengths.
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.
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.
A vector including the observations of predictor time series. This is not restricted to ts
objects.
A vector including the observations of dependent time series. This is not restricted to ts
objects.
An integer representing the lower limit of the range of lag lengths to be considered. If missing, it will be set to 1.
An integer representing the upper limit of the range of lag lengths to be considered. If missing, it will be set to 10.
An integer representing order of polynomial distributed lags.
The type of model to be fitted. If set to dlm
, finite distributed lag models are fitted. If set to poly
, polynomial distributed lag models are fitted.
The type of goodness-of-fit measure to be used for the selection of optimal lag length. The optimal lag length is determined according to desired goodness-of-fit measure.
If TRUE
, prints all of the goodness-of-fit measures for all fitted models.
An integer taking 1 if only x and y vectors are entered, 2 if a formula and data matrix is entered. It can be left NULL
since the correct value is checked and fixed by the code.
Agung Andiojaya <agung.andiojaya@gmail.com>, Haydar Demirhan
Maintainer: Haydar Demirhan <haydar.demirhan@rmit.edu.au>
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. Required lags of dependent series are generated by the dlm
function automatically.
If q.max
is entered greater than the length of the series, its value will be adjusted to have the length of the series for fitting the regression model.
if (FALSE) {
library(dLagM)
# Multiple independent series
data(M1Germany)
data = M1Germany[1:44,]
# Run the search over finite DLMs according to AIC values
finiteDLMauto(formula = logprice ~ interest + logm1,
data = data.frame(data), q.min = 2, q.max = 5,
model.type = "dlm", error.type = "AIC", trace = FALSE)
}
Run the code above in your browser using DataLab