View source: R/regarima_specTS.R
regarima_spec_tramoseats | R Documentation |
Function to create (and/or modify) a c("regarima_spec","TRAMO_SEATS")
class object with the RegARIMA model specification
for the TRAMO-SEATS method. The object can be created from the name (character
) of a predefined 'JDemetra+' model specification,
a previous specification (c("regarima_spec","TRAMO_SEATS")
object) or a TRAMO-SEATS RegARIMA model (c("regarima","TRAMO_SEATS")
).
regarima_spec_tramoseats(
spec = c("TRfull", "TR0", "TR1", "TR2", "TR3", "TR4", "TR5"),
preliminary.check = NA,
estimate.from = NA_character_,
estimate.to = NA_character_,
estimate.first = NA_integer_,
estimate.last = NA_integer_,
estimate.exclFirst = NA_integer_,
estimate.exclLast = NA_integer_,
estimate.tol = NA_integer_,
estimate.eml = NA,
estimate.urfinal = NA_integer_,
transform.function = c(NA, "Auto", "None", "Log"),
transform.fct = NA_integer_,
usrdef.outliersEnabled = NA,
usrdef.outliersType = NA,
usrdef.outliersDate = NA,
usrdef.outliersCoef = NA,
usrdef.varEnabled = NA,
usrdef.var = NA,
usrdef.varType = NA,
usrdef.varCoef = NA,
tradingdays.mauto = c(NA, "Unused", "FTest", "WaldTest"),
tradingdays.pftd = NA_integer_,
tradingdays.option = c(NA, "TradingDays", "WorkingDays", "UserDefined", "None"),
tradingdays.leapyear = NA,
tradingdays.stocktd = NA_integer_,
tradingdays.test = c(NA, "Separate_T", "Joint_F", "None"),
easter.type = c(NA, "Unused", "Standard", "IncludeEaster", "IncludeEasterMonday"),
easter.julian = NA,
easter.duration = NA_integer_,
easter.test = NA,
outlier.enabled = NA,
outlier.from = NA_character_,
outlier.to = NA_character_,
outlier.first = NA_integer_,
outlier.last = NA_integer_,
outlier.exclFirst = NA_integer_,
outlier.exclLast = NA_integer_,
outlier.ao = NA,
outlier.tc = NA,
outlier.ls = NA,
outlier.so = NA,
outlier.usedefcv = NA,
outlier.cv = NA_integer_,
outlier.eml = NA,
outlier.tcrate = NA_integer_,
automdl.enabled = NA,
automdl.acceptdefault = NA,
automdl.cancel = NA_integer_,
automdl.ub1 = NA_integer_,
automdl.ub2 = NA_integer_,
automdl.armalimit = NA_integer_,
automdl.reducecv = NA_integer_,
automdl.ljungboxlimit = NA_integer_,
automdl.compare = NA,
arima.mu = NA,
arima.p = NA_integer_,
arima.d = NA_integer_,
arima.q = NA_integer_,
arima.bp = NA_integer_,
arima.bd = NA_integer_,
arima.bq = NA_integer_,
arima.coefEnabled = NA,
arima.coef = NA,
arima.coefType = NA,
fcst.horizon = NA_integer_
)
spec |
the model specification. It can be the name ( |
preliminary.check |
a The time span of the series, which is the (sub)period used to estimate the regarima model, is controlled by the following six variables:
|
estimate.from |
a character in format "YYYY-MM-DD" indicating the start of the time span (e.g. "1900-01-01").
It can be combined with the parameter |
estimate.to |
a |
estimate.first |
|
estimate.last |
|
estimate.exclFirst |
|
estimate.exclLast |
|
estimate.tol |
|
estimate.eml |
|
estimate.urfinal |
|
transform.function |
the transformation of the input series: |
transform.fct |
Control variables for the pre-specified outliers. Said pre-specified outliers are used in the model only when enabled
( |
usrdef.outliersEnabled |
|
usrdef.outliersType |
a vector defining the outliers' type. Possible types are: |
usrdef.outliersDate |
a vector defining the outliers' date. The dates should be characters in format "YYYY-MM-DD".
E.g.: |
usrdef.outliersCoef |
a vector providing fixed coefficients for the outliers. The coefficients can't be fixed if
the parameter Control variables for the user-defined variables: |
usrdef.varEnabled |
|
usrdef.var |
a time series ( |
usrdef.varType |
a vector of character(s) defining the user-defined variables component type.
Possible types are: |
usrdef.varCoef |
a vector providing fixed coefficients for the user-defined variables. The coefficients can't be fixed if
|
tradingdays.mauto |
defines whether the calendar effects should be added to the model manually ( |
tradingdays.pftd |
Control variables for the manual selection of calendar effects variables ( |
tradingdays.option |
to choose the trading days regression variables: |
tradingdays.leapyear |
|
tradingdays.stocktd |
numeric indicating the day of the month when inventories and other stock are reported (to denote the last day of the month set the variable to 31). Modifications of this variable are taken into account only when |
tradingdays.test |
defines the pre-tests of the trading day effects: |
easter.type |
a |
easter.julian |
|
easter.duration |
|
easter.test |
|
outlier.enabled |
The time span of the series to be searched for outliers is controlled by the following six variables:
|
outlier.from |
a character in format "YYYY-MM-DD" indicating the start of the time span (e.g. "1900-01-01").
It can be combined with |
outlier.to |
a character in format "YYYY-MM-DD" indicating the end of the time span (e.g. "2020-12-31").
It can be combined with |
outlier.first |
|
outlier.last |
|
outlier.exclFirst |
|
outlier.exclLast |
|
outlier.ao |
|
outlier.tc |
|
outlier.ls |
|
outlier.so |
|
outlier.usedefcv |
|
outlier.cv |
|
outlier.eml |
|
outlier.tcrate |
|
automdl.enabled |
Control variables for the automatic modelling of the ARIMA model ( |
automdl.acceptdefault |
|
automdl.cancel |
|
automdl.ub1 |
|
automdl.ub2 |
|
automdl.armalimit |
|
automdl.reducecv |
|
automdl.ljungboxlimit |
|
automdl.compare |
Control variables for the non-automatic modelling of the ARIMA model ( |
arima.mu |
|
arima.p |
|
arima.d |
|
arima.q |
|
arima.bp |
|
arima.bd |
|
arima.bq |
Control variables for the user-defined ARMA coefficients. Such coefficients can be defined for the regular and seasonal autoregressive (AR) polynomials
and moving average (MA) polynomials. The model considers the coefficients only if the procedure for their estimation ( |
arima.coefEnabled |
|
arima.coef |
a vector providing the coefficients for the regular and seasonal AR and MA polynomials.
The length of the vector must be equal to the sum of the regular and seasonal AR and MA orders. The coefficients shall be provided in the following order:
regular AR (Phi - |
arima.coefType |
avector defining the ARMA coefficients estimation procedure. Possible procedures are:
|
fcst.horizon |
|
The available predefined 'JDemetra+' model specifications are described in the table below:
Identifier | | Log/level detection | | Outliers detection | | Calendar effects | | ARIMA |
TR0 | | NA | | NA | | NA | | Airline(+mean) |
TR1 | | automatic | | AO/LS/TC | | NA | | Airline(+mean) |
TR2 | | automatic | | AO/LS/TC | | 2 td vars + Easter | | Airline(+mean) |
TR3 | | automatic | | AO/LS/TC | | NA | | automatic |
TR4 | | automatic | | AO/LS/TC | | 2 td vars + Easter | | automatic |
TR5 | | automatic | | AO/LS/TC | | 7 td vars + Easter | | automatic |
TRfull | | automatic | | AO/LS/TC | | automatic | | automatic |
A list of class c("regarima_spec","TRAMO_SEATS")
with the following components, each referring to a different part
of the RegARIMA model specification, mirroring the arguments of the function (for details, see the arguments description).
Each lowest-level component (except the span, pre-specified outliers, user-defined variables and pre-specified ARMA coefficients)
is structured within a data frame with columns denoting different variables of the model specification and rows referring to:
first row = the base specification, as provided within the argument spec
;
second row = user modifications as specified by the remaining arguments of the function (e.g.: arima.d
);
and third row = the final model specification, values that will be used in the function regarima
.
The final specification (third row) shall include user modifications (row two) unless they were wrongly specified.
The pre-specified outliers, user-defined variables and pre-specified ARMA coefficients consist of a list
with the Predefined
(base model specification) and Final
values.
estimate |
a data frame containing Variables referring to: |
transform |
a data frame containing variables referring to: |
regression |
a list containing information on the user-defined variables ( The |
outliers |
a data frame. Variables referring to:
|
arima |
a list containing a data frame with the ARIMA settings ( |
forecast |
a data frame with the forecasting horizon (argument |
span |
a matrix containing the final time span for the model estimation and outliers' detection.
It contains the same information as the variable span in the data frames estimate and outliers.
The matrix can be also accessed with the function |
More information and examples related to 'JDemetra+' features in the online documentation: https://jdemetra-new-documentation.netlify.app/
myseries <- ipi_c_eu[, "FR"]
myspec1 <- regarima_spec_tramoseats(spec = "TRfull")
myreg1 <- regarima(myseries, spec = myspec1)
# To modify a pre-specified model specification
myspec2 <- regarima_spec_tramoseats(spec = "TRfull",
tradingdays.mauto = "Unused",
tradingdays.option = "WorkingDays",
easter.type = "Standard",
automdl.enabled = FALSE, arima.mu = TRUE)
myreg2 <- regarima(myseries, spec = myspec2)
# To modify the model specification of a "regarima" object
myspec3 <- regarima_spec_tramoseats(myreg1,
tradingdays.mauto = "Unused",
tradingdays.option = "WorkingDays",
easter.type = "Standard", automdl.enabled = FALSE,
arima.mu = TRUE)
myreg3 <- regarima(myseries, myspec3)
# To modify the model specification of a "regarima_spec" object
myspec4 <- regarima_spec_tramoseats(myspec1,
tradingdays.mauto = "Unused",
tradingdays.option = "WorkingDays",
easter.type = "Standard",
automdl.enabled = FALSE, arima.mu = TRUE)
myreg4 <- regarima(myseries, myspec4)
# Pre-specified outliers
myspec1 <- regarima_spec_tramoseats(spec = "TRfull",
usrdef.outliersEnabled = TRUE,
usrdef.outliersType = c("LS", "LS"),
usrdef.outliersDate = c("2008-10-01" ,"2003-01-01"),
usrdef.outliersCoef = c(10, -8), transform.function = "None")
s_preOut(myspec1)
myreg1 <- regarima(myseries, myspec1)
myreg1
s_preOut(myreg1)
# User-defined variables
var1 <- ts(rnorm(length(myseries))*10, start = start(myseries),
frequency = 12)
var2 <- ts(rnorm(length(myseries))*100, start = start(myseries),
frequency = 12)
var <- ts.union(var1, var2)
myspec1 <- regarima_spec_tramoseats(spec = "TRfull",
usrdef.varEnabled = TRUE, usrdef.var = var)
s_preVar(myspec1)
myreg1 <- regarima(myseries,myspec1)
myspec2 <- regarima_spec_tramoseats(spec = "TRfull",
usrdef.varEnabled = TRUE,
usrdef.var = var, usrdef.varCoef = c(17,-1),
transform.function = "None")
myreg2 <- regarima(myseries, myspec2)
# Pre-specified ARMA coefficients
myspec1 <- regarima_spec_tramoseats(spec = "TRfull",
arima.coefEnabled = TRUE, automdl.enabled = FALSE,
arima.p = 2, arima.q = 0, arima.bp = 1, arima.bq = 1,
arima.coef = c(-0.12, -0.12, -0.3, -0.99),
arima.coefType = rep("Fixed", 4))
myreg1 <- regarima(myseries, myspec1)
myreg1
summary(myreg1)
s_arimaCoef(myspec1)
s_arimaCoef(myreg1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.