Skip to contents

Function to create (and/or modify) a c("SA_spec", "TRAMO_SEATS") class object with the SA model specification for the TRAMO-SEATS method. It can be done from a pre-defined 'JDemetra+' model specification (a character), a previous specification (c("SA_spec", "TRAMO_SEATS") object) or a seasonal adjustment model (c("SA", "TRAMO_SEATS") object).

Usage

tramoseats_spec(
  spec = c("RSAfull", "RSA0", "RSA1", "RSA2", "RSA3", "RSA4", "RSA5"),
  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_,
  seats.predictionLength = NA_integer_,
  seats.approx = c(NA, "None", "Legacy", "Noisy"),
  seats.trendBoundary = NA_integer_,
  seats.seasdBoundary = NA_integer_,
  seats.seasdBoundary1 = NA_integer_,
  seats.seasTol = NA_integer_,
  seats.maBoundary = NA_integer_,
  seats.method = c(NA, "Burman", "KalmanSmoother", "McElroyMatrix"),
  benchmarking.enabled = NA,
  benchmarking.target = c(NA, "Original", "CalendarAdjusted"),
  benchmarking.useforecast = NA,
  benchmarking.rho = NA_real_,
  benchmarking.lambda = NA_real_
)

Arguments

spec

a TRAMO-SEATS model specification. It can be the 'JDemetra+' name (character) of a predefined TRAMO-SEATS model specification (see Details), an object of class c("SA_spec","TRAMO_SEATS") or an object of class c("SA", "TRAMO_SEATS"). The default is "RSAfull".

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

seats.predictionLength

integer: the number of forecasts used in the decomposition. Negative values correspond to number of years. Default=-1.

seats.approx

character: the approximation mode. When the ARIMA model estimated by TRAMO does not accept an admissible decomposition, SEATS: "None" - performs an approximation; "Legacy" - replaces the model with a decomposable one; "Noisy" - estimates a new model by adding a white noise to the non-admissible model estimated by TRAMO. Default="Legacy".

seats.trendBoundary

numeric: the trend boundary. The boundary beyond which an AR root is integrated in the trend component. If the modulus of the inverse real root is greater than the trend boundary, the AR root is integrated in the trend component. Below this value, the root is integrated in the transitory component. Possible values [0,1]. Default=0.5.

seats.seasdBoundary

numeric: the seasonal boundary. The boundary beyond which a negative AR root is integrated in the seasonal component. If the modulus of the inverse negative real root is greater (or equal) than Seasonal boundary, the AR root is integrated into the seasonal component. Otherwise the root is integrated into the trend or transitory component. Possible values [0,1]. Default=0.8.

seats.seasdBoundary1

numeric: the seasonal boundary (unique). The boundary beyond which a negative AR root is integrated in the seasonal component, when the root is the unique seasonal root. If the modulus of the inverse negative real root is greater (or equal) than Seasonal boundary, the AR root is integrated into the seasonal component. Otherwise the root is integrated into the trend or transitory component. Possible values [0,1]. Default=0.8.

seats.seasTol

numeric: the seasonal tolerance. The tolerance (measured in degrees) to allocate the AR non-real roots to the seasonal component (if the modulus of the inverse complex AR root is greater than the trend boundary and the frequency of this root differs from one of the seasonal frequencies by less than Seasonal tolerance) or the transitory component (otherwise). Possible values in [0,10]. Default value 2.

seats.maBoundary

numeric: the MA unit root boundary. When the modulus of an estimated MA root falls in the range (xl, 1), it is set to xl. Possible values [0.9,1]. Default=0.95.

seats.method

character: the estimation method for the unobserved components. The choice can be made from:

  • "Burman": the default value. May result in a significant underestimation of the components' standard deviation, as it may become numerically unstable when some roots of the MA polynomial are near 1;

  • "KalmanSmoother": it is not disturbed by the (quasi-) unit roots in MA;

  • "McElroyMatrix": it has the same stability issues as the Burman's algorithm.

benchmarking.enabled

logical: to enable benchmarking. If TRUE, the benchmarking is enabled.

benchmarking.target

character: the target of the benchmarking procedure, which can be the raw series ("Original") or the series the adjusted for calendar effects ("CalendarAdjusted").

benchmarking.useforecast

logical: If TRUE, the forecasts of the seasonally adjusted variable and of the target variable are used in the benchmarking computation so the benchmarking constrains is also applied to the forecasting period.

benchmarking.rho

numeric: the value of the AR(1) parameter (set between 0 and 1) in the function used for benchmarking.

benchmarking.lambda

numeric: a parameter used for benchmarking that relatesto to the weights in the regression equation. It is typically equal to 0, 1/2 or 1.

Value

A two-element list of class c("SA_spec", "TRAMO_SEATS"), containing: (1) an object of class c("regarima_spec", "TRAMO_SEATS") with the RegARIMA model specification, (2) an object of class c("seats_spec", "data.frame") with the SEATS algorithm specification. Each component refers to a different part of the SA model specification, mirroring the arguments of the function (for details see the function arguments in the description). Each lowest-level component (except span, pre-specified outliers, user-defined variables and pre-specified ARMA coefficients) is structured as 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.

    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 of Predefined (base model specification) and Final values.

  • regarima: an object of class c("regarima_spec", "TRAMO_SEATS"). See Value of the function regarima_spec_tramoseats.

  • seats: a data.frame of class c("seats_spec", "data.frame"), containing the seats variables in line with the names of the arguments variables. The final values can also be accessed with the function s_seats.

Details

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

Identifier |Log/level detection |Outliers detection |Calendar effects |ARIMARSA0 |NA |NA |
NA |Airline(+mean)RSA1 |automatic |AO/LS/TC |NA |Airline(+mean)RSA2 |
automatic |AO/LS/TC |2 td vars + Easter |Airline(+mean)RSA3 |automatic |AO/LS/TC |NA |
automaticRSA4 |automatic |AO/LS/TC |2 td vars + Easter |automaticRSA5 |automatic |
AO/LS/TC |7 td vars + Easter |automaticRSAfull |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/

See also

Examples

# \donttest{
myseries <- ipi_c_eu[, "FR"]
myspec1 <- tramoseats_spec(spec = c("RSAfull"))
mysa1 <- tramoseats(myseries, spec = myspec1)

# To modify a pre-specified model specification
myspec2 <- tramoseats_spec(spec = "RSAfull", tradingdays.mauto = "Unused",
                           tradingdays.option = "WorkingDays",
                           easter.type = "Standard",
                           automdl.enabled = FALSE, arima.mu = TRUE)
mysa2 <- tramoseats(myseries, spec = myspec2)

# To modify the model specification of a "SA" object
myspec3 <- tramoseats_spec(mysa1, tradingdays.mauto = "Unused",
                           tradingdays.option = "WorkingDays",
                           easter.type = "Standard", automdl.enabled = FALSE, arima.mu = TRUE)
mysa3 <- tramoseats(myseries, myspec3)

# To modify the model specification of a "SA_spec" object
myspec4 <- tramoseats_spec(myspec1, tradingdays.mauto = "Unused",
                           tradingdays.option = "WorkingDays",
                           easter.type = "Standard", automdl.enabled = FALSE, arima.mu = TRUE)
mysa4 <- tramoseats(myseries, myspec4)

# Pre-specified outliers
myspec5 <- tramoseats_spec(spec = "RSAfull",
                           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(myspec5)
#>   type       date coeff
#> 1   LS 2008-10-01    10
#> 2   LS 2003-01-01    -8
mysa5 <- tramoseats(myseries, myspec5)
mysa5
#> RegARIMA
#> 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
#> 
#> 
#> 
#> Decomposition
#> Model
#> AR :  1 + 0.487236 B + 0.296353 B^2 - 0.207019 B^12 - 0.100867 B^13 - 0.061351 B^14 
#> D :  1 - B - B^12 + B^13 
#> MA :  1 - 0.804783 B^12 
#> 
#> 
#> SA
#> AR :  1 - 0.389767 B - 0.130954 B^2 - 0.259902 B^3 
#> D :  1 - 2.000000 B + B^2 
#> MA :  1 - 1.807789 B + 0.901808 B^2 - 0.269318 B^3 + 0.305238 B^4 - 0.126109 B^5 
#> Innovation variance:  0.434195 
#> 
#> Trend
#> AR :  1 - 0.877002 B 
#> D :  1 - 2.000000 B + B^2 
#> MA :  1 - 0.714788 B - 0.995207 B^2 + 0.719581 B^3 
#> Innovation variance:  0.02178125 
#> 
#> Seasonal
#> AR :  1 + 0.877002 B + 0.769133 B^2 + 0.674532 B^3 + 0.591566 B^4 + 0.518805 B^5 + 0.454993 B^6 + 0.399030 B^7 + 0.349950 B^8 + 0.306907 B^9 + 0.269159 B^10 + 0.236053 B^11 
#> D :  1 + B + B^2 + B^3 + B^4 + B^5 + B^6 + B^7 + B^8 + B^9 + B^10 + B^11 
#> MA :  1 + 2.178999 B + 3.063892 B^2 + 4.121863 B^3 + 5.003640 B^4 + 5.601993 B^5 + 6.042224 B^6 + 6.245708 B^7 + 6.304190 B^8 + 6.112595 B^9 + 5.879629 B^10 + 5.538195 B^11 + 4.649065 B^12 + 3.623707 B^13 + 2.832188 B^14 + 1.903031 B^15 + 1.111724 B^16 + 0.543666 B^17 + 0.100438 B^18 - 0.158107 B^19 - 0.300012 B^20 - 0.253276 B^21 - 0.169309 B^22 
#> Innovation variance:  0.2937308 
#> 
#> Transitory
#> AR :  1 + 0.487236 B + 0.296353 B^2 
#> MA :  1 + 0.374200 B + B^2 
#> Innovation variance:  0.0004441626 
#> 
#> Irregular
#> Innovation variance:  0.2270517 
#> 
#> 
#> 
#> Final
#> Last observed values
#>              y        sa        t           s            i
#> Jan 2020 101.0 103.36086 103.6698  -2.3608556  -0.30898902
#> Feb 2020 100.1 103.77440 103.7591  -3.6743960   0.01526074
#> Mar 2020  91.8  82.68181 103.8823   9.1181885 -21.20051445
#> Apr 2020  66.7  66.03104 104.0672   0.6689644 -38.03612893
#> May 2020  73.7  78.40145 104.3488  -4.7014498 -25.94737674
#> Jun 2020  98.2  87.17684 104.5662  11.0231647 -17.38939710
#> Jul 2020  97.4  92.05260 104.5630   5.3474007 -12.51040945
#> Aug 2020  71.7  96.37053 104.3138 -24.6705259  -7.94324202
#> Sep 2020 104.7  97.23252 103.8686   7.4674839  -6.63612508
#> Oct 2020 106.7  98.61143 103.4107   8.0885663  -4.79928434
#> Nov 2020 101.6 100.11916 103.0293   1.4808373  -2.91011190
#> Dec 2020  96.6  99.92823 102.7128  -3.3282284  -2.78459980
#> 
#> Forecasts:
#>                y_f     sa_f      t_f        s_f         i_f
#> Jan 2021  93.59565 100.9960 102.4996  -7.399679 -1.50358792
#> Feb 2021  97.28250 101.2996 102.3539  -4.015335 -1.05431433
#> Mar 2021 111.80873 101.4867 102.2239  10.324214 -0.73723634
#> Apr 2021 103.12191 101.5917 102.1076   1.532091 -0.51591304
#> May 2021  95.98703 101.6419 102.0033  -5.653012 -0.36144565
#> Jun 2021 112.41967 101.6567 101.9096  10.762935 -0.25290781
#> Jul 2021 103.94320 101.6482 101.8251   2.296412 -0.17699539
#> Aug 2021  78.58807 101.6248 101.7488 -23.036711 -0.12394718
#> Sep 2021 109.12657 101.5928 101.6796   7.534699 -0.08675036
#> Oct 2021 107.23292 101.5558 101.6166   5.678242 -0.06071652
#> Nov 2021 105.47170 101.5165 101.5590   3.956022 -0.04250960
#> Dec 2021  99.15981 101.4766 101.5063  -2.317856 -0.02975541
#> 
#> 
#> Diagnostics
#> Relative contribution of the components to the stationary
#> portion of the variance in the original series,
#> after the removal of the long term trend
#>  Trend computed by Hodrick-Prescott filter (cycle length = 8.0 years)
#>            Component
#>  Cycle         3.137
#>  Seasonal     61.551
#>  Irregular     0.352
#>  TD & Hol.     2.592
#>  Others       30.919
#>  Total        98.551
#> 
#> Combined test in the entire series
#>  Non parametric tests for stable seasonality
#>                                                           P.value
#>    Kruskall-Wallis test                                      0.000
#>    Test for the presence of seasonality assuming stability   0.000
#>    Evolutive seasonality test                                0.243
#>  
#>  Identifiable seasonality present
#> 
#> Residual seasonality tests
#>                                       P.value
#>  qs test on sa                          1.000
#>  qs test on i                           1.000
#>  f-test on sa (seasonal dummies)        1.000
#>  f-test on i (seasonal dummies)         1.000
#>  Residual seasonality (entire series)   1.000
#>  Residual seasonality (last 3 years)    0.990
#>  f-test on sa (td)                      0.024
#>  f-test on i (td)                       0.089
#> 
#> 
#> Additional output variables
s_preOut(mysa5)
#>   type       date coeff
#> 1   LS 2008-10-01    10
#> 2   LS 2003-01-01    -8

# User-defined calendar regressors
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)

myspec6 <- tramoseats_spec(spec = "RSAfull", tradingdays.option = "UserDefined",
                           usrdef.varEnabled = TRUE, usrdef.var = var,
                           usrdef.varType = c("Calendar", "Calendar"))
#> Warning: With tradingdays.option = "UserDefined", the parameters tradingdays.leapyear and tradingdays.stocktd are ignored.
s_preVar(myspec6)
#> $series
#>                   var1          var2
#> Jan 1990  -9.535959793  206.87405597
#> Feb 1990  -0.799824652 -131.50525575
#> Mar 1990  10.626959023 -110.97503996
#> Apr 1990  13.510568359    5.48967197
#> May 1990   2.332902205  -86.25873906
#> Jun 1990   3.338987914   93.07754912
#> Jul 1990  -7.647702581   57.11704007
#> Aug 1990   7.693844601  123.48319265
#> Sep 1990  -2.150129615   46.20031264
#> Oct 1990   3.833805853  -73.42081944
#> Nov 1990  -5.424953612  132.33606241
#> Dec 1990 -20.945782198   45.72947704
#> Jan 1991   3.780500587  -73.64807522
#> Feb 1991  -7.059342281  214.36128315
#> Mar 1991  -5.871045298  -33.81593680
#> Apr 1991   1.000863593   -7.09703999
#> May 1991  12.020663588   -8.82100204
#> Jun 1991   6.598439960   35.50907169
#> Jul 1991  -6.267453556 -120.48084555
#> Aug 1991  -5.297761060  145.60005038
#> Sep 1991   8.765031871   -0.04656092
#> Oct 1991  -0.501382118  -11.76236571
#> Nov 1991  22.803903528   18.41482138
#> Dec 1991  13.798105639  -86.12007223
#> Jan 1992  -5.736360343   77.93108467
#> Feb 1992 -14.168374281  -45.40641716
#> Mar 1992 -12.449074589 -202.86071844
#> Apr 1992   9.000824800   13.74981227
#> May 1992  19.894302565  -65.31652495
#> Jun 1992 -27.869752864   72.00350979
#> Jul 1992  -0.231353042   80.84364277
#> Aug 1992   2.041608395   96.24521304
#> Sep 1992   0.442285247   10.31380723
#> Oct 1992   6.270974878   68.63601515
#> Nov 1992  -9.472495541  109.51989336
#> Dec 1992 -11.228269438   18.18922153
#> Jan 1993  -0.203236495  -19.68754162
#> Feb 1993  12.250255435  -84.80613844
#> Mar 1993   0.830589847 -187.74430764
#> Apr 1993 -18.859151704 -258.61413063
#> May 1993  10.569271276   10.80672274
#> Jun 1993   6.129121886 -183.83419463
#> Jul 1993   5.896500909  -12.30852580
#> Aug 1993  -0.664513411   14.74878788
#> Sep 1993  -6.081078807 -143.06464098
#> Oct 1993   9.473045743  -10.59880850
#> Nov 1993   3.931699575   50.31819093
#> Dec 1993  -3.852059312  251.26804489
#> Jan 1994  -6.092631219  -44.13813498
#> Feb 1994  -3.843851460 -217.89991293
#> Mar 1994  -9.014236692  -67.81489679
#> Apr 1994   8.729458934   72.88472658
#> May 1994   5.618212586 -124.34327365
#> Jun 1994 -17.572785220  -58.82719769
#> Jul 1994  -8.121160950  110.85391313
#> Aug 1994   2.386905873  -50.23799876
#> Sep 1994  25.060017195   34.72986863
#> Oct 1994  -9.805871650  174.81467948
#> Nov 1994  15.661250555   46.28553413
#> Dec 1994  -7.588674355   76.78697074
#> Jan 1995   4.938451044   45.10162329
#> Feb 1995  -3.271504519  -35.25772249
#> Mar 1995  -4.348790398   36.64544857
#> Apr 1995  15.197231060  -48.81248718
#> May 1995   0.036778033   87.33900144
#> Jun 1995  -4.023399502  179.87806220
#> Jul 1995 -14.954664332  105.07952142
#> Aug 1995  -9.459855132  217.52306395
#> Sep 1995   9.064295082  -18.35628629
#> Oct 1995 -18.138676228  -68.67930022
#> Nov 1995  -9.517754317    2.52921842
#> Dec 1995  11.268520993   77.70312224
#> Jan 1996   1.398890649  135.80460668
#> Feb 1996   1.003399767   31.19454244
#> Mar 1996 -12.045286294   99.11976849
#> Apr 1996  -0.834582964  -38.18986462
#> May 1996  -7.970822469  -88.02615153
#> Jun 1996  11.015245786    2.30683213
#> Jul 1996   1.084104063   70.83967956
#> Aug 1996 -11.905067990  147.10711674
#> Sep 1996   2.799212761  142.31851069
#> Oct 1996   7.774077731  -73.17572527
#> Nov 1996  -2.210897240 -122.78623180
#> Dec 1996  -1.376768354  -84.65572264
#> Jan 1997   1.152300433  164.14782427
#> Feb 1997  15.332695729 -253.69827268
#> Mar 1997  -6.557744602  151.49668186
#> Apr 1997   8.583787007  134.44652874
#> May 1997 -11.876705517   34.22179953
#> Jun 1997   5.395403804  -32.46704812
#> Jul 1997  -2.663621627  -95.09212602
#> Aug 1997   7.581722346   12.25963233
#> Sep 1997 -10.314020292  220.95975457
#> Oct 1997  10.249315104  130.49280363
#> Nov 1997  -1.452615921  -52.55140662
#> Dec 1997   1.092238302  115.16359225
#> Jan 1998 -14.785987947   82.61668965
#> Feb 1998 -22.791912223  115.62448319
#> Mar 1998   6.000768904   41.09726943
#> Apr 1998  -3.465781995   -5.60486435
#> May 1998  -2.851536719   78.01771348
#> Jun 1998  -6.476521580 -192.31777839
#> Jul 1998 -12.722147004  -27.36494881
#> Aug 1998  -1.751731809   60.37177315
#> Sep 1998 -22.013195775 -131.73483134
#> Oct 1998   5.798759794   95.55886301
#> Nov 1998   0.627964711    1.28535381
#> Dec 1998  17.751245181   29.14360940
#> Jan 1999  13.836946999 -201.68055585
#> Feb 1999  16.309602864 -159.64884036
#> Mar 1999  -8.083912981   79.05133025
#> Apr 1999   0.955654515   -5.59537712
#> May 1999   9.168081903  278.46565380
#> Jun 1999   4.738435430   39.54117043
#> Jul 1999  -3.952457160  269.79624187
#> Aug 1999   4.293985438  105.66101329
#> Sep 1999   8.509307909  178.18693119
#> Oct 1999  -1.703946179  131.86880388
#> Nov 1999  -0.007914038  -72.40831537
#> Dec 1999   8.606414955  -26.32911657
#> Jan 2000   6.403423802  -34.85907549
#> Feb 2000   1.068762896  -21.32519004
#> Mar 2000 -14.604777644   74.86664662
#> Apr 2000   4.551713753 -300.45498345
#> May 2000  12.720846841  -20.57101950
#> Jun 2000 -19.151875806  -14.35167183
#> Jul 2000   2.355890946  131.09571969
#> Aug 2000  10.559143097   76.45732607
#> Sep 2000   4.316772438   56.44685721
#> Oct 2000 -17.459432119  -17.53213851
#> Nov 2000  26.345754763   -0.25746856
#> Dec 2000  -0.308035714   58.87499380
#> Jan 2001 -22.561887639   17.53171579
#> Feb 2001  18.368225390  139.69229710
#> Mar 2001   4.985355661   82.54166479
#> Apr 2001   1.562468467   55.47305107
#> May 2001   5.565016905   54.53779827
#> Jun 2001   6.871069775  -53.63845039
#> Jul 2001 -33.041822297 -183.92675089
#> Aug 2001   8.783299631  -71.23421939
#> Sep 2001  14.611756864   -9.45664557
#> Oct 2001  -1.094066808   24.30159689
#> Nov 2001  13.256063791  102.04461058
#> Dec 2001  11.406805737   92.32619914
#> Jan 2002  -9.303642146   26.31799404
#> Feb 2002  -1.946233382  -68.75861883
#> Mar 2002   9.240072693   22.08611800
#> Apr 2002  -2.837713588  -55.41037774
#> May 2002   6.438188432   55.18463880
#> Jun 2002  12.049299753  -16.18329852
#> Jul 2002  -9.864334772  135.14035346
#> Aug 2002  13.629994009   -0.53331422
#> Sep 2002  -6.371366390 -240.51334407
#> Oct 2002 -12.527051445   98.98093589
#> Nov 2002  -5.751377304 -123.30316799
#> Dec 2002 -16.763008174    2.74105624
#> Jan 2003   2.628120182  -39.10052334
#> Feb 2003 -14.208832929  240.18101774
#> Mar 2003   7.738467161   55.41959989
#> Apr 2003  -6.301913980   56.07759451
#> May 2003 -25.232229681 -143.07888081
#> Jun 2003  10.456761237   25.65309367
#> Jul 2003   7.513402330   44.75129842
#> Aug 2003   7.981608534   90.91545502
#> Sep 2003 -15.676418337  -65.76117921
#> Oct 2003 -11.474768636   25.47812926
#> Nov 2003   4.355867220 -136.29594240
#> Dec 2003  10.532004191 -115.16580441
#> Jan 2004   9.635066048    9.23561855
#> Feb 2004   6.939309379  -52.61090352
#> Mar 2004  -2.300709516  -94.12824980
#> Apr 2004  -9.355586095 -116.03851187
#> May 2004  -9.026203778  146.32167885
#> Jun 2004  -0.308600940 -122.70357371
#> Jul 2004  -8.686782246  128.91223057
#> Aug 2004  21.877875041   52.19834145
#> Sep 2004  15.385301545    3.86469118
#> Oct 2004 -18.820726709    0.54809002
#> Nov 2004   9.158750045  205.09627114
#> Dec 2004  -4.017400140   58.40034881
#> Jan 2005 -12.568740002  -71.96403767
#> Feb 2005  11.843968692   31.72919743
#> Mar 2005  10.085724636   16.67156540
#> Apr 2005 -10.661521156  250.26785326
#> May 2005 -10.802139977   40.04087093
#> Jun 2005 -15.265903705  107.21119854
#> Jul 2005 -13.704004261    5.50009631
#> Aug 2005 -12.935694331   -6.13638601
#> Sep 2005 -29.610297132 -107.64435907
#> Oct 2005  11.255956830   50.43042930
#> Nov 2005   0.040275376   53.62245498
#> Dec 2005   1.626711541 -135.49772917
#> Jan 2006 -14.839223699   22.75063071
#> Feb 2006  11.648603184 -252.94187083
#> Mar 2006 -12.724193004  -81.85311433
#> Apr 2006 -11.137786657 -158.95299935
#> May 2006 -13.069370448 -108.24933233
#> Jun 2006  -1.742082303   20.58043597
#> Jul 2006  -6.832515233 -108.11823198
#> Aug 2006  -6.215682860  -18.87925541
#> Sep 2006  -1.551632320   31.27564538
#> Oct 2006 -10.864935828    7.47169985
#> Nov 2006   5.502220067  -60.43448541
#> Dec 2006  13.947806779    4.52466495
#> Jan 2007 -15.883192579  164.85396371
#> Feb 2007  20.675835289  -75.56829840
#> Mar 2007 -16.971130469  -28.81793527
#> Apr 2007   8.605076312  -73.01505059
#> May 2007  -3.796434887   52.41485203
#> Jun 2007  18.476301068  -59.17005292
#> Jul 2007  10.376561791 -118.39119861
#> Aug 2007 -14.695747682  120.03531317
#> Sep 2007 -27.769482100  -90.80713269
#> Oct 2007  -0.769797878 -154.88176869
#> Nov 2007  -9.544920721   40.80449528
#> Dec 2007   7.086794196   87.23428206
#> Jan 2008  17.770868082 -186.04776905
#> Feb 2008   8.663143079   20.61176045
#> Mar 2008   1.530058172 -106.55260009
#> Apr 2008  -0.463890794   44.42791106
#> May 2008 -16.728474148   39.00637392
#> Jun 2008 -10.898906119  -11.94045102
#> Jul 2008  -0.761757047  147.49626484
#> Aug 2008 -13.058317158 -129.46582609
#> Sep 2008  -0.623845628 -146.76126825
#> Oct 2008   3.423715685  -21.13007304
#> Nov 2008  -5.489306150   41.96187254
#> Dec 2008   9.150613267  143.33403558
#> Jan 2009  -0.876039035  -73.74681135
#> Feb 2009  -0.255794707  -12.50153428
#> Mar 2009 -12.543574063   27.98241470
#> Apr 2009  18.801248228  -44.73720260
#> May 2009  -1.409493686    4.79576801
#> Jun 2009  -1.066911374  109.28525350
#> Jul 2009   7.245550904   50.80096757
#> Aug 2009   4.288180835  -86.99107994
#> Sep 2009 -15.802157511  -70.26764757
#> Oct 2009   7.747558144 -135.94072699
#> Nov 2009 -11.642921245   34.56469912
#> Dec 2009   0.088543033   42.18054806
#> Jan 2010  -4.550780017   32.67116657
#> Feb 2010 -10.026900477  -96.35751113
#> Mar 2010   4.280695718   47.86579776
#> Apr 2010   2.025623016   78.05649166
#> May 2010   1.815832754  -18.54254995
#> Jun 2010   5.656938676  -37.14157620
#> Jul 2010  -2.776569799  -37.59064151
#> Aug 2010 -13.642484813 -104.97730923
#> Sep 2010  12.992072495   13.55098866
#> Oct 2010 -19.928465574 -104.19342492
#> Nov 2010  -1.037160872  137.15434613
#> Dec 2010   2.997662573   21.17230202
#> Jan 2011  -4.030004095  -41.99902912
#> Feb 2011   3.384909572  -51.45817426
#> Mar 2011 -14.784270394  -48.11891408
#> Apr 2011  -0.465149259   -2.28961166
#> May 2011   0.316881860  -23.58173751
#> Jun 2011   2.815326072   -4.29158886
#> Jul 2011   8.031952537  -53.34721852
#> Aug 2011  -2.088583488   24.09236569
#> Sep 2011  -3.367281762   27.57879994
#> Oct 2011  -4.563097517   98.73378846
#> Nov 2011  10.242603097  -60.71750184
#> Dec 2011  14.573951507  -24.31552344
#> Jan 2012  -2.249305874  -18.37188962
#> Feb 2012   2.900685098   56.45491125
#> Mar 2012   2.592765437  -64.56633054
#> Apr 2012   0.098922998 -198.41975169
#> May 2012  -1.846739254  -93.28107935
#> Jun 2012  16.542465847  186.45597497
#> Jul 2012   4.368543558   30.76683344
#> Aug 2012   8.473161118 -187.34768073
#> Sep 2012   9.962823002 -138.15863726
#> Oct 2012  10.674524423  121.42810047
#> Nov 2012  -0.533425785   14.14819037
#> Dec 2012   9.929262251    6.31038506
#> Jan 2013  -4.993526848  123.54612674
#> Feb 2013 -11.163933292 -109.65462143
#> Mar 2013  -9.745167645  -67.87837062
#> Apr 2013  27.874035400  -55.98672378
#> May 2013  -7.733134688   21.54763562
#> Jun 2013  34.805397484 -205.54352012
#> Jul 2013  -6.174219736  -52.04086283
#> Aug 2013   5.207824425   25.22639057
#> Sep 2013   5.925402530   15.31564241
#> Oct 2013  -9.003468488   49.21244244
#> Nov 2013  14.742813210   53.38223818
#> Dec 2013  10.851326027  -20.71323619
#> Jan 2014 -17.066874385    3.51198991
#> Feb 2014 -11.686962998 -112.09760249
#> Mar 2014 -14.194533339  -33.19658718
#> Apr 2014   6.459709494 -127.72551270
#> May 2014  -4.271327890   53.86513275
#> Jun 2014  11.898281468  134.88412839
#> Jul 2014  -1.398591424   60.11115022
#> Aug 2014   1.893959765   -1.27195862
#> Sep 2014   0.575844052   71.61389956
#> Oct 2014  -5.872461267   40.56344197
#> Nov 2014  -2.414145797  -35.48522938
#> Dec 2014   7.638003907  -83.12560816
#> Jan 2015  -6.780967332   22.50229021
#> Feb 2015   8.369941394  -68.84118696
#> Mar 2015   0.419394664  -64.87876143
#> Apr 2015   9.793095986   47.17313456
#> May 2015  14.960956543   17.46062477
#> Jun 2015  13.811671565  -39.32748689
#> Jul 2015   1.771868508   12.32405780
#> Aug 2015  -6.045588857 -200.66676498
#> Sep 2015  -0.064125536  120.97835399
#> Oct 2015 -10.309176045   14.03724416
#> Nov 2015  -5.966193013  -87.58278740
#> Dec 2015  12.300053344   96.23647351
#> Jan 2016 -21.252639407  119.02676925
#> Feb 2016   5.465412848   19.19778176
#> Mar 2016  10.114553407 -182.76005309
#> Apr 2016  13.671746024  -84.00768199
#> May 2016   7.078379701  162.33939897
#> Jun 2016  -1.225158540   16.00414539
#> Jul 2016  -7.994091347  160.01512693
#> Aug 2016  -1.793600041   11.42747080
#> Sep 2016   1.094528569 -136.54245494
#> Oct 2016   2.309265529   43.85387343
#> Nov 2016 -12.696631620  -96.15072720
#> Dec 2016   6.205258113  121.63488867
#> Jan 2017  -6.423485204  -78.07119719
#> Feb 2017   6.623578138  -68.22932097
#> Mar 2017   2.458842772 -224.34263707
#> Apr 2017  -8.478936872   18.02763931
#> May 2017  -4.347674107   78.15066352
#> Jun 2017   8.831759490  -95.72313412
#> Jul 2017   5.863186803    9.14070547
#> Aug 2017  -2.566920407  -41.57419781
#> Sep 2017  12.201357048  -66.14235523
#> Oct 2017  23.258879673   68.39716351
#> Nov 2017 -13.070423363   89.23843412
#> Dec 2017   0.002714681  -72.69075674
#> Jan 2018  11.425115700  101.57440260
#> Feb 2018  -2.219401352  -39.55934314
#> Mar 2018  -2.083145925  215.95110680
#> Apr 2018   7.499227118  221.55815780
#> May 2018   1.176056177  -25.57170694
#> Jun 2018   0.990212037   30.22917004
#> Jul 2018  13.616884687  -66.58050504
#> Aug 2018  -8.389882385  -69.60612070
#> Sep 2018 -10.649372190   68.33419337
#> Oct 2018  21.131680157  -58.92748703
#> Nov 2018   5.106671868   -7.40935495
#> Dec 2018  12.002630345 -111.22710265
#> Jan 2019  10.454600553  -59.10622513
#> Feb 2019   7.204436071   85.69446096
#> Mar 2019   5.029684073   50.88933898
#> Apr 2019   9.558412135   39.71038981
#> May 2019   4.921280559   38.67572514
#> Jun 2019  -1.559494684   37.01361846
#> Jul 2019  -4.330621776  103.67230979
#> Aug 2019 -12.234203505  235.87650580
#> Sep 2019  -2.903433729  -91.36020752
#> Oct 2019   3.402319889  127.55994229
#> Nov 2019   2.345520557 -143.90900919
#> Dec 2019   0.118239369    3.81422070
#> Jan 2020   6.047329872  -50.35721949
#> Feb 2020   7.375097630 -171.31774452
#> Mar 2020  -8.981034882   75.24516306
#> Apr 2020   1.718213563  -88.34021094
#> May 2020   9.132347891   13.65187786
#> Jun 2020 -11.051534547   42.62818848
#> Jul 2020   3.934501445  -92.51397505
#> Aug 2020 -13.698426711  -96.90957364
#> Sep 2020   7.394716153  -22.65827784
#> Oct 2020   6.383709370  -97.82239636
#> Nov 2020 -22.803538615  -53.33541279
#> Dec 2020 -20.112246984   86.63929336
#> 
#> $description
#>          type coeff
#> var1 Calendar    NA
#> var2 Calendar    NA
#> 
mysa6 <- tramoseats(myseries, myspec6)
#> Warning: [decomposition.Model decomposition: Parameters cut off]

myspec7 <- tramoseats_spec(spec = "RSAfull", usrdef.varEnabled = TRUE,
                           usrdef.var = var, usrdef.varCoef = c(17,-1),
                           transform.function = "None")
mysa7 <- tramoseats(myseries, myspec7)

# Pre-specified ARMA coefficients
myspec8 <- tramoseats_spec(spec = "RSAfull",
                           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))
mysa8 <- tramoseats(myseries, myspec8)
#> Warning: [decomposition.Model decomposition: Parameters cut off]
mysa8
#> RegARIMA
#> 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
#> 
#> 
#> 
#> Decomposition
#> Model
#> AR :  1 - 0.120000 B - 0.120000 B^2 - 0.300000 B^12 + 0.036000 B^13 + 0.036000 B^14 
#> D :  1 - B - B^12 + B^13 
#> MA :  1 - 0.950000 B^12 
#> 
#> 
#> SA
#> AR :  1 - 1.024538 B - 0.011455 B^2 + 0.108545 B^3 
#> D :  1 - 2.000000 B + B^2 
#> MA :  1 - 1.941460 B + 0.995458 B^2 + 0.036596 B^3 - 0.098708 B^4 + 0.008921 B^5 
#> Innovation variance:  0.4957156 
#> 
#> Trend
#> AR :  1 - 0.904538 B 
#> D :  1 - 2.000000 B + B^2 
#> MA :  1 - 0.722193 B - 0.998833 B^2 + 0.723360 B^3 
#> Innovation variance:  0.1026625 
#> 
#> Seasonal
#> AR :  1 + 0.904538 B + 0.818189 B^2 + 0.740083 B^3 + 0.669433 B^4 + 0.605527 B^5 + 0.547723 B^6 + 0.495436 B^7 + 0.448140 B^8 + 0.405360 B^9 + 0.366664 B^10 + 0.331661 B^11 
#> D :  1 + B + B^2 + B^3 + B^4 + B^5 + B^6 + B^7 + B^8 + B^9 + B^10 + B^11 
#> MA :  1 + 2.915179 B + 5.617938 B^2 + 8.595374 B^3 + 11.505684 B^4 + 14.135215 B^5 + 16.348945 B^6 + 18.036965 B^7 + 19.197199 B^8 + 19.965176 B^9 + 20.301074 B^10 + 20.149549 B^11 + 19.110304 B^12 + 17.206569 B^13 + 14.558551 B^14 + 11.650924 B^15 + 8.806927 B^16 + 6.228869 B^17 + 4.044510 B^18 + 2.357558 B^19 + 1.170033 B^20 + 0.354583 B^21 - 0.052292 B^22 
#> Innovation variance:  0.2584115 
#> 
#> Transitory
#> AR :  1 - 0.120000 B - 0.120000 B^2 
#> MA :  1 + 1.287572 B + 0.287572 B^2 
#> Innovation variance:  9.66767e-06 
#> 
#> Irregular
#> Innovation variance:  0.1228651 
#> 
#> 
#> 
#> Final
#> Last observed values
#>              y        sa        t          s            i
#> Jan 2020 101.0 104.26082 104.1042  -3.260821   0.15661216
#> Feb 2020 100.1 104.61371 104.5530  -4.513714   0.06076253
#> Mar 2020  91.8  83.22384 104.8133   8.576159 -21.58942879
#> Apr 2020  66.7  64.54936 105.1877   2.150645 -40.63830016
#> May 2020  73.7  77.68315 105.6408  -3.983146 -27.95763593
#> Jun 2020  98.2  85.98531 105.6977  12.214693 -19.71243272
#> Jul 2020  97.4  91.30785 105.6878   6.092154 -14.37997103
#> Aug 2020  71.7  96.93855 105.3429 -25.238546  -8.40432490
#> Sep 2020 104.7  96.44550 104.0342   8.254501  -7.58868184
#> Oct 2020 106.7  97.99258 103.1705   8.707420  -5.17788550
#> Nov 2020 101.6 100.37821 102.7766   1.221785  -2.39834446
#> Dec 2020  96.6  98.88800 101.7659  -2.287995  -2.87795452
#> 
#> Forecasts:
#>                y_f     sa_f       t_f         s_f         i_f
#> Jan 2021  90.45630 99.25146 100.88131  -8.3529406 -1.62984885
#> Feb 2021  92.96291 99.26414 100.40502  -5.6858753 -1.14087970
#> Mar 2021 107.94414 99.16721  99.96582   9.4108234 -0.79860872
#> Apr 2021 100.06082 99.00111  99.56013   1.7251675 -0.55902344
#> May 2021  92.32683 98.79338  99.18469  -5.8047774 -0.39131514
#> Jun 2021 109.76210 98.56264  98.83656  11.5896516 -0.27391913
#> Jul 2021  99.28583 98.32134  98.51308   1.7410215 -0.19174293
#> Aug 2021  72.73390 98.07763  98.21185 -24.3850120 -0.13421991
#> Sep 2021 105.42789 97.83673  97.93068   8.1237153 -0.09395290
#> Oct 2021 103.20722 97.60185  97.66762   6.1153709 -0.06576632
#> Nov 2021 101.03104 97.37483  97.42087   4.2605212 -0.04603637
#> Dec 2021  96.56590 97.15661  97.18883  -0.4705564 -0.03222456
#> 
#> 
#> Diagnostics
#> Relative contribution of the components to the stationary
#> portion of the variance in the original series,
#> after the removal of the long term trend
#>  Trend computed by Hodrick-Prescott filter (cycle length = 8.0 years)
#>            Component
#>  Cycle         3.408
#>  Seasonal     72.835
#>  Irregular     0.303
#>  TD & Hol.     3.240
#>  Others       18.296
#>  Total        98.081
#> 
#> Combined test in the entire series
#>  Non parametric tests for stable seasonality
#>                                                           P.value
#>    Kruskall-Wallis test                                      0.000
#>    Test for the presence of seasonality assuming stability   0.000
#>    Evolutive seasonality test                                0.072
#>  
#>  Identifiable seasonality present
#> 
#> Residual seasonality tests
#>                                       P.value
#>  qs test on sa                          1.000
#>  qs test on i                           1.000
#>  f-test on sa (seasonal dummies)        1.000
#>  f-test on i (seasonal dummies)         1.000
#>  Residual seasonality (entire series)   1.000
#>  Residual seasonality (last 3 years)    0.881
#>  f-test on sa (td)                      0.008
#>  f-test on i (td)                       0.052
#> 
#> 
#> Additional output variables
s_arimaCoef(myspec8)
#>            Type Value
#> Phi(1)    Fixed -0.12
#> Phi(2)    Fixed -0.12
#> BPhi(1)   Fixed -0.30
#> BTheta(1) Fixed -0.99
s_arimaCoef(mysa8)
#>            Type Value
#> Phi(1)    Fixed -0.12
#> Phi(2)    Fixed -0.12
#> BPhi(1)   Fixed -0.30
#> BTheta(1) Fixed -0.99
# }