09/2007 

Large Scale Applied Time Series Analysis with Program TSW 

(TRAMO-SEATS for Windows) 

Agustín Maravall 

Research Department 

Bank of Spain 

Alcalá, 48 

28015 Madrid 

Tel:+ 34 91 338 5476 

Fax:+ 34 91 338 5678 

e-mail address:maravall@bde.es 

Abstract 

The demostration will center on the application of program TSW to a large set of monthly time series. 

TSW is a Windows interface of updated versions of programs TRAMO (Time series Regression with 

Arima noise, Missing values, and Outliers) and SEATS (Signal Extraction in ARIMA Time Series). 

The program estimates a general regression-ARIMA model, and computes forecasts and interpolators for 

possibly nonstationary series, with any sequence of missing observations, and in the presence of outliers. 

The program contains an option for automatic model identification, automatic detection and correction of 

several types of outliers, and for pretesting and estimation of Calendar-based effects. Several types of 

intervention or regression variables can also be included. 

Next, the program estimates and forecasts the trend, seasonal, calendar, transitory, and noise components 

in the series, using signal extraction techniques applied to ARIMA models. The program contains a part 

on diagnosis and on inference, and an analysis of the properties of the estimators and of the estimation 

and forecasting errors. The last part of the output is oriented towards its use in short term economic policy 

and monitoring. 

TRAMO contains an extension (TERROR, or Tramo for ERRORs) to the problem of quality control of 

data in large data bases of time series; SEATS can be applied for estimation of long-term trends and 

(business) cycles. 

The programs can efficiently and reliably handle, in an entirely automatic manner, applications to sets of 

many thousand series. They are already being used intensively in research, data producing agencies, 

policy making institutions, and business. (Perhaps the most widely used application is Seasonal 

Adjustment.) They are freely available, together with documentation, at the Bank of Spain web site 

(www.bde.es). 

1 
1. BRIEF DESCRIPTION OF TSW 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Program TSW is a Windows interface of updated versions of programs TRAMO and SEATS (Gómez and 

Maravall, 1996) developed at the Bank of Spain (Caporello and Maravall, 2004), for applied time series 

analysis. The programs and associated manuals and documentation are freely available at the Bank of 

Spain web site (www.bde.es) 

The program estimates and forecasts regression models with errors that follow ARIMA processes. 

There may be: 

- missing observations in the series, 

- contamination by outliers, 

- contamination by other special (deterministic) effects. 

An important case of the latter is the trading day (TD) effect, caused by the different distribution of weekdays in different months, and Easter effect (EE), which captures the moving dates of Easter. 

If B : lag operator, B x(t) = x(t -1) , 

given the observations y = [y (t ), y (t ),..., y (t )] 1 2 m 

where 0 < t1 <...< t m, 

the model can be expressed as 

n n

out nc reg

y(t) = ∑ω λ (B) d (t) + ∑α cal (t) + ∑ β reg (t) + x (t), (2.1) i i i i i i i 

i=1 i=1 i=1 

where 

di(t) : dummy variable that indicates the position of the i-th outlier, λi (B) : polynomial in B reflecting 

the outlier dynamic pattern, 

cali : calendar-type variable, 

reg : regression or intervention variable, i 

x(t) : ARIMA error, 

ωi : instant i-th outlier effect, 

α i and β i : coefficients of the calendar and regression-intervention variables, respectively, 

n , n and n : total number of variables entering each summation term in (2.1). out c reg 

In compact notation, (2.1) can be rewritten as 

y(t) = z'(t) b + x (t) , (2.2) 

where b : vector with the ω, α and β coefficients, 

z'(t) : matrix with the columns containing the variables in the 3 summation terms of (2.1). 

ARIMA model for x(t) : 

φ (B) δ (B) x (t) =θ (B) a (t) , (2.3) 

where a(t) : white-noise (0, Va 

) innovation. 

φ (B), δ (B), and θ (B) : finite polynomials in B. The first one contains the stationary autoregressive 

(AR) roots, δ (B) contains the nonstationary AR roots, and θ (B) is an invertible moving average (MA) 

polynomial. 

s: number of observations per year. 

The polynomials assume the multiplicative form 

2 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

δ (B) = ∇d ∇

ds

s

, 

φ (B) = (1+φ 

1 B +... +φ B p

) (1+Φ B s

p 1 ),

θ (B) = (1+θ B +...+θ 

q B q

1

) (1+Θ B s

1 ),

where ∇ = 1− B and ∇ 1− B

s

s = . 

This model will be refered to as the ARIMA (p,d,q) (p 

s 

,d 

s 

,q 

s

)s  model. 

The model consisting of (2.2) and (2.3) will be called a regression(reg)-ARIMA model. 

When used automatically, the program 

- tests for the log/level transformation, 

- for the presence of calendar effects, 

- detects and corrects for three types of outliers: 

Additive Outliers (AO), Transitory Changes (TC), and Level Shifts (LS); 

- identifies and estimates by maximum likelihood the reg-ARIMA model (uses conditional 

likehood). 

Write the model in compact notation as 

y (t) = z' (t) b + x (t) . 

b is concentrated out of the likelihood and estimation is iterative: 

- Conditional on b → ARIMA (MLE), 

- Conditional on ARIMA → b (GLS). 

- interpolates missing values, 

- computes forecasts of the preadjustment component z'(t) b and of the ARIMA series x(t) in 

(2.2). 

2. SUMMARY OF AUTOMATIC PROCEDURE 

Pretest for the Log-level Specification 

The test consists of direct comparison of the BICs of the default model in levels and in logs (with 

a proper correction). 

Pretest for Trading Day and Easter Effects 

Regressions using the default model for the noise and, if the model is subsequently changed, the 

test is redone. 

(Slight bias towards underdetection.) 

A Remark on the use of the default (Airline) model 

Pretesting and the starting point of AMI depend heavily on the Airline model 

12 ∇∇12 t 1 12 t z = (1+θ B) (1+θ B ) a + μ

(monthly series) 

Three important reasons: 

- Many studies have shown it is appropiate for large number of real series (40-60%) 

- The Airline model approximates well many other models. 

- Excellent “benchmark” model. 

Automatic Model Identification in the Presence of Outliers 

The algorithm iterates between the following two stages 

1. Automatic outlier detection and correction 

2. Automatic model identification 

The first model used is the default model. 

At each step, the series is corrected for the outliers and other regression effects present at the 

time, and a new AMI is performed. 

If the model changes, the automatic detection and correction of outliers is performed again from 

the beginning. 

3 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 (a) AUTOMATIC OUTLIER DETECTION AND CORRECTION 

1. Assume that we know the location (t=T), but not the type of outlier. 

For T = T, we compute: ωˆ (T), ωˆ (T), ωˆ (T) AO TC LS 

τˆ ( ) T , τˆ (T , ) τˆ (T) AO TC LS 

and λ T = max { τˆ

AO ( ) T , τˆTC (T) , τˆLS (T) }

Use λ T > C to test for significance. 

C: An "a priori" set critical value. 

2. If we don’t know the timing of the outlier, we compute λt for t = 1, ... , N and use 

max λ = λ = τ tp t t 

ˆ ( ) T

If λ > C , there is an outlier of type tp (AO, TC, LS) at T. 

We correct for this outlier, and start the process again to see if there is another outlier. 

Outliers are removed one by one, until we obtain λ T < C . 

Now we proceed to joint estimation of the multiple outliers: 

* z = z + ∑

k 

ωυ ( ) B I ( ) t

t t i i t jj

i=1 

We have to perform multiple regressions to avoid (as much as possible) masking effects. 

(b) AUTOMATIC ARIMA MODEL IDENTIFICATION 

Suppose the series { } x follows the model t 

(

i

δ ( ) .i.d. φ B ) B x = θ ( ) B a , a ~ N(0

2 

t t t ,σ ).

TRAMO proceeds in two steps: 

1. First, identify δ ( ) B (unit roots) 

2. Second, identify the ARMA model, i.e, φ (B) and θ (B) . 

Identification of the Nonstationary polynomial δ (B) 

To determine the appropriate differencing of the series, we discard unit root testing. 

Problems with Unit Root Testing: 

- When regular and seasonal U.R. may be present, available tests have low power. 

For example, in 

∇zt = (1−.8B)at , 

12 ∇ z = (1−.8B )a , 12 t t 

U.R. would most likely be rejected due to the large MA root. 

- Besides, in AMI + AODC, one may try thousands of models, where: 

next try depends on previous results. 

→ Serious DATA MINING problem: the size of the test is a function of prior rejections

 and acceptances. 

→ No way of knowing the true size of the test. 

We follow an alternative approach: 

Decide “a priori”, instead of a fictitious size, the following value: 

How large the modulus of a root should be in order to accept it as 1 (unit root)? 

4 
 

 

 

 

 

 

 

 

 

 

 

 

 

For AR and MA roots the criterion is different (roughly: unit AR roots are O.K.; unit MA roots 

are avoided.) 

For AR root: 

mod > .95 ⇒ root made unit root. 

For MA root: 

mod > .99 ⇒ mod. of root made .99, 

so as to have invertibility. 

With .99 no numerical problems appear. 

We use some very useful results (Tiao, Tsay) on superconvengence of unit AR roots. 

Example: 

Let true model be the AR (3): 

2

(1−.5B)∇ zt = at 

Because of superconsistency of U.R. estimators: 

∗ If we estimate simply an AR (1) → the first U.R. ( ∇ ) is likely to be captured. 

∗ If we estimate, again, an AR (1) on the previous residuals, → the second U.R. ( ∇ ) is likely 

to be captured. 

∗ Alternatively, if we start by estimating an AR (2), both U.R. ( ∇

2 ) are likely to be captured. 

∗ Further increases in p (the order of the AR), or further AR(1) fits to residuals will not point 

to a U.R. 

The previous results extend in a straightforward manner to SEASONAL U.R. 

TRAMO uses these results. 

First, the model AR (2) ARs (1) with mean, 

2 s (1+φ B +φ B )(1+φ B )(z − μ) = a ,

1 2 s t t 

is estimated. 

As already mentioned, if the modulus of an MA root is relatively large, the bias in the estimator 

of the AR parameter can be large, and the U.R. can be missed. 

Therefore, after detecting U.R. with AR fits, TRAMO uses ARMA (1,1) fits to detect U.R. that 

might not have been captured because of ignoring possibly large MA roots. 

Hence, after the pure AR fit, TRAMO fits models of the form ARMA (1,1) ARMAs (1,1) with 

mean 

s s

(1+φ B)(1+ΦB )(z t − μ) = (1+θB)(1+ΘB )a t . 

The residuals of the last estimated model are used for a pre-test to specify a mean or not. 

(Unit roots are identified 1 by 1.) 

Identification of the stationary ARMA model: φ(B) and θ (B) 

The program selects the orders (p,q), where p = dg{φ (B)} and q = dg{θ (B)}, corresponding to 

the lowest BICp,q, where 

2 ln(N − d)

BIC = ln (σˆ )+ (p . + q) p,q p,q N − d 

5 

It searches for models of the form 

φ pr

( ) B φ 

ps 

( ) B

s

x s

t =θ 

q

( ) B θ 

r

qs 

( ) B at 

over the range 

0 ≤ p 

r

,q 

r ≤ 3, 0 ≤ p s

,q 

s ≤ 2 (1 if used with SEATS) 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This is done sequentially (for fixed regular polynomials, the seasonal ones are obtained, and viceversa). 

The search favors parsimony and “balanced” models (similar AR and MA orders). 

Remark: 

When analyzing series with care, TRAMO may suggest a few models (perhaps 2 or 3) all of which could 

be reasonably acceptable. 

When used with SEATS, looking for, among these models, the one that provides a more satisfactory 

decomposition (e.g.,a better seasonal adjustment) may provide additional tools for the choice. 

3. DECOMPOSITION OF THE SERIES AND SEASONAL AJUSTMENT 

Next, the program uses the AMB methodology to estimate unobserved components in x(t). The 

unobserved components are: 

- the trend-cycle, p(t) , 

- seasonal, s(t) , 

- transitory, c(t) , 

- irregular, u(t) , 

components, as in 

x(t) = p(t) + c(t) + u(t) + s(t) = n(t) + s(t) , (2.4) 

where n(t) denotes the SA-series. 

Broadly, the trend-cycle captures the spectral peak around the zero frequency, the seasonal component 

captures the peaks around the seasonal frequencies, the irregular component picks up white-noise 

variation, and the transitory component captures transitory variation that differs from white noise. 

From the ARIMA model for the series, the models for the components are derived. 

Typically, for the trend-cycle and seasonal component, 

∇

D p(t) = wp

(t) , D = d + ds , (2.5) 

B

s−1

S s(t) = ws(t) , S = 1+ B + ... + , (2.6) 

where w (t) and w (t) are stationary ARMA processes. 

p s 

The transitory component is also a stationary ARMA process. 

The irregular component is white noise. 

The processes wp(t), ws(t) , c(t) , and u(t) are assumed to be mutually uncorrelated. 

Aggregation of the models for p, s, c, and u yields the ARIMA model (2.3) for the series x(t) . 

The model for the SA-series is obtained through aggregation of the models for p(t) , c(t) , and u(t) . Its 

basic structure is also of the type (2.5), with p replaced by n. 

It is well-known that, in (2.4), there are a variety of ways in which the additive white noise can be 

assigned to the components. Identification is achieved in SEATS by imposing the “canonical condition”, 

whereby all additive white noise is assigned to the irregular component. In this way, the variance of the 

later is maximized, and the rest of the components are as stable as possible, given the stochastic features 

of the series. 

The component estimator and forecast are obtained by means of a Wiener-Kolmogorov type filter as the 

MMSE estimators (under the normality assumption, equal to the conditional expectation) of the signal 

given the observed series. 

The filter is two-sided, centered, symmetric, and convergent, and can be given a simple analytical 

representation. 

Let x(t) follow the model 

φ (B) x (t) =θ (B) a (t) , a (t) ∼ wn (0, Va) , (2.7) 

where φ (B) also contains now the unit roots. 

6 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Consider the decomposition of x(t) into “signal plus non-signal” as in x (t) = s (t) + n (t). 

Let the model for the signal be 

φ (B) s(t) =θ (B) a (t) , a (t) ∼ wn (0, V ) ,

s s s s s 

where φs 

(B) will contain the roots of φ (B) associated with the component s. 

Denote by φn 

(B) the polynomial in B with the roots of φ (B) that are not in φs (B) (that is, the AR 

roots of the non-signal). 

Then, if F = B -1 denotes the forward operator (such that F x (t) = x (t+1),) for a doubly infinite series, the 

WK filter to estimate the signal is given by 

V θ (B) φ (B) θ (F) φ (F) 

s s n s n ν s 

(B,F) = , (2.8) 

Va θ (B) θ (F) 

or, equivalently, by the ACF of the stationary ARMA model 

θ (B) z (t) = [θ (B) φ (B) ] b(t) , b (t) ∼ wn (0, V / V ) . 

s n s a 

The estimator of the signal is obtained through 

s (t) ˆ =ν s 

(B, F) x (t) . (2.9) 

In practice, one deals with a finite series: [ x(1), x(2), ... , x(T) ]. 

Given that the WK filter converges, for long-enough series, the estimator of the signal for the mid-years 

of the sample can be considered to be equal to the final estimator (that is, the one that would be obtained 

with the doubly infinite series). 

More generally, given the series [ x(1), ... , x(T) ], the MMSE estimators and forecasts of the components 

are obtained applying the two-sided WK filter to the series extended at both ends with forecasts and 

backcasts. 

It is possible, however, to obtain the full effect of the doubly infinite filter with just a small number of 

forecasts and backcasts. 

The model-based framework is exploited to provide (SE) of the estimators and forecasts (as well as of the 

rates of growth). 

Being obtained by using forecasts, the component estimators at the end points of the series are 

preliminary, and will suffer revisions as future data become available. 

The model-based framework is also exploited to analyze revisions (size and speed of convergence) and to 

provide further elements of interest to short-term monitoring. 

4. THE APPLICATION: AUTOMATIC MODEL IDENTIFICATION AGGREGATE RESULTS 

(a) In-Sample Fit 

The example consist of 500 monthly exports and imports series of 15 European Union countries, 

spanning the period January 1995 – January/February 2005 (121/122 observations). All series were 

treated with the input parameter RSA = 4, which implies automa tic testing for the log/level 

transformation, for the possible presence of a deterministic mean, and for the possible presence of a TD 

effect - with the parsimonious specification “working/non-working days” – and of EE. Automatic 

identification of the (p,d,q) (ps

,ds,qs)12 orders of the ARIMA model, joint with automatic identification of 

the 3 types of outliers already described, is also performed. Next, the complete model is estimated, the 

models and filters for the components are derived, and the components are estimated and forecasted; 

approximated estimation and forecasting SE are also provided. Execution time of the full set - in a 

standard portable PC-takes 2-3 min. 

The output file containing the aggregate results for the set is displayed next. 

7 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-------------------------------------------- 

SERIES IN FILE : 500 

 SERIES PROCESSED : 500 

SUMMARY RESULTS 

 ------------------------------

TABLE 1 : GENERAL FEATURES 

 # of series % 

 ---------------------------------------------- 

Levels 36 7.20 

 ---------------------------------------------- 

Logs 464 92.80 

 ----------------------------------------------- 

Regular Diff. 450 90.00 

 ----------------------------------------------- 

 Seasonal Diff. 377 75.40 

 ----------------------------------------------- 

 Stationary 22 4.40 

 ----------------------------------------------- 

 Non Stationary 478 95.60 

 ----------------------------------------------- 

Purely Regular 78 15.60 

 ----------------------------------------------- 

 Nz Too Small 0 0.00 

 for complete AMI

 ----------------------------------------------- 

 Airline Model (Default) 266 53.20 

 -----------------------------------------------

TABLE 2 : DIFFERENCES

 ----------------------------------

# of series 

 with D = 0 D = 1 D = 2 Total

 --------------------------------------------------- 

BD = 0 22 101 0 123 

 --------------------------------------------------- 

BD = 1 28 348 1 377 

 --------------------------------------------------- 

Total 50 449 1 500 

 --------------------------------------------------- 

TABLE 3 : ARMA PARAMETERS

 -------------------------------------------- 

% of series

 with P Q BP BQ 

 -------------------------------------------------- 

0 71.4 26.4 92.8 21.2 

 -------------------------------------------------- 

1 19.2 70.4 7.2 78.8 

 -------------------------------------------------- 

2 7.2 2.2 0.0 0.0 

 -------------------------------------------------- 

3 2.2 1.0 0.0 0.0 

 -------------------------------------------------- 

Total > 0 28.6 73.6 7.2 78.8

 ----------------------------------------------------------- 

Total 

Average 0.4 0.8 0.1 0.8 2.0 

 # of param.

 per series 

 -------------------------------------------------------------

8 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-----------------------------------------------------------------------

------------------------------------------------------------------------

------------------------------------------------------------------------

------------------------------------------------------------------------

------------------------------------------------------------------------

------------------------------------------------------------------------

------------------------------------------------------------------------

------------------------------------------------------------------------------- 

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

TABLE 4 : MISSING VALUES AND REGRESSION 

 Outliers 

MO AO TC LS Tot 

% of series with 0.2 43.6 29.2 28.0 64.4 

average # per series 4.0 0.8 0.4 0.4 1.6 

 maximum # per series 4 21 4 5 24 

 minimum # per series 0 0 0 0 0 

 Calendar Var. 

TD EE Tot 

% of series with 76.2 13.2 77.0 

It is seen that close to 93% of the series are modeled in the logs and 4% are found stationary. For 16% of 

them the model has no seasonal structure. The default Airline model is found appropriate for 

approximately 53% of the series. 

Concerning unit roots, the transformation ∇∇12 is chosen for close to 70% of the series; for 20% of them 

only ∇ is needed, and for 6% only ∇12 is needed. A slightly smaller percentage requires no differencing, 

and for one series the transformation ∇

2∇12 seems appropriate. As for the ARMA parameters, the 

average number per series is 2.0, implying thus highly parsimonious models. The models are dominated 

by IMA(1,1) regular and seasonal structures; 30% require adding an AR structure, in 1/3 of the cases with 

p = 2 or 3. A few series present q = 2 or 3, and a stationary AR seasonal structure is only needed for about 

7% of the series. 

Slightly more than 1/3 of the series do not need outlier correction, and the average number of outliers per 

series is 1.6, a relatively small number. The AO type is the most dominant, with the rest evenly 

distributed between LS and TC outliers. 

TD is detected in over 75% of the series; EE is far less significant (roughly, 13%). 

Finally, the results of several (approximate) tests are given. Q is the Ljung-Box test for residual 

autocorrelation (in our case, χ 2 with approximately 22 df), N is the Behra-Jarque test for Normality of 

the residuals ( χ 2 with 2 df), SK and Kur are t-test for skewness and kurtosis in the residuals, QS is the 

Pierce test for residual seasonality ( χ 2 with 2 df), Q2 is the McLeod and Li test for linearity in the 

residuals (in our case, χ 2 with, approx. 24 df) and Runs is a t- test for randomness in the signs of the 

residuals. 

The aggregate results pass comfortably all the previous tests at the 99% level. Only the empirical size of 

Q2 is very slightly below the theoretical size. 

Two additional tests for in-sample fit have been added. One is a nonparametric test for the presence of 

seasonality which is applied to the model residuals. At the 99% significance level, out of the 500 series, 

only 6 display (borderline) evidence of residual seasonality, clearly in line with the test size. The other 

test looks at the residuals for the first and second half of the series, and tests for the equality of the two 

means and variances. Again, at the 99% significance level, 8 series fail the test, slightly above the 5 that 

could be expected. 

In summary, the previous evidence points toward a close to perfect aggregate performance of the AMI 

results. 

9 
 Mean Max Approx Beyond % ofseries 

 1% CV 1% CV that pass the

 test (99%) 

------------------------------------------------------------------------------------------

 Length 121.8 122 

------------------------------------------------------------------------------------------

 # ofARMA 2.0 5 

 param. per serie 

-------------------------------------------------------------------------------------------

 

 

# of outliers 1.6 24 

per serie 

-------------------------------------------------------------------------------------------

Q 22.8 56.8 40.29 0.4 99.6 

-------------------------------------------------------------------------------------------

N 1.9 138.00 9.21 1.0 99.0 

-------------------------------------------------------------------------------------------

SK 0.1 5.8 2.58 0.6 99.4 

-------------------------------------------------------------------------------------------

Kur 0.0 10.2 2.58 1.2 98.8 

-------------------------------------------------------------------------------------------

QS 9.21 0.4 99.6 

-------------------------------------------------------------------------------------------

Q2 23.1 64.7 42.98 2.6 97.4 

-------------------------------------------------------------------------------------------

Runs -0.1 2.4 2.58 0.2 99.8 

---------------------------------------------------

 

 

 

 

 

 

 

 

 

----------------------------------------------- 

TABLE 5 : SUMMARY STATISTICS 

The “modal” model can be described as the Airline model for the logs and no mean, with one or two 

outliers (one of them an AO), and TD effect. 

The model contains 5 or 6 parameters: θ1 controls the stochastic character of the trend, θ 12 controls that 

of the seasonal component, α captures the importance of the TD effect, σ 

a 

reflects the overall 

forecasting accuracy, and ω1 , (perhaps ω 

2 ) the effects of the outlier (s). 

For the sample size considered (121/122 obs.) this seems a sensible and parsimonious parametrization. 

The following figures summarize the previous results. The first two figures display the relative frequency of 

series according to the number of outliers per series (AO, TC, and LS with different colours), and the number 

of ARMA parameters per series. The next seven figures compare the histograms and asymptotic distributions 

for each of the 7 (approximate) tests: Autocorrelation, Normality, Skewness, Kurtosis, non-Linearity, 

Randomness of the residuals, and residual seasonality. Very few anomalies are detected. Still, a few 

problematic series can be detected, such as the one with Q= 56.8, the one with QS=9.5, or the one with 24 

outliers. 

10 
 

 

 2

O u tlie r s 

% % 

40 

35 

30 

25 

20 

15 

10 

5 

0 

# O u tlie r s /S e r ie s 

% o f L S % o f T C % o f A O 

0 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 

M e a n 1 ,6 3 

A R M A P a r a m e t e r s p e r m o d e l 

# o f P a r a m e te r s 

0 ,0 1 ,0 2 ,0 3 ,0 4 ,0 5 ,0 

% 

80 

75 

70 

65 

60 

55 

50 

45 

40 

35 

30 

25 

20 

15 

10 

5 

0 

M e a n 2 ,0 4 

4 1 ,3 4 5 ,8 5 0 ,3 5 4 ,8 5 9 ,3 

R e s id u a l A u t o c o r r e la t io n 

12 

11 

10 

9 

8 

7 

6 

5 

4 

3 

2 

1 

0 

 0 ,8 5 ,3 9 ,8 1 4 ,3 1 8 ,8 2 3 ,3 2 7 ,8 3 2 ,3 3 6 ,8 

Q -S ta t. 

> 6 0 .0 0 0 

M e a n 2 ,7 7 Df 

11 
 

 

 

 

 

55 

50 

45 

40 

35 

30 

25 

20 

15 

10 

5 

0 

% o f s e r ie s w ith N > 2 0 .0 

M e a n 1 ,9 0 

0 ,5 2 ,5 4 ,5 6 ,5 8 ,5 1 0 ,5 1 2 ,5 1 4 ,5 1 6 ,5 1 8 ,5 

N O R M A L IT Y o f R e s id u a ls 

N O R M A L IT Y 

% 

S K E W N E S S o f R e s id u a ls ( t - v a lu e ) 

S K E W N E S S 

% 

12 

11 

10 

9 

8 

7 

6 

5 

4 

3 

2 

1 

0 

-3 ,9 -3 ,3 -2 ,7 -2 ,1 -1 ,5 -0 ,9 -0 ,3 0 ,3 0 ,9 1 ,5 2 ,1 2 ,7 3 ,3 3 ,9 

% w it h S K > 4 . 1 % w ith S K < - 4 .1 

M e a n 0 ,1 0 

K U R T O S I 

-3 ,9 -3 ,3 -2 ,7 -2 ,1 -1 ,5 -0 ,9 -0 ,3 0 ,3 0 ,9 1 ,5 2 ,1 2 ,7 3 ,3 3 ,9 

% 

13 

12 

11 

10 

9 

8 

7 

6 

5 

4 

3 

2 

1 

0 

% w it h K u r > 4 . 1 

% w ith K u r < - 4 .1 

M e a n -0 ,0 3 

S o f R e s id u a ls 

KURTO SI

 ( t- v a lu e ) 

S 

12 
 

 

 

 2 2 ,7

M e a n 0 ,0 6 

R u n < 4 . 1 

L in e a r ity o f r e s id u a ls 

12 

11 

10 

9 

% 

8 

7 

6 

5 

4 

3 

2 

1 

0 

L in e a r ity 

> 6 0 .0 0 0 

Mean 7 Df 

 0 ,8 5 ,3 9 ,8 1 4 ,3 1 8 ,8 2 3 ,3 2 7 ,8 3 2 ,3 3 6 ,8 4 1 ,3 4 5 , 8 5 0 ,3 5 4 ,8 5 9 ,3 

R A N D O M N E S S in S ig n o f R e s id u a ls ( t - v a lu e ) 

11 

-

10 

9 

8 

7 

6 

5 

4 

3 

2 

1 

-

0 

R A N D O M N E S S 

-3 ,9 -3 ,3 -2 ,7 -2 ,1 -1 ,5 -0 ,9 -0 ,3 0 ,3 0 ,9 1 ,5 2 ,1 2 ,7 3 ,3 3 ,9 

% 

% % R u n > 4 .1 

HIST O G RAM RESIDUAL SEASO NALIT Y 

(NONPARAM ETRIC TEST ) 

0 

0,02 

0,04 

0,06 

0,08 

0,1 

0,12 

0,14 

0,16 

0,18 

1 3 5 7 9 11 13 15 17 19 21 23 25 27 

13 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(b) Out-of-Sample Forecasts 

It is well-known that it is easier to get a good in-sample fit than a good out-of-sample forecasting. A fast 

and simple forecasting check can be done by running TSW with the input TERROR = 1, and setting k1 = 

3 and k2 = 4 as thresholds for the t-values of the forecast errors (see Caporello and Maravall, 2003). This 

implies applying the automatic procedure to all series without considering the last observation. The outof-sample one-period-ahead forecasts are computed as well as their associated SE. Let the forecast for the 

last period (T) made at period (T-1) be y(T|T-1) and denote by σ (T|T-1) the associated SE. The 

standarized forecast error is given by ε (T|T-1) = [y(T) - y(T|T-1)] / σ (T|T-1). 

The following tables present the series in the group that have 

(4 > | ε | > 3) and (| ε | > 4.) 

SERIES TITLE Date Log(New Value) Log(Forecast) Diff. StdDev T-Value 

44 - E15_0400_1_3 02-2005 11.94 12.58 -0.64 0.17 -3.59 

143 - E15_1120_1_2 01-2005 13.03 12.88 0.15 0.04 3.39 

144 - E15_1120_1_3 01-2005 12.85 13.34 -0.48 0.14 -3.39 

154 - E15_1130_1_3 01-2005 12.89 13.33 -0.44 0.13 -3.21 

179 - E15_1415_1_8 02-2005 6.73 6.96 -0.23 0.06 -3.74 

182 - E15_1811_1_1 01-2005 12.78 13.01 -0.23 0.07 -3.10 

209 - E15_5190_1_8 01-2005 8.26 8.15 0.10 0.03 3.24 

248 - E15_5500_1_7 02-2005 11.41 12.27 -0.86 0.28 -3.07 

15 - E15_0039_2_4 02-2005 9.51 9.09 0.42 0.13 3.14 

95 - E15_1051_2_4 01-2005 9.70 10.33 -0.63 0.20 -3.03 

143 - E15_1120_2_2 01-2005 12.50 12.28 0.22 0.06 3.61 

Summary Statistics 

 500 Series were tested. 

 11 Releases exceeded the critical value t=3 

 0 Releases exceeded the critical value t=4 

 0 Series produced a Run-Time EXCEPTION.

 489 Series passed the test: |t| < 3. 

If the 500 values of ε were sampled from a N(0,1) distribution, the most likely number of ε ’s in the 

ranges (3 < | ε | < 4) and (| ε | > 4) would be 1 and 0, respectively. 

The average number of outliers detected in the in-sample fit (1.6 per series) implies that about 8 outliers 

could be expected among the 500 ε ’s. 

Of the 500 forecast errors obtained, 12 have fallen in the range 

(3 < | ε | < 4) and none in the range (| ε | > 4). 

Comparing (11 and 0) to the expected values ( 9 and 0), the out-of-sample forecasting performance is 

reasonably good. 

Still, the previous table indicates that, at least, series 44 and 179 in the imports group, and series 143 in 

the exports group can be considered problematic. 

It is a general result that, despite the fact that both groups of series (imports and exports) are considerably 

noisy, the behavior of exports tends to be a bit more regular than that of imports. 

The histogram of the 500 standardized one – period – ahead forecast error is displayed next. Despite a 

slight negative bias, the histogram conforms well to the asymptotic N (0,1) distribution. 

14 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

HISTOGRAM: ONE- PERIOD- AHEAD FORECAST 

ERRORS 

0 

0,1 

0,2 

0,3 

0,4 

0,5 

-4 -3,2 -2,4 -1,6 -0,8 0 0,8 1,6 2,4 3,2 4 

(c) Summary Results for Individual Series 

Identification of additional series that are problematic from a fitting point of view can be done through the 

summary matrices output by the program, where each series occupies one row of the matrix. An Excel 

macro (also available at the Bank of Spain web site) reads these matrices and pick up the series that 

appear to be problematic, according to criteria that can be set by the user. These criteria may include 

additional considerations. Some important ones are: a) classifying a series as problematic when the 

number of outliers is above a certain threshold (for example, 4% of the observations); b) checking close 

to non-invertible models for controlling possible overdifferencing (in particular, values of the moving 

average parameter close to -1 in IMA(1,1) regular or seasonal structures); c) checking for possible 

underdetection of TD and EE (TSW is more concerned about spurious detection –more difficult to detectand hence is slightly biased towards underdetection). 

(d) Seasonal Adjustment 

Besides the summary files containing the main results of the reg-ARIMA model adequacy (TRAMO 

part), the program also outputs summary results having to do with seasonal adjustment and the adequacy 

of the series decomposition (SEATS part). First, it indicates for which series the model obtained in AMI 

and used for computing the series forecasts has been changed automatically by the program to provide a 

better decomposition. The most important cause of a change is when the model does not provide an 

admissible decomposition. The new model used to adjust the series is shown. In our example, the model 

is changed for 25 series, and 11 of these changes (2% of the series in the set) are due to the absence of an 

admissible decomposition. 

Then, a check is made on the accuracy of the spectral factorization that provides the component’s models. 

No series in the set yields any problem in this respect. Next, a check is made to detect significant 

differences between the ACF and CCF of the theoretical estimators and the empirical estimates. In the 

example, 10% of the series show differences at the 5% significance level (work at the USBC indicates 

that these tests require some more refinement). 

Next the standard deviations of the component innovations are presented. They permit to assess, for 

example, the relative stability of the seasonal component and trend-cycle. Approximate SE of the 

components estimators, of the revisions the concurrent estimator will suffer, and of some associated rates 

of growth are also provided. (Naturally, smaller SE are always preferable.) The speed of convergence of 

the concurrent estimator to the final one is displayed, as well as information concerning the significance 

of the detected seasonality in the final and preliminary estimators and in the next year of forecasts. 

Finally, when appropriate, the bias effect on the levels induced by the log transformation is also 

computed. 

Additional important checks are being added to this summary output. Examples are a test for 

idempotency (seasonal adjustment of the adjusted series should basically reproduce the adjusted series), a 

check for seasonal overdifferencing, a check for highly stationary and unstable seasonality, and –most 

importantly- spectral domain tools similar to the ones in X12ARIMA that yield information on the gain 

and phase effect of preliminary estimators and on residual seasonality or calendar effects. Thus, focusing, 

for example, on the possible presence of residual seasonality, it can be detected through the QS test (in 

15 
 

 

 

 

 

 

 

 

 

 

 

 

 

TRAMO), the nonparametric test for the presence of seasonality in the residuals (in TRAMO), the tests 

for significance of seasonality: historical and preliminary estimates, and forecasts (in SEATS), the 

comparison of the theoretical and empirical variances of the (differenced) seasonally adjusted series and 

seasonal component (in SEATS), and two different estimators of the spectra of the residuals and 

(differenced) seasonally adjusted series (in future version of SEATS). 

Final Remark: 

Once problematic series have been identified, editing “Model ø” in the main window, alternative 

specifications can be tried until a final one is selected for each of the series. Then, clicking in “Model ++” 

in the main window, the set of final model can be saved (in a variety of manners) in order to avoid AMI 

every time a new observation becomes available. 

REFERENCES 

The following list contains some basic references having to do with TSW, TRAMO, SEATS, and TERROR. 

They contain, in turn, more detailed references. Additional references and documentation can be found in 

(www.bde.es→professionals →econometrics software). 

CAPORELLO, G., and MARAVALL, A. (2004), "Program TSW: Revised Reference Manual", Working 

Paper 0408, Servicio de Estudios, Banco de España. 

CAPORELLO, G. and MARAVALL, A. (2003), "A Tool for Quality Control of Time Series Data. Program 

TERROR", Occasional Paper 0301, Servicio de Estudios, Banco de España. 

GÓMEZ, V. and MARAVALL, A. (2001a), "Automatic Modeling Methods for Univariate Series", Ch.7 in 

Peña D., Tiao G.C. and Tsay, R.S. (eds.), A Course in Time Series Analysis, New York: J. Wiley and Sons.

GÓMEZ, V. and MARAVALL, A. (2001b), "Seasonal Adjustment and Signal Extraction in Economic Time 

Series", Ch.8 in Peña D., Tiao G.C. and Tsay, R.S. (eds.) A Course in Time Series Analysis, New York: J. 

Wiley and Sons.

GÓMEZ, V. and MARAVALL, A. (1996), "Programs TRAMO and SEATS. Instructions for the User", (with 

some updates), Working Paper 9628, Servicio de Estudios, Banco de España. 

16