Skip to contents

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")).

Usage

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_
)

Arguments

spec

the model specification. It can be the name (character) of a predefined 'JDemetra+' model specification (see Details), an object of class c("regarima_spec","TRAMO_SEATS") or an object of class c("regarima", "TRAMO_SEATS"). The default is "TRfull".

preliminary.check

a logical to check the quality of the input series and exclude highly problematic series e.g. the series with a number of identical observations and/or missing values above pre-specified threshold values.

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, estimate.to, estimate.first, estimate.last, estimate.exclFirst and estimate.exclLast; where estimate.from and estimate.to have priority over the remaining span control variables, estimate.last and estimate.first have priority over estimate.exclFirst and estimate.exclLast, and estimate.last has priority over estimate.first. Default= "All".

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.

estimate.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 the parameter estimate.from.

estimate.first

numeric, the number of periods considered at the beginning of the series.

estimate.last

numeric, the number of periods considered at the end of the series.

estimate.exclFirst

numeric, the number of periods excluded at the beginning of the series. It can be combined with the parameter estimate.exclLast.

estimate.exclLast

numeric, the number of periods excluded at the end of the series. It can be combined with the parameter estimate.exclFirst.

estimate.tol

numeric, the convergence tolerance. The absolute changes in the log-likelihood function are compared to this value to check for the convergence of the estimation iterations.

estimate.eml

logical, the exact maximum likelihood estimation. If TRUE, the program performs an exact maximum likelihood estimation. If FASLE, the Unconditional Least Squares method is used.

estimate.urfinal

numeric, the final unit root limit. The threshold value for the final unit root test for identification of differencing orders. If the magnitude of an AR root for the final model is smaller than this number, then a unit root is assumed, the order of the AR polynomial is reduced by one and the appropriate order of the differencing (non-seasonal, seasonal) is increased.

transform.function

the transformation of the input series: "None" = no transformation of the series; "Log" = takes the log of the series; "Auto" = the program tests for the log-level specification.

transform.fct

numeric controlling the bias in the log/level pre-test: transform.fct > 1 favours levels, transform.fct< 1 favours logs. Considered only when transform.function is set to "Auto".

Control variables for the pre-specified outliers. Said pre-specified outliers are used in the model only when enabled (usrdef.outliersEnabled=TRUE) and when the outliers' type (usrdef.outliersType) and date (usrdef.outliersDate) are provided.

usrdef.outliersEnabled

logical. If TRUE, the program uses the pre-specified outliers.

usrdef.outliersType

a vector defining the outliers' type. Possible types are: ("AO") = additive, ("LS") = level shift, ("TC") = transitory change, ("SO") = seasonal outlier. E.g.: usrdef.outliersType= c("AO","AO","LS").

usrdef.outliersDate

a vector defining the outliers' date. The dates should be characters in format "YYYY-MM-DD". E.g.: usrdef.outliersDate= c("2009-10-01","2005-02-01","2003-04-01").

usrdef.outliersCoef

a vector providing fixed coefficients for the outliers. The coefficients can't be fixed if the parameter transform.function is set to "Auto" (i.e. if the series transformation needs to be pre-defined.) E.g.: usrdef.outliersCoef= c(200,170,20).

Control variables for the user-defined variables:

usrdef.varEnabled

logical If TRUE, the program uses the user-defined variables.

usrdef.var

a time series (ts) or a matrix of time series (mts) containing the user-defined variables.

usrdef.varType

a vector of character(s) defining the user-defined variables component type. Possible types are: "Undefined", "Series", "Trend", "Seasonal", "SeasonallyAdjusted", "Irregular", "Calendar". To use the user-defined calendar regressors, the type "Calendar" must be defined in conjunction with tradingdays.option = "UserDefined". Otherwise, the program will automatically set usrdef.varType = "Undefined".

usrdef.varCoef

a vector providing fixed coefficients for the user-defined variables. The coefficients can't be fixed if transform.function is set to "Auto" (i.e. if the series transformation needs to be pre-defined).

tradingdays.mauto

defines whether the calendar effects should be added to the model manually ("Unused") or automatically. During the automatic selection, the choice of the number of calendar variables can be based on the F-Test ("FTest") or the Wald Test ("WaldTest"); the model with higher F value is chosen, provided that it is higher than tradingdays.pftd).

tradingdays.pftd

numeric. The p-value used in the test specified by the automatic parameter (tradingdays.mauto) to assess the significance of the pre-tested calendar effects variables and whether they should be included in the RegArima model.

Control variables for the manual selection of calendar effects variables (tradingdays.mauto is set to "Unused"):

tradingdays.option

to choose the trading days regression variables: "TradingDays" = six day-of-the-week regression variables; "WorkingDays" = one working/non-working day contrast variable; "None" = no correction for trading days and working days effects; "UserDefined" = user-defined trading days regressors (regressors must be defined by the usrdef.var argument with usrdef.varType set to "Calendar" and usrdef.varEnabled = TRUE). "None" must also be chosen for the "day-of-week effects" correction (and tradingdays.stocktd must be modified accordingly).

tradingdays.leapyear

logical. Specifies if the leap-year correction should be included. If TRUE, the model includes the leap-year effect.

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.option is set to "None".

tradingdays.test

defines the pre-tests of the trading day effects: "None" = calendar variables are used in the model without pre-testing; "Separate_T" = a t-test is applied to each trading day variable separately and the trading day variables are included in the RegArima model if at least one t-statistic is greater than 2.6 or if two t-statistics are greater than 2.0 (in absolute terms); "Joint_F" = a joint F-test of significance of all the trading day variables. The trading day effect is significant if the F statistic is greater than 0.95.

easter.type

acharacter that specifies the presence and the length of the Easter effect: "Unused" = the Easter effect is not considered; "Standard" = influences the period of n days strictly before Easter Sunday; "IncludeEaster" = influences the entire period (n) up to and including Easter Sunday; "IncludeEasterMonday" = influences the entire period (n) up to and including Easter Monday.

easter.julian

logical. If TRUE, the program uses the Julian Easter (expressed in Gregorian calendar).

easter.duration

numeric indicating the duration of the Easter effect (length in days, between 1 and 15).

easter.test

logical. If TRUE, the program performs a t-test for the significance of the Easter effect. The Easter effect is considered as significant if the modulus of t-statistic is greater than 1.96.

outlier.enabled

logical. If TRUE, the automatic detection of outliers is enabled in the defined time span.

The time span of the series to be searched for outliers is controlled by the following six variables: outlier.from, outlier.to, outlier.first, outlier.last, outlier.exclFirst and outlier.exclLast; where outlier.from and outlier.to have priority over the remaining span control variables, outlier.last and outlier.first have priority over outlier.exclFirst and outlier.exclLast, and outlier.last has priority over outlier.first.

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.

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.from.

outlier.first

numeric specifying the number of periods considered at the beginning of the series.

outlier.last

numeric specifying the number of periods considered at the end of the series.

outlier.exclFirst

numeric specifying the number of periods excluded at the beginning of the series. It can be combined with outlier.exclLast.

outlier.exclLast

numeric specifying the number of periods excluded at the end of the series. It can be combined with outlier.exclFirst.

outlier.ao

logical. If TRUE, the automatic detection of additive outliers is enabled (outlier.enabled must also be set to TRUE).

outlier.tc

logical. If TRUE, the automatic detection of transitory changes is enabled (outlier.enabled must also be set to TRUE).

outlier.ls

logical. If TRUE, the automatic detection of level shifts is enabled (outlier.enabled must also be set to TRUE).

outlier.so

logical. If TRUE, the automatic detection of seasonal outliers is enabled (outlier.enabled must also be set to TRUE).

outlier.usedefcv

logical. If TRUE, the critical value for the outliers' detection procedure is automatically determined by the number of observations in the outlier detection time span. If FALSE, the procedure uses the entered critical value (outlier.cv).

outlier.cv

numeric. The entered critical value for the outliers' detection procedure. The modification of this variable is only taken in to account when outlier.usedefcv is set to FALSE.

outlier.eml

logical for the exact likelihood estimation method. It controls the method applied for a parameter estimation in the intermediate steps of the automatic detection and correction of outliers. If TRUE, an exact likelihood estimation method is used. When FALSE, the fast Hannan-Rissanen method is used.

outlier.tcrate

numeric. The rate of decay for the transitory change outlier.

automdl.enabled

logical. If TRUE, the automatic modelling of the ARIMA model is enabled. If FALSE, the parameters of the ARIMA model can be specified.

Control variables for the automatic modelling of the ARIMA model (automdl.enabled is set to TRUE):

automdl.acceptdefault

logical. If TRUE, the default model (ARIMA(0,1,1)(0,1,1)) may be chosen in the first step of the automatic model identification. If the Ljung-Box Q statistics for the residuals is acceptable, the default model is accepted and no further attempt will be made to identify another model.

automdl.cancel

numeric, the cancellation limit. If the difference in moduli of an AR and an MA roots (when estimating ARIMA(1,0,1)(1,0,1) models in the second step of the automatic identification of the differencing orders) is smaller than the cancellation limit, the two roots are assumed equal and canceled out.

automdl.ub1

numeric, the first unit root limit. It is the threshold value for the initial unit root test in the automatic differencing procedure. When one of the roots in the estimation of the ARIMA(2,0,0)(1,0,0) plus mean model, performed in the first step of the automatic model identification procedure, is larger than first unit root limit in modulus, it is set equal to unity.

automdl.ub2

numeric, the second unit root limit. When one of the roots in the estimation of the ARIMA(1,0,1)(1,0,1) plus mean model, which is performed in the second step of the automatic model identification procedure, is larger than second unit root limit in modulus, it is checked if there is a common factor in the corresponding AR and MA polynomials of the ARMA model that can be canceled (see automdl.cancel). If there is no cancellation, the AR root is set equal to unity (i.e. the differencing order changes).

automdl.armalimit

numeric, the arma limit. It is the threshold value for t-statistics of ARMA coefficients and the constant term used for the final test of model parsimony. If the highest order ARMA coefficient has a t-value smaller than this value in magnitude, the order of the model is reduced. If the constant term has a t-value smaller than the ARMA limit in magnitude, it is removed from the set of regressors.

automdl.reducecv

numeric, ReduceCV. The percentage by which the outlier critical value will be reduced when an identified model is found to have a Ljung-Box statistic with an unacceptable confidence coefficient. The parameter should be between 0 and 1, and will only be active when automatic outlier identification is enabled. The reduced critical value will be set to (1-ReduceCV)xCV, where CV is the original critical value.

automdl.ljungboxlimit

numeric, the Ljung Box limit, setting the acceptance criterion for the confidence intervals of the Ljung-Box Q statistic. If the LjungBox Q statistics for the residuals of a final model is greater than Ljung Box limit, then the model is rejected, the outlier critical value is reduced, and model and outlier identification (if specified) is redone with a reduced value.

automdl.compare

logical. If TRUE, the program compares the model identified by the automatic procedure to the default model (ARIMA(0,1,1)(0,1,1)) and the model with the best fit is selected. Criteria considered are residual diagnostics, the model structure and the number of outliers.

Control variables for the non-automatic modelling of the ARIMA model (automdl.enabled is set to FALSE):

arima.mu

logical. If TRUE, the mean is considered as part of the ARIMA model.

arima.p

numeric. The order of the non-seasonal autoregressive (AR) polynomial.

arima.d

numeric. The regular differencing order.

arima.q

numeric. The order of the non-seasonal moving average (MA) polynomial.

arima.bp

numeric. The order of the seasonal autoregressive (AR) polynomial.

arima.bd

numeric. The seasonal differencing order.

arima.bq

numeric. The order of the seasonal moving average (MA) polynomial.

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.coefType) is provided, and the number of provided coefficients matches the sum of (regular and seasonal) AR and MA orders (p,q,bp,bq).

arima.coefEnabled

logical. If TRUE, the program uses the user-defined ARMA coefficients.

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 - p elements), regular MA (Theta - q elements), seasonal AR (BPhi - bp elements) and seasonal MA (BTheta - bq elements). E.g.: arima.coef=c(0.6,0.7) with arima.p=1, arima.q=0,arima.bp=1 and arima.bq=0.

arima.coefType

avector defining the ARMA coefficients estimation procedure. Possible procedures are: "Undefined" = no use of user-defined input (i.e. coefficients are estimated), "Fixed" = fixes the coefficients at the value provided by the user, "Initial" = the value defined by the user is used as initial condition. For orders for which the coefficients shall not be defined, the arima.coef can be set to NA or 0 or the arima.coefType can be set to "Undefined". E.g.: arima.coef = c(-0.8,-0.6,NA), arima.coefType = c("Fixed","Fixed","Undefined").

fcst.horizon

numeric, the forecasting horizon. The length of the forecasts generated by the RegARIMA model in periods (positive values) or years (negative values). By default, the program generates two years forecasts (fcst.horizon set to -2).

Value

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: span - time span to be used for the estimation, tolerance - argument estimate.tol, exact_ml - argument estimate.eml, urfinal - argument esimate.urfinal. The final values can be also accessed with the function s_estimate.

transform

a data frame containing variables referring to: tfunction - argument transform.function, fct - argument transform.fct. The final values can be also accessed with the function s_transform.

regression

a list containing information on the user-defined variables (userdef), trading.days effect and easter effect. The user-defined part includes: specification - data frame with the information if pre-specified outliers (outlier) and user-defined variables (variables) are included in the model and if fixed coefficients are used (outlier.coef and variables.coef). The final values can be also accessed with the function s_usrdef; outliers - matrixes with the outliers (Predefined and Final). The final outliers can be also accessed with the function s_preOut; and variables - list with the Predefined and Final user-defined variables (series) and its description (description) including information on the variable type and values of fixed coefficients. The final user-defined variables can be also accessed with the function s_preVar.

The trading.days data frame variables refer to: automatic - argument tradingdays.mauto, pftd - argument tradingdays.pftd, option - argument tradingdays.option, leapyear - argument tradingdays.leapyear, stocktd - argument tradingdays.stocktd, test - argument tradingdays.test. The final trading.days values can be also accessed with the function s_td. The easter data frame variables refer to: type - argument easter.type, julian - argument easter.julian, duration - argument easter.duration, test - argument easter.test. The final easter values can be also accessed with the function s_easter.

outliers

a data frame. Variables referring to: ao - argument outlier.ao, tc - argument outlier.tc, ls - argument outlier.ls, so - argument outlier.so, usedefcv - argument outlier.usedefcv, cv - argument outlier.cv, eml - argument outlier.eml, tcrate - argument outlier.tcrate. The final values can be also accessed with the function s_out.

arima

a list containing a data frame with the ARIMA settings (specification) and matrices giving information on the pre-specified ARMA coefficients (coefficients). The matrix Predefined refers to the pre-defined model specification and matrix Final, to the final specification. Both matrices contain the values of the ARMA coefficients and the procedure for its estimation. In the data frame specification, the variable enabled refers to the argument automdl.enabled and all remaining variables (automdl.acceptdefault, automdl.cancel, automdl.ub1, automdl.ub2, automdl.armalimit, automdl.reducecv, automdl.ljungboxlimit, automdl.compare, arima.mu, arima.p, arima.d, arima.q, arima.bp, arima.bd, arima.bq), to the respective function arguments. The final values of the specification can be also accessed with the function s_arima, and final pre-specified ARMA coefficients with the function s_arimaCoef.

forecast

a data frame with the forecasting horizon (argument fcst.horizon). The final value can be also accessed with the function s_fcst.

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 s_span.

Details

The available predefined 'JDemetra+' model specifications are described in the table below:

Identifier |Log/level detection |Outliers detection |Calendar effects |ARIMATR0 |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 |
automaticTR4 |automatic |AO/LS/TC |2 td vars + Easter |automaticTR5 |automatic |
AO/LS/TC |7 td vars + Easter |automaticTRfull |automatic |AO/LS/TC |automatic |automatic

References

More information and examples related to 'JDemetra+' features in the online documentation: https://jdemetra-new-documentation.netlify.app/

Examples

# \donttest{
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)
#>   type       date coeff
#> 1   LS 2008-10-01    10
#> 2   LS 2003-01-01    -8
myreg1 <- regarima(myseries, myspec1)
myreg1
#> y = regression model + arima (2, 1, 0, 1, 1, 1)
#> Log-transformation: no
#> Coefficients:
#>           Estimate Std. Error
#> Phi(1)      0.4872      0.051
#> Phi(2)      0.2964      0.051
#> BPhi(1)    -0.2070      0.071
#> BTheta(1)  -0.8048      0.044
#> 
#>              Estimate Std. Error
#> Week days      0.6814      0.039
#> Leap year      1.9125      0.726
#> Easter [6]    -2.4901      0.461
#> TC (4-2020)  -22.4492      2.288
#> TC (3-2020)  -21.2013      2.296
#> AO (5-2011)   12.6414      1.908
#> LS (11-2008) -14.2909      1.954
#> 
#> Fixed outliers: 
#>              Coefficients
#> LS (10-2008)           10
#> LS (1-2003)            -8
#> 
#> 
#> Residual standard error: 2.421 on 347 degrees of freedom
#> Log likelihood = -831.3, aic =  1687 aicc =  1688, bic(corrected for length) = 1.949
#> 
s_preOut(myreg1)
#>   type       date coeff
#> 1   LS 2008-10-01    10
#> 2   LS 2003-01-01    -8


 # 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)
#> $series
#>                 var1        var2
#> Jan 1990 -10.3377324  -88.564860
#> Feb 1990  -1.5597667    4.923707
#> Mar 1990  -0.4640064   18.556122
#> Apr 1990  -9.5362873  -60.865779
#> May 1990   4.1626080  -73.110285
#> Jun 1990   1.1402961  271.514421
#> Jul 1990   0.6391875 -133.938704
#> Aug 1990  -9.1933224  -64.601525
#> Sep 1990   9.0133529  -93.245461
#> Oct 1990  -7.9772830  -76.908693
#> Nov 1990   6.6822120   37.157978
#> Dec 1990   1.5521430   35.543278
#> Jan 1991   1.2868809  -98.399849
#> Feb 1991 -15.3306545   21.472959
#> Mar 1991   2.0236067   -8.008508
#> Apr 1991  -7.1753865 -142.236955
#> May 1991   3.6169476  110.814896
#> Jun 1991  13.9900429  107.847764
#> Jul 1991   3.7269896  -44.025034
#> Aug 1991 -15.6564429  -77.816901
#> Sep 1991  -0.5169454 -181.859001
#> Oct 1991   5.1408210 -112.408090
#> Nov 1991   5.4989952  106.052384
#> Dec 1991   8.6781691 -147.870016
#> Jan 1992   6.8436008 -155.156017
#> Feb 1992  -1.6267998   77.750668
#> Mar 1992 -17.8436472  106.844014
#> Apr 1992 -10.3714557  -18.358770
#> May 1992   8.3014772  155.824293
#> Jun 1992   6.0734694  -21.324238
#> Jul 1992  -1.2218636   93.053526
#> Aug 1992   9.3312514   41.081180
#> Sep 1992  -9.6127668 -127.984430
#> Oct 1992   2.5508171  -78.236663
#> Nov 1992  -5.4540157 -227.608345
#> Dec 1992   9.3036074  -12.639591
#> Jan 1993  -5.3765056  144.814671
#> Feb 1993  -4.5242607 -144.275737
#> Mar 1993  -4.3929097  146.718718
#> Apr 1993  -6.1622311  -74.329990
#> May 1993   4.4163455  -30.422384
#> Jun 1993   4.8259745   33.765806
#> Jul 1993   5.4214438  -60.750209
#> Aug 1993 -22.9078465  -29.556027
#> Sep 1993   3.1035185  -13.453714
#> Oct 1993  14.0407898   81.478437
#> Nov 1993  13.7711764  -27.292173
#> Dec 1993  10.6039565  215.948580
#> Jan 1994   6.3217289  109.173757
#> Feb 1994  10.8492804   74.338485
#> Mar 1994  13.5645944 -120.785935
#> Apr 1994   3.6242404   32.781805
#> May 1994  21.6934446  -53.416511
#> Jun 1994   1.3913051  128.394672
#> Jul 1994  13.7632653    2.893134
#> Aug 1994  -4.9144999  -39.567707
#> Sep 1994  15.3491576  -69.486833
#> Oct 1994  -4.1619872 -149.208070
#> Nov 1994  -5.2054380  144.425724
#> Dec 1994   8.5058387  -34.701739
#> Jan 1995   3.3449657   -4.025917
#> Feb 1995  -8.2935177  124.663211
#> Mar 1995  -2.1869594 -134.630152
#> Apr 1995 -15.4508372  -57.390128
#> May 1995   2.3322978  -70.595925
#> Jun 1995   0.3106964 -185.740454
#> Jul 1995   3.5786565  -24.697048
#> Aug 1995  16.0862422  -33.556093
#> Sep 1995  14.2985426  -24.937687
#> Oct 1995  -9.4833964   45.952256
#> Nov 1995  10.1570554  -46.007548
#> Dec 1995   0.3773461    5.893280
#> Jan 1996 -17.4423940  -74.259108
#> Feb 1996  -9.7007381 -216.357400
#> Mar 1996  -2.2902736  -23.289649
#> Apr 1996  -9.7484568   87.490683
#> May 1996  26.9237242  -97.349403
#> Jun 1996  13.9239386  -51.274686
#> Jul 1996  13.6007615  -92.348799
#> Aug 1996  -3.6541588 -149.442573
#> Sep 1996  -8.6893720  -16.593036
#> Oct 1996  -5.0655673  158.223832
#> Nov 1996  12.1470730  101.460227
#> Dec 1996   5.0695868 -114.647834
#> Jan 1997 -20.9497131  -90.984911
#> Feb 1997   0.3407924  310.918268
#> Mar 1997   8.5272870 -106.955277
#> Apr 1997   7.4322814  -70.010952
#> May 1997   5.5715361  -19.844447
#> Jun 1997 -12.4858322   74.362012
#> Jul 1997  -2.0787431   -5.015977
#> Aug 1997   4.2396946  131.314355
#> Sep 1997  -5.0669744    8.601352
#> Oct 1997  -6.1152331  -62.985137
#> Nov 1997  24.1165945   65.507033
#> Dec 1997  -1.6495814    1.939355
#> Jan 1998  -4.4040605   69.626996
#> Feb 1998   5.2197617  200.886989
#> Mar 1998 -19.1832225   -5.697828
#> Apr 1998 -19.8264996   24.041550
#> May 1998   5.2120016   -2.189017
#> Jun 1998   7.7778320  -83.080816
#> Jul 1998  -8.1211887  140.247432
#> Aug 1998   9.1074832  -72.386911
#> Sep 1998   9.4875395  133.058037
#> Oct 1998 -13.4804945  -81.133302
#> Nov 1998   3.5417586  179.503611
#> Dec 1998   5.3026393   68.662633
#> Jan 1999  -3.1097493    8.937800
#> Feb 1999  -2.4415553   32.454774
#> Mar 1999  -2.9187819    7.131812
#> Apr 1999 -11.2808616   23.304838
#> May 1999 -11.2288159  198.637658
#> Jun 1999  20.5393864  -95.167079
#> Jul 1999  -9.0951843  -55.864232
#> Aug 1999   4.5837916   25.581454
#> Sep 1999  -0.4661845  -19.807617
#> Oct 1999  -6.8095460   42.878914
#> Nov 1999 -14.8882940    7.077011
#> Dec 1999  -3.9251301 -153.665380
#> Jan 2000 -17.4968202   45.398437
#> Feb 2000  -0.3866763   87.439857
#> Mar 2000  -7.9715324 -129.773757
#> Apr 2000  -9.1592054 -107.896524
#> May 2000   0.7326746 -113.484994
#> Jun 2000  12.3817132    2.261431
#> Jul 2000   7.1837134   -2.146122
#> Aug 2000   5.3946650  -27.877244
#> Sep 2000 -10.6123399   -2.420641
#> Oct 2000  -5.4073787   82.502030
#> Nov 2000  -7.1520471  -75.018278
#> Dec 2000  -1.7892009   53.621047
#> Jan 2001   1.6497028 -157.271748
#> Feb 2001  -7.2740817  -98.642742
#> Mar 2001  -5.3783713  198.351232
#> Apr 2001  -5.9966490 -185.137844
#> May 2001  11.8208775  -90.978818
#> Jun 2001   1.8921288 -195.144002
#> Jul 2001   2.4894911  -80.027646
#> Aug 2001  10.4664341 -186.936160
#> Sep 2001 -12.8930094  -75.057148
#> Oct 2001   3.7511557  -59.093839
#> Nov 2001  -5.5691839  -74.209927
#> Dec 2001   3.0242663   69.351208
#> Jan 2002   2.2226647   -5.946397
#> Feb 2002  -9.6216696 -186.389510
#> Mar 2002   0.5203237 -127.450892
#> Apr 2002   9.0004038 -178.177081
#> May 2002  -3.9490088  -50.859339
#> Jun 2002   9.5414600 -173.687829
#> Jul 2002  -5.8821435    4.048130
#> Aug 2002 -14.7658453  -12.417946
#> Sep 2002 -13.7777577  -61.275343
#> Oct 2002 -13.4567231   16.066248
#> Nov 2002  -7.3663796  -66.235963
#> Dec 2002  -4.7011150  -33.485166
#> Jan 2003  13.8060934   62.301159
#> Feb 2003  16.7501093  102.819429
#> Mar 2003  11.7690663 -113.457824
#> Apr 2003  -1.4889834   91.691105
#> May 2003  -1.7782336  121.387479
#> Jun 2003   8.0312186  -68.593246
#> Jul 2003  -4.1579535 -109.456819
#> Aug 2003  12.1248959   36.487410
#> Sep 2003  12.4036003 -100.801708
#> Oct 2003   6.8567588   55.499644
#> Nov 2003  -0.2679868   43.606592
#> Dec 2003   3.0958051   10.537330
#> Jan 2004   2.4986433  -25.373785
#> Feb 2004 -13.5646087  -97.649123
#> Mar 2004   5.9937977   39.421777
#> Apr 2004   0.0864779  101.490303
#> May 2004   0.9071661   63.144381
#> Jun 2004  -6.5705741  -48.339825
#> Jul 2004  -4.8178225 -152.633394
#> Aug 2004   0.1775788   61.684228
#> Sep 2004  -8.5953576  122.928684
#> Oct 2004  13.5770498   15.745303
#> Nov 2004  12.1506118  140.634206
#> Dec 2004  14.5391292   39.680092
#> Jan 2005  -0.8591198   32.642296
#> Feb 2005  -6.1756875 -145.934331
#> Mar 2005  -2.1826025  -79.929553
#> Apr 2005 -13.2600521   47.001280
#> May 2005 -23.6220890 -115.018052
#> Jun 2005 -14.0996955  -27.159672
#> Jul 2005   2.5439714   45.742422
#> Aug 2005   2.9587030   -1.695794
#> Sep 2005   0.5678979  -54.159436
#> Oct 2005  -1.0265486   87.581342
#> Nov 2005  19.5192303   74.083815
#> Dec 2005   8.7856596  -16.481239
#> Jan 2006 -13.0661693  -75.096428
#> Feb 2006   0.9034427 -125.336629
#> Mar 2006   9.0235804 -103.623626
#> Apr 2006   5.4942132   -2.943857
#> May 2006  -8.6983920  -27.494378
#> Jun 2006  -0.3921465   48.545147
#> Jul 2006  -5.1845168   91.698203
#> Aug 2006  -9.1184962  -98.534392
#> Sep 2006   1.5031364 -149.118975
#> Oct 2006   4.4035545   81.959245
#> Nov 2006  13.1978206  101.340453
#> Dec 2006   2.4656113  105.360525
#> Jan 2007   9.4182660   -7.142864
#> Feb 2007  -3.4215133   95.244461
#> Mar 2007  -2.7614681  -38.403752
#> Apr 2007   3.8365678  -41.775999
#> May 2007  14.4691022  -47.026817
#> Jun 2007  17.3390029 -169.018029
#> Jul 2007   4.5642938  -94.549766
#> Aug 2007   7.0750349  -34.301196
#> Sep 2007  20.6378922   35.846241
#> Oct 2007   0.2391059    4.818886
#> Nov 2007   2.4594946  113.017228
#> Dec 2007   2.7205914  -52.763231
#> Jan 2008  -9.9245858   47.957533
#> Feb 2008  -0.2757795  141.752930
#> Mar 2008  22.2284516   -8.009077
#> Apr 2008   1.5550390  -39.418700
#> May 2008  -8.6911632   52.525764
#> Jun 2008 -11.7448945  -79.593510
#> Jul 2008 -17.5967731   24.509645
#> Aug 2008   0.5836159  -77.931984
#> Sep 2008  11.6451986   59.492387
#> Oct 2008   3.3762789  110.889090
#> Nov 2008 -10.5451872  -94.296903
#> Dec 2008   6.6076911   70.034399
#> Jan 2009  -8.2340900  -42.467483
#> Feb 2009   4.3703366 -114.313760
#> Mar 2009   3.7238811   23.344022
#> Apr 2009 -16.4674913  -18.923658
#> May 2009 -19.2355227 -166.341126
#> Jun 2009   3.8083303  191.569077
#> Jul 2009  13.7570535  -81.689444
#> Aug 2009   8.2584873   38.365049
#> Sep 2009  -4.1611500  -45.863225
#> Oct 2009   9.8214959  -71.570398
#> Nov 2009   2.4218073   42.954854
#> Dec 2009  -9.3792685 -116.985274
#> Jan 2010  15.0585850  132.208831
#> Feb 2010 -10.6585117  136.596464
#> Mar 2010   1.6227053  -24.972371
#> Apr 2010   2.6047039  -42.472135
#> May 2010 -14.8820199  109.843934
#> Jun 2010  14.1518387   67.092304
#> Jul 2010   5.6250751    3.095466
#> Aug 2010   6.4205574  236.851196
#> Sep 2010  -8.9053264  258.578811
#> Oct 2010  -1.1653752  121.228095
#> Nov 2010  -9.4197475 -125.119684
#> Dec 2010  11.1582792   40.026604
#> Jan 2011   4.7013513   93.470763
#> Feb 2011   8.6061271  -47.266985
#> Mar 2011  -0.7039665  158.301322
#> Apr 2011  -6.1318021   59.775422
#> May 2011  -3.3671496   46.608459
#> Jun 2011  -2.1584018  -74.436754
#> Jul 2011   6.2113229   95.905526
#> Aug 2011 -12.8402652   15.263708
#> Sep 2011 -13.0009244  -76.936870
#> Oct 2011  -3.7676946  139.308074
#> Nov 2011   1.0374865   91.866877
#> Dec 2011  -7.0356227  101.608706
#> Jan 2012  14.9741394   53.463544
#> Feb 2012  -3.0282688  -98.762856
#> Mar 2012 -13.7683133  118.779227
#> Apr 2012   8.8317017  -51.754221
#> May 2012   6.7142028  -25.956025
#> Jun 2012  12.3002238  -32.806467
#> Jul 2012  16.4546788    7.343239
#> Aug 2012  -1.8292604  -24.786302
#> Sep 2012 -13.7925781 -137.386226
#> Oct 2012  12.5060060   -4.044582
#> Nov 2012 -18.7623677   42.153824
#> Dec 2012  -3.6878757   20.159751
#> Jan 2013 -21.2929731 -169.719192
#> Feb 2013   3.3764603   64.228768
#> Mar 2013 -15.7457485  -99.523961
#> Apr 2013  -1.9631941   96.381390
#> May 2013   9.1506011 -165.603723
#> Jun 2013  10.7863654  107.086109
#> Jul 2013  14.5280285  -10.902636
#> Aug 2013 -16.5328109  189.918639
#> Sep 2013 -27.6186752 -113.703073
#> Oct 2013   2.6436916  -27.971976
#> Nov 2013  10.2457159  -89.412905
#> Dec 2013  -6.5918555   13.670185
#> Jan 2014  -3.8630438  -74.916542
#> Feb 2014  -2.4249895   51.819908
#> Mar 2014   2.2059324  -19.233721
#> Apr 2014 -14.8109003    2.880981
#> May 2014   7.2469120   35.859089
#> Jun 2014 -23.7751470   -2.899503
#> Jul 2014  -0.6540921  114.704207
#> Aug 2014  -4.6970481   37.358894
#> Sep 2014  -2.8051629   32.333921
#> Oct 2014   5.7483659  -82.981932
#> Nov 2014  -2.0567685  139.446258
#> Dec 2014   2.3488051  -19.154358
#> Jan 2015   1.1062832   27.227702
#> Feb 2015   2.7420223 -108.165901
#> Mar 2015  15.7491963 -232.939936
#> Apr 2015   5.6776783  -54.962596
#> May 2015  -0.5961225   -7.257999
#> Jun 2015  -1.4958771  103.228840
#> Jul 2015   2.6616879   21.513853
#> Aug 2015   5.2840324  -49.434012
#> Sep 2015  -5.7938809  151.213828
#> Oct 2015   9.4219937  -57.946326
#> Nov 2015  -7.0636136  167.478963
#> Dec 2015 -12.7540210 -100.098026
#> Jan 2016   7.3325992  122.270284
#> Feb 2016  -4.2020709  107.718817
#> Mar 2016  -2.5537509  -61.194546
#> Apr 2016  -3.6923822   50.686697
#> May 2016  12.1244833   46.006837
#> Jun 2016  -4.4536301  148.439186
#> Jul 2016  11.3866752   88.196323
#> Aug 2016   1.9052348  -53.670224
#> Sep 2016 -13.6639361  128.555371
#> Oct 2016 -12.9810260   58.784853
#> Nov 2016 -21.3709831 -130.848203
#> Dec 2016  -0.9620553   31.672632
#> Jan 2017   6.9450905  119.415830
#> Feb 2017  -4.7459123   91.305715
#> Mar 2017  17.6313061  -78.675299
#> Apr 2017  20.2584606  -41.092970
#> May 2017   4.2761881   47.637368
#> Jun 2017  -5.6647935   18.591587
#> Jul 2017  -8.3383531 -132.471625
#> Aug 2017   3.9825915  117.237106
#> Sep 2017 -14.7453793   23.149277
#> Oct 2017  -3.9544120   48.307190
#> Nov 2017  -1.3070247  -53.531958
#> Dec 2017 -19.9949395  137.813582
#> Jan 2018  -9.9593086 -130.267167
#> Feb 2018   4.2011400   63.485754
#> Mar 2018  -0.6286163   99.965516
#> Apr 2018  -0.8013185  -33.774895
#> May 2018  -0.3228341   -8.603361
#> Jun 2018  -7.1898093 -171.881758
#> Jul 2018 -11.1656132  -92.912157
#> Aug 2018  -7.8026990   81.367605
#> Sep 2018 -17.7695853   52.641355
#> Oct 2018  -4.2783487  101.195739
#> Nov 2018 -20.3102701   83.137981
#> Dec 2018  27.5076475   41.513414
#> Jan 2019  15.1366972  -66.125706
#> Feb 2019   0.3398894   54.881129
#> Mar 2019   7.4079278  -53.936780
#> Apr 2019 -12.7080818  -17.131843
#> May 2019  -1.6356423  -76.673461
#> Jun 2019  -6.1094549  -60.657485
#> Jul 2019  12.5188419  164.731282
#> Aug 2019   2.5031947   84.106935
#> Sep 2019 -17.0558168   33.817510
#> Oct 2019  -8.5541313  -40.488308
#> Nov 2019  -1.4490163   90.000904
#> Dec 2019  -3.2444696  119.066666
#> Jan 2020  -1.7256490   -4.753908
#> Feb 2020 -12.3606292   78.692542
#> Mar 2020 -19.0230421  116.668411
#> Apr 2020  -0.9450402  -27.182387
#> May 2020   0.3255579  -31.370428
#> Jun 2020   4.6129012  -28.630015
#> Jul 2020  13.8140030  -80.344026
#> Aug 2020  -4.1647627   -9.455546
#> Sep 2020   6.8094267   -7.404651
#> Oct 2020  -4.1437304   71.449068
#> Nov 2020  -5.1834551   12.471837
#> Dec 2020  -6.8401973  129.659434
#> 
#> $description
#>           type coeff
#> var1 Undefined    NA
#> var2 Undefined    NA
#> 
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
#> y = regression model + arima (2, 1, 0, 1, 1, 1)
#> Log-transformation: no
#> Coefficients:
#>           Estimate Std. Error
#> Phi(1)       -0.12          0
#> Phi(2)       -0.12          0
#> BPhi(1)      -0.30          0
#> BTheta(1)    -0.99          0
#> 
#>                Estimate Std. Error
#> Mean          -0.007018      0.029
#> Week days      0.704716      0.029
#> Leap year      2.163501      0.675
#> Easter [6]    -2.360603      0.385
#> TC (4-2020)  -25.280857      2.517
#> TC (3-2020)  -21.581618      2.569
#> AO (5-2011)   14.219490      1.749
#> LS (11-2008)  -6.225300      2.608
#> 
#> 
#> Residual standard error: 2.712 on 350 degrees of freedom
#> Log likelihood = -882.9, aic =  1784 aicc =  1784, bic(corrected for length) = 2.127
#> 
summary(myreg1)
#> y = regression model + arima (2, 1, 0, 1, 1, 1)
#> 
#> Model: RegARIMA - TRAMO/SEATS
#> Estimation span: from 1-1990 to 12-2020
#> Log-transformation: no
#> Regression model: mean, trading days effect(2), leap year effect, Easter effect, outliers(4)
#> 
#> Coefficients:
#> ARIMA: 
#>           Estimate Std. Error T-stat Pr(>|t|)
#> Phi(1)       -0.12       0.00     NA       NA
#> Phi(2)       -0.12       0.00     NA       NA
#> BPhi(1)      -0.30       0.00     NA       NA
#> BTheta(1)    -0.99       0.00     NA       NA
#> 
#> Regression model: 
#>                Estimate Std. Error  T-stat Pr(>|t|)    
#> Mean          -0.007018   0.028698  -0.245  0.80694    
#> Week days      0.704716   0.029477  23.907  < 2e-16 ***
#> Leap year      2.163501   0.675295   3.204  0.00148 ** 
#> Easter [6]    -2.360603   0.384746  -6.135 2.24e-09 ***
#> TC (4-2020)  -25.280857   2.517080 -10.044  < 2e-16 ***
#> TC (3-2020)  -21.581618   2.569059  -8.401 8.88e-16 ***
#> AO (5-2011)   14.219490   1.748501   8.132 6.88e-15 ***
#> LS (11-2008)  -6.225300   2.608253  -2.387  0.01751 *  
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> 
#> 
#> Residual standard error: 2.712 on 350 degrees of freedom
#> Log likelihood = -882.9, aic =  1784, aicc =  1784, bic(corrected for length) = 2.127
#> 
s_arimaCoef(myspec1)
#>            Type Value
#> Phi(1)    Fixed -0.12
#> Phi(2)    Fixed -0.12
#> BPhi(1)   Fixed -0.30
#> BTheta(1) Fixed -0.99
s_arimaCoef(myreg1)
#>            Type Value
#> Phi(1)    Fixed -0.12
#> Phi(2)    Fixed -0.12
#> BPhi(1)   Fixed -0.30
#> BTheta(1) Fixed -0.99
# }