Abstract
We explore the impact of the COVID-19 shock on a very high frequency indicator: the Spanish daily sales data compiled by the Tax Agency. Firstly, we present a detailed list of the issues related to its modeling, its decomposition (trend, seasonality, and irregularity) and its final seasonal adjustment, which requires a set of deterministic factors linked mostly to calendar effects. Then, we assess the impact of the COVID-19 shock on these tasks. This assessment provides a timely perspective on the evolution of the shock and the challenges that it posed for modeling and seasonal adjustment, clearly related to its unusual and extreme features. The aim of the paper is eminently empirical and dominated by the need to square the unprecedented shock with the available methods and software in a computing environment centered on the R programming language. The methodology draws heavily on a structural approach and it is currently in use by the Tax Agency to compile and disseminate its daily sales data.
Keywords
1. Introduction
The year 2020 will be marked in the future books of History as one of the most outlying and tragic ones, due to the spread of the SARS-CoV-2 virus (CV19 for brevity) and the resulting health and economic crises linked to the policy interventions enforced by governments around the world aimed at containing and mitigating the disease. Both crises were global, sharp, and very intense, without historical precedents and posing serious and numerous challenges for many activities, ranging from health surveillance and prevention to economic policy and crisis management. Of course, one of the most affected activities has been economic measurement and monitoring, fostering a plethora of proposals and methods to compensate the informational gaps and the modeling difficulties created by the crisis (Leiva-León et al. 2020; Lenza and Primiceri 2020; Maroz et al. 2021; Ng 2021; Primiceri and Tambalotti 2020; Schorfheide and Song 2020).
The CV19 shock can be considered as an exogenous shock linked to adverse health conditions with sharp and huge economic consequences. Although its origin is clearly exogenous, many policy decisions oriented toward its control and containment (lockdowns, mobility constraints, capacity limits, etc.) were critical to shape its economic effects. In this way, we will consider two separate phases: lockdown and new-normal (also called “recovery” or “de-escalation”).
This paper contributes along two different lines. The first one is to present a statistical indicator that retains the “hard” nature of the core of the official short-term indicators but with a sampling frequency (daily) very well suited for the analysis of shocks like the CV19 one: the daily sales compiled by the Spanish Tax Agency as a by-product of its on-line Value Added Tax (VAT) system.
One important and valuable feature of sales data is its “hard” nature. Unlike most alternative sources whose use has increased due to the shock (Ten et al. 2022), sales data define a complete valuation at current prices of effective transactions, measured directly from administrative records. This fact allows its easy integration with the rest of official statistical sources, especially those related to the National Accounts and to standard economic indicators like the retail sales or the index of industrial production.
The second line is methodological: how to deal with the impact of the CV19 shock on the econometric models used to represent and seasonally adjust daily economic data. As we will explain later in detail, our proposal is based on an intervention analysis especially designed to cope with the bulk of the impact of the CV19 shock on the level of the daily sales data. This approach may be considered as an adaptation of the official recommendations related to the seasonal adjustment of monthly indicators affected by the CV19 shock to the daily case (Eurostat 2020). These recommendations hinge around expanding the models used for seasonal adjustment, in order to include an intervention analysis to take into account the effects of the CV19 shock.
At the time of writing this paper (August 2022) it is unavoidable to have a hindsight perspective about the CV19 shock that permeates the analysis, although we have tried to keep the real-time perspective in mind as much as possible.
The paper is organized as follows. The second section presents the data. The third section develops the econometric methodology, which is implemented in two stages: preprocessing and decomposition (signal extraction). The empirical results are presented in the fourth section, with the focus on the estimation of the CV19 shock across several specifications. The paper ends presenting the main conclusions and future developments.
2. Data
Daily sales series of monthly VAT taxpayers comes from the Immediate Supply of Information System (SII, Sistema Inmediato de Información), introduced in January 2017 and officially implemented by the Spanish Tax Agency since July 2017 (Cuevas et al. 2021; Tax Agency 2017).
This system allows the exchange of tax information between the Spanish Tax Agency and taxpayers required by the SII practically in real time, by supplying the detail of the invoicing records within four days, through the electronic platform of the Spanish Tax Agency.
In this way, both tax management and tax compliance are improved (e.g., by the taxpayers comparison of the information in their books with the information provided by their customers and suppliers).
The group compulsorily included in the SII is made up of all those taxpayers whose obligation to declare VAT is monthly:
Large Companies (turnover greater than 6,010,214.04 EURO in the previous year). This very specific cut-off is just a legal threshold, not a statistical one.
Those companies that pay taxes through the special regime for groups of companies. A group of companies is considered when it is formed by a parent company and its subsidiaries. They must be firmly bound to one another.
Registered, voluntarily, in the Monthly VAT Return Registry.
In addition, this system is applied to those taxpayers who voluntarily adopt it.
Thus, the SII comprises about 63,000 taxpayers representing around 70% of the country’s total business turnover, with a great diversity of coverage by activities.
Figure 1a to c show the daily time series with different samples and Figure 1d shows the corresponding monthly average, in order to be able to appreciate the main characteristics of the series. The sample considered comprises from the full-fledged implementation of the SII (July 1st, 2017) until the end of 2020. At first glance, it is possible to see the large volatility of the series, due to the different invoicing patterns, that we will comment on later, such as the large effect of the end of the month, which makes very difficult to distinguish a relevant signal of the underlying evolution. Likewise, a clear weekly pattern can also be observed, as well as a significant annual seasonality.

(a) Daily sales from SII (million EURO). Sample 01/07/2017 to 31/12/2020. (b) Daily sales from SII (million EURO). Sample 01/07/2017 to 01/07/2018. (c) Daily sales from SII (million EURO). Sample 01/07/2017 to 31/08/2017. (d) Daily sales from SII (million EURO). Monthly averages.
We have used temporal averaging in Figure 1d as a rough and simple way to discount the weekly and the monthly seasonality, making thus visible a trend and an annual seasonal pattern, both somehow distorted by the CV19 shock.
As a general rule, firms must send their invoices to the Tax Agency four days after they have been issued. However, the information received by the Tax Agency is not always the final one, as it can be completed and corrected in the following days. Experience indicates that it is necessary to wait around two weeks for the stabilization of the levels that allows us to consider the data as definitive.
3. Modeling Daily Data
In this section, we present the econometric methodology used in the paper. Modeling economic daily time series poses several and difficult challenges due to the coexistence of multiple seasonal components linked to various frequencies, the strength of its irregular component and its sensitivity to exogenous factors (e.g., outliers) that distort its usual behavior and, last but not least, the complex structure of the calendar: different length and composition of the months, moving festivities (e.g., Easter), leap years, and a time-varying calendar of working days that interacts with the composition of the months (Ladiray et al. 2018).
We use the structural model of unobserved components proposed by De Livera et al. (2011) to perform modeling and seasonal adjustment of the Spanish daily sales data. The model, called TBATS (acronym for Trigonometric seasonality, Box-Cox transformation, ARMA innovations, Trend, and Seasonality), complemented with a suitable dynamic-regression pre-processing, provides a flexible although parsimonious way to handle the complex nature of daily time series. The econometric methodology has two steps:
Pre-processing (linearization). In this step we apply an intervention analysis by means of exogenous deterministic variables designed to control for the presence of outliers and specific calendar effects that, due to their moving nature, do not fit well into the structural representation considered by TBATS (Bell and Hillmer 1983; Hillmer et al. 1983). This intervention analysis is a preprocessing step of the observed series that renders it suitable for TBATS.
Structural decomposition using TBATS. The pre-processed time series is decomposed into trend-cycle, seasonality, and irregularity. As we will expose below, the seasonal component has a complex nature due the coexistence of multiple seasonal patterns, some of them with fractional periodicities.
Let us now explain both steps with some detail.
3.1. Pre-Processing (Linearization)
Although TBATS can handle fractional seasonal periodicities (e.g., 30.4375 days for the monthly seasonality) the fact that this fractional feature is due to a (weighted) average of different periodicities (28, 29, 30, and 31 days) and not to a fixed periodical pattern hampers its modeling, especially when the time span is not large, as is our case. Easter and bank holidays share this complex periodicity but on an annual basis. This explains why De Livera et al. (2011) strongly recommend the use of a pre-preprocessing step before applying TBATS.
In addition, the monthly seasonal pattern is heavily concentrated on some specific days of the month (e.g., first day, last day, etc.), diverging from the smooth profile that characterizes the trigonometric functions used by TBATS. This is why Hyndman (2017) recommends a deterministic specification for the monthly seasonality.
All these effects are represented by deterministic variables and their impact on the observed time series is estimated using a regression model that includes a linear trend and a multiple seasonal component affine to the one used in the trigonometric seasonal representation used by TBATS. The regression model is:
Being:
y t : (log-transformed) observed variable (daily sales).
xt: m deterministic (dummy) variables linked to the bank holidays and to a set of within-the-month effects that are described at length in section 4.1. The vector of parameters
The term
The index
Each seasonal component is defined by its periodicity mi (in days). Based on a previous analysis (Cuevas et al. 2021) we have considered three components (weekly, monthly, and yearly) whose periodicities, expressed in days, are: 7, 30.4375, and 365.25. The periodicity of the monthly seasonal component takes into account both the different length of the months and the leap years. The fractional periodicity of the annual seasonality is only due to the presence of leap years (Ladiray et al. 2018).
The parameters
The decision to take logarithms is based on a mean-range analysis performed on the pre-CV19 sample (up to March 15, 2020). This analysis splits this sample into a set on non-overlapping subsamples of 31 days, computing for each one the range (difference between its maximum and minimum) and its mean. The length of the subsamples (31 days) covers at the same time weekly and monthly fluctuations. We have trimmed each subsample by excluding its maximum and minimum values, in order to reduce the influence of the outliers on the means and ranges. The corresponding scatterplot of the trimmed subsamples can be seen in Figure 2.

Mean-range analysis of the pre-CV19 sample.
There is a clear tendency of higher mean levels to be associated with higher volatility. This association may be stabilized by applying logarithms. The slope of the underlying regression line is statistically different from zero.
A preliminary TBATS estimate of the Box-Cox parameter using the pre-CV19 sample yields a value of 0.8387, suggesting the convenience to apply some stabilizing transformation to the data and moving us to apply the logarithmic transformation in all the cases.
It is interesting to note that the regression model Equation (1) can be considered as a one-equation approximation to the complete structural TBATS model that will be presented below, especially due to its similar treatment of the (multiple) seasonality. This similitude enhances the complementarity of steps 1 and 2.
The number of harmonics, k i , associated with each seasonal component (weekly, monthly, and annual) can be determined by means of a preliminary estimate of the TBATS model applied to the original time series.
Equation (1) is estimated by Ordinary Least Squares (OLS) and allows us to linearize the observed time series by subtracting the estimated effect due to the m deterministic variables linked to the bank holidays and to a set of within-the-month effects, x t :
This correction does not consider the remaining deterministic variables (the linear trend and the trigonometric seasonals) that are thus just proxy variables introduced to reduce the danger of obtaining biased estimates for the dummy effects collected in
3.2. Structural (TBATS) Decomposition
The TBATS approach is based on the representation of the unobserved components (trend, seasonality, irregularity) by means of explicit dynamic models (Harvey 1989). An alternative approach, based on reduced-form models, offers great flexibility to include exogenous variables but does not provide an estimate of the underlying components (Espasa et al. 1996; Liu 2005). Although less complete, we have also used this approach as a cross-check (Cuevas et al. 2019).
Following the structural approach, the model incorporates a parsimonious but rather general representation of the trend. It also includes an explicit model for the irregular component that acts as a sort of “safety valve,” accommodating elements that, for whatever reason, did not find a proper fit within the basic systematic components (trend and seasonality). In this way, the plain representation of these two components does not compromise neither the fit of the model to the sample nor its forecasting performance.
The general TBATS model assumes that the linearized time series (z t ) results from the aggregation of three unobserved components: trend (p t ), seasonality (s t ), and a stationary innovation (u t ):
The innovation u t plays an additional role as the stochastic input for the other two components. In this way, both the trend and the seasonality depend on a single shock that, properly scaled and filtered, generates them. In general, we assume that u t evolves according to a stationary and invertible autoregressive and moving average (ARMA) model:
The ultimate shock e
t
is a Gaussian white noise with zero mean and fixed variance
An interesting feature of TBATS is that it can handle complex seasonal patterns, comprising both multiple periodicities (weekly, monthly, and yearly) and fractional periodicities (e.g., 30.4375 days for monthly seasonality or 365.25 for annual seasonality).
This complex seasonal pattern is one of the most important differences between a daily time series and its monthly/quarterly counterpart. In the latter case, the seasonal component is unique and of integer periodicity (twelve months and four quarters, respectively). Of course, this additional complexity requires an additional layer of specific modeling.
Assuming that there are I seasonal components of different periodicity, total seasonality is the sum of all of them:
Each seasonal subcomponent is linked to a basic frequency and with k of its harmonics, according to the following equation:
Being:
m i is the periodicity, in time units, of the seasonal subcomponent (e.g., seven days for the weekly seasonality).
In this way, the seasonality associated with each basic frequency is obtained by adding the signals associated with that basic frequency and its k harmonics:
These individual terms are determined according to a bivariate vector autoregressive (VAR) process that includes s t and an auxiliary factor Q t , a shifted version of s t that helps to complete the structural (trigonometric) model Equation (9), being both properly indexed to i and j:
Equation (9) is a deterministic Fourier expansion centered on the frequency Equation (7), stochastically perturbed by the common innovation of the system, u
t
. This innovation is scaled using the parameters
This representation stands out for its parsimony, since only four parameters are involved: two scale parameters and two initial conditions, regardless of the time scale of the seasonality, which can be very large: greater than 28 and 360 periods in the monthly and annual case, respectively. In this way, for each seasonal subcomponent (e.g., weekly), k first-order VAR representations are defined, as many as harmonics are needed to represent it.
The magnitude of the scale parameters determines the proximity to a deterministic behavior of the seasonal subcomponent. At the limit, if both are zero, the component is completely deterministic.
The monthly seasonal component deserves a special comment. Although most of it can be estimated deterministically, we have added a stochastic term to absorb the possible inadequacies of this representation. Note that in the two-step approach used here, the second step (TBATS) represents the features not corrected in the first step (linearization), thus reducing the risk of over-fitting.
Finally, the trend p t is a random walk, I(1), with a first-order autoregressive, AR(1), drift:
Being:
The next equation defines the drift:
Being:
Equations (10) and (11) provide a parsimonious yet flexible representation for the trend. In this way, depending on
The TBATS procedure sets the model Equations (3) to (11) in state space form, computes its likelihood and maximizes it using the model parameters as instruments. It also determines the proper number of harmonics for the seasonal subcomponents, starting with j = 1. In all the cases, the different combinations are ranked according to the Akaike’s information criterion (AIC) and the one that minimizes AIC is chosen.
TBATS also performs a search for the most adequate ARMA(p,q) model for the innovation, starting with a white noise (p = q = 0). If the innovation fails to be considered as a white noise, a search along p and q is implemented, selecting the combination that minimizes the AIC.
Finally, note that the trend and seasonal subcomponents are part of the state vector, which is estimated by means of the Kalman filter using its concurrent, one-sided version (KF) as well as its smoothed, two-sided version (KFS). The one-sided version provides initial values for the smoothed version, which is the one that TBATS reports.
In addition, the KFS computes the likelihood function that can be numerically maximized in order to have estimates of the parameters of the model Equations (3) to (11). See Kim and Nelson (1999) for a general analysis of the Kalman filter and De Livera et al. (2011) for details of its implementation in TBATS.
4. Measuring the Impact of the CV19 Shock
In this section, we explore the impact of the CV19 shock on the daily sales data using different approaches, in order to gauge its impact from different angles.
Firstly, we explore the impact of the CV19 shock on the estimates of the unobserved components as new data become available. Next, several alternative interventions are used to control for these adverse effects on the estimates. Finally, we explain our choice among them.
We use the R package
4.1. Estimation Effects of the CV19 Shock
This section presents the impact of the CV19 shock on the estimation process of the unobservable components (trend, different seasonal components, and residual) of the daily sales series.
In order to better visualize the results, ten time periods have been selected. Specifically, the first period ends on March 15, 2020, the first day of entry into force of the state of emergency, and advances one month each month until reaching December 15, 2020. This is an attempt to summarize the different phases in the evolution of the CV19 shock, from its beginning to a period of greater stabilization (although, obviously, in December 2020 normality had not been achieved, the critical period of the pandemic had been overcome and the most drastic confinement measures had been relaxed).
The estimation process follows the steps described in the previous sections. A first pre-processing phase, where the main deterministic effects are corrected, followed by a second phase of decomposition of the corrected series of deterministic effects into their non-observable components using the TBATS methodology.
The public (bank) holidays are determined according to the corresponding official calendar. This official calendar includes the national non-working days (applicable for all of the Spanish territory) as well as the regional non-working days (applicable separately for each one of the seventeen Spanish regions and two autonomous cities). This complex calendar varies from year to year and it is represented by a single deterministic variable computed as a weighted average of the regional holidays, being the weights determined by the corresponding share of the regional Gross Value Added (GVA) on the national GVA data, using 2018 as the base year. The national holidays enter with a weight of 1. Only the Christmas day (December, 25) is treated separately as an additional dummy variable due to its idiosyncratic features.
The accumulated experience derived from the analysis of the daily sales data suggested the inclusion in the pre-processing step of some additional deterministic variables aimed at representing patterns linked to the monthly seasonality (especial days of the month: 1st, 15th, and last) and its interaction with the weekly seasonality (through their interaction with the weekend days).
The results of the iterative estimation (coefficients and their t-values) of the deterministic effects in the ten different periods are presented in the Table 1. Specifically the deterministic variables are:
Estimation of Deterministic Effects and Their t-Values.
pub.hol.: public (bank) holidays,
em_wk: interaction of end of the month and weekend,
em: end of the month,
bm_wk: interaction of beginning of the month and weekend,
bm: beginning of the month,
d15_wk: interaction of day 15th of the month and weekend,
d15: day 15th of the month,
em_su: displacement of end of the month to previous Friday and Saturday when that day is Sunday,
em_sa: displacement of end of the month to previous Friday when that day is Saturday,
dec_25: December 25th, Christmas day.
The displacement dummy variables em_su and em_sa require some explanation. When the last day of the month is a Saturday or a Sunday, part of the sales for the corresponding last day of the month is recorded the previous Friday (when Saturday) or the previous Friday and Saturday (when Sunday). Both variables are part of the interactions between the weekly and the monthly seasonal components. This effect is visible using the raw data when zooming the time frame, as can be seen in Figure 3.

End of the month and weekends.
The first graph shows a “normal” week (i.e., without an end of the month day). In August 2019 it is visible a displacement of sales to Friday because the end of this month fell on a Saturday. This displacement did not happen in August 2018, when the end of the month was on a Friday. In the same way, when the end of the month is Sunday, a displacement to the previous Friday and Saturday is also visible.
As can be seen, the estimation of these effects is not particularly altered, nor is their significance. This supports the idea that the arrival of the CV19 strongly slowed down the turnover of the sectors especially exposed, the turnover of the sectors that remained in operation maintained their invoicing and recording patterns as in the previous period, especially at the beginning, middle, and end of the month. Note that the interaction effects are estimated with less precision than the corresponding basic effects, partly due to their comparative lower number of occurrences.
Once the series have been corrected from these deterministic effects, the representation of the non-observable components estimated with the samples up to the different periods can be seen in the following figures.
These graphs reveal that the estimation of the trend component is significantly affected from the first moment of the lockdown. In fact, it seems to show some induced annual seasonality, as well as an increase in its volatility. Obviously, this has its counterpart in the estimation of the annual seasonal component, which is also strongly modified. On the other hand, both weekly and monthly seasonality seem to resist well the presence of shock.
Table 2 presents the estimates of the TBATS parameters across vintages, completing the graphical results just commented.
TBATS Parameters Across 2020 Vintages.
Some comments on this table:
The scale parameter of the trend,
On the opposite side, the scale parameters of the weekly seasonal component reduce their (absolute) estimates, indicating a quasi-deterministic behavior. In addition, the number of harmonics remains constant. This explains the notable stability seen in Figure 5.
In an intermediate position, both the monthly seasonality and, especially, the annual seasonality show an increased sensitivity with respect to the innovation (higher scale parameters) as well as some instabilities regarding the number of harmonics. This explains the changes observed in Figures 6 and 7.
The sharp decrease in the number of harmonics of the annual seasonal component, from 11 (15-Mar vintage) to 6 (15-Apr vintage) and the progressive, albeit incomplete, recovery to 8 (from the 15-Sep vintage onwards), is in broad agreement with the qualitative profile of the CV19 shock.
Across vintages, TBATS always considered the shocks that define the irregular component as white noise (p = q = 0).
Finally, the overall size of the shocks has increased too, as reflected in the higher values of the σ parameter.
In any case, this alteration in the decomposition significantly affects the seasonal and calendar adjusted (SAC) series, which are the most popular and relevant for the monitoring of the short-term conjuncture. Although it is more difficult to visualize due to the strong irregular component of the sales data (see Figure 8 for the representation of the original and SAC series), Figure 9 shows the important changes in the seasonal and calendar adjusted series for the first two time periods considered.

Trend estimates (million EURO).

Weekly seasonality estimates (million EURO). Sample: 01/07/2017 to 31/08/2017.

Monthly seasonality (stochastic) estimates (million EURO). Sample: 01/07/2017 to 31/08/2017.

Annual seasonality estimates across vintages (million EURO).

Original and seasonal and calendar adjusted series (million EURO).

Seasonal and calendar adjusted series (million EURO) in 15/03/2020 and 15/04/2020.
Therefore, the previous graphs recommend setting the focus of the analysis on a component such as the trend, which is less sensitive with respect to irregular elements.
4.2. Real-Time Processing Using the Pre-CV19 Model
As we have seen, the impact of the CV19 shock was noticeable very early. A simple and affordable way to mitigate its impact on the model and the decomposition that induces on the observed data is to keep the model fixed, using the estimated parameters from the pre-CV19 sample to perform the correction from deterministic effects (linearization step) and the decomposition into trend, three seasonal factors and a remainder (TBATS step).
The next graph shows the trend estimates from the different vintages, using the parameters estimated from the pre-CV19 sample for the regression model (step 1) as well as for the TBATS model (step 2). From now on, we will set the focus on the trend component since it is the most sensitive with respect to the shocks (Cuevas et al. 2021) and to enhance the graphical analysis due to the strong irregular component of the sales data (Figure 10).

Trend estimates using the model from pre-CV19 sample (million EURO).
The estimates are remarkably stable, preserving the pre-CV19 estimates and thus providing a homogeneous measure of the strength of the CV19 shock. They are not completely stable due to the workings of the smoothing pass of the Kalman filter that is applied to the same time series but with differing lengths.
This procedure provides a simple and sensible way to avoid the disruptive effects of the CV19 shock on the model and the estimated components. However, is this solution permanent?
Once the lockdown ended, the Spanish economy entered uncharted waters. On the one hand, the strict lockdown finished but the new measures then introduced posed an environment clearly different from the pre-CV19 one, due to the restrictions imposed on mobility, limits on capacity and activity, general health measures, etc.
This “new normal” state of affairs was also inhomogeneous from a regional perspective (e.g., some small islands in the Canary and Balearic archipelagos reached less restrained conditions sooner than the large cities in the Peninsula) as well as from a sectoral perspective (e.g., the constraints were stricter for activities linked to social consumption than for the industry and construction activities). This lack of homogeneity poses new difficulties from a modeling perspective. On the one hand, we knew that “new normal” was far different from “normal” but, on the other hand, it was also clear that it was far less strict than the lockdown phase.
4.3. Setting a Flexible Intervention Variable
A more correct and sophisticated solution is to introduce a specific regression variable to represent the shock of CV19 in its deepest phase, which allows a correct decomposition of seasonal factors. Subsequently, this regression variable would be assigned to the trend component.
Obviously, the most correct specification of this variable can only be made when the duration of the shock is known a posteriori.
In this case, the form of the regression variable chosen was as the “tent” type, with the functional form expressed in Equation (12) and represented as an example in Figure 11.
For its full determination, a search algorithm of the parameters is proposed. A succession of regressions of the series corrected from deterministic effects on the intervention variable is run, including a deterministic trend and the seasonal Fourier variables determined by the harmonics of the first stage. In these regressions

Type of “tent” intervention variable for CV19.

Minimum AIC.
The estimation with the sample up to December 15, 2020, including the CV19 variable is summarized in Table 3.
Estimation of Deterministic Effects, CV19, and Their t-Values.
In addition, the search exercise has been carried out with a succession of regressions of the original series on the intervention variable, the deterministic effects, a deterministic trend, and the seasonal Fourier variables determined by the harmonics of the first stage. The results are quite similar, with the minimum reached at
Obviously, the coefficient of the CV19 variable is highly significant. Compared to not introducing it, the changes are very clear in the following figures, showing a great improvement (Figure 13).

Trend estimates, pre-CV19 and full sample, with and without CV19 “tent” intervention variable.
As can be seen, the estimation of the trend recovers the stability that is assumed, while the annual seasonal component is more similar to that of the pre-CV19 period, without marking those falls in April-May that were transmitted to the trend component. However, this recovery is not complete as can be seen in the reduced amplitude of the mid-Summer and turn-of-the-year peaks, although the underlying time profile is kept.
Additionally, this difference is very evident when comparing the fixed-model estimates with the estimates derived from a free-model plus CV19 intervention. Figure 14 shows this difference.

Annual seasonality estimates, pre-CV19 and full sample, with and without CV19 “tent” intervention variable.
The fixed-model estimates provide a very good directional image of the underlying economic conditions but with a certain delay and a remarkable underestimation. Both estimates are very close to the pre-CV19 estimates, suggesting that the underlying dynamics remain the same, once one-off shocks like the CV19 one are taken into account.
Of course, the free model plus CV19 intervention can only be implemented once we have a sufficient sample, that is, only with the benefit of hindsight. On a real-time basis, we have to rely on biased but stable estimates as those provided by the model estimated with the pre-CV19 sample (Figure 15).

Trend estimates using the pre-CV19 model versus full sample model plus CV19 intervention.
4.4. Alternative Intervention: Piecewise Step Intervention
As we have seen, the nature of the CV19 shock allows us to define two intervention (dummy) variables since its onset. The first one (lockdown) is set to one during the most stringent phase (from March 15th to May 26th) and the second one (new normal) is set to one once the lockdown ended (from May 27th onwards). The beginning and the end of the lockdown phase were determined by the Spanish Government declaring an emergency state.
As can be seen in the next graph, the real-time coefficient estimates of the lockdown effect are sizeable and very stable since the very beginning, in close agreement with its exceptional, sharp, and strong impulse. On the contrary, the new-normal intervention is less stable, suggesting an upward movement consistent with the progressive recovery of the sales data. Note that this recovery is clearly incomplete due to the prevalence of its negative sign and its distance from zero at the end of 2020 (Figure 16).

Real-time coefficient estimates of the lockdown and new-normal interventions.
The estimates of the remaining deterministic effects are fairly robust with respect to the lockdown and new-normal interventions, as can be seen in the Table 4.
Estimation of Deterministic Effects, Lockdown, New-Norm, and Their t-Values.
The combined effect of both interventions is a piecewise factor very strong during two months (lockdown) and milder during the new-normal phase but still negative. However, this combined effect provides and incomplete picture of the full sample estimation using the CV19 intervention, as can be seen in Figure 17.

Trend estimates: piecewise versus CV19 “tent” intervention variables.
The estimates provide a more accurate gauge of the impact of the CV19 shock during its strongest phase (lockdown) but overstates its persistence, underestimating the strength of the recovery. In any case, it provides a benchmark to qualify the estimates provided by the model fixed at its pre-CV19 estimates.
4.5. Alternative Intervention: Lockdown Plus “Tent” Intervention
An alternative that could be feasible is to propose an intervention variable that is the combination of a lockdown period plus a progressive recovery “tent” type variable. The results of its estimation and the derived trend are shown in Table 5 and Figure 18.
Estimation of Deterministic Effects, Lockdown + Tent Intervention, and Their t-Values.

Trend estimates: CV19 “lockdown + tent” versus CV19 “tent” intervention variables.
The results of the estimate remain stable and the combined variable is fully significant. However, comparing it with the “tent” intervention variable, is slightly less significant, while it could seem that it results in a less continuous profile. For this reason, we finally prefer to stay with the “tent” variable type as the best option. However, as can be seen in the Appendix A, the residual diagnostics of the different specifications favor slightly the “Lockdown + tent” CV19 intervention.
5. Conclusions
From a practitioner’s view, the CV19 shock greatly affects the model and the corresponding decomposition of the observed daily sales data. We present here some conclusions derived from our experience when dealing with the CV19 shock during the last two years.
The pre-processing (or linearization) step is very important. The correction from deterministic effects linked to the interaction between seasonal components (weekly and monthly) as well as to the special nature of the monthly seasonality, plays a critical role in ensuring a homogeneous and properly structured input for the decomposition performed in the second step. Fortunately, the estimates of these deterministic effects, including bank holidays, are very stable, significant and robust with respect to outliers, including those related to the CV19 shock.
The CV19 shock has a major impact on the decomposition of the corrected daily time series, destabilizing the trend and the annual seasonality and generating a wrong attribution of the CV19 shock to the annual seasonality. Weekly and monthly seasonality remains practically unaffected by the CV19 shocks.
Shocks like CV19 pose an extraordinary challenge for short-term monitoring on a real-time basis. Their destabilizing effects are quickly detected and a simple, preemptive measure is to keep the estimated pre-shock model fixed while processing the incoming, shocked observations. While this procedure is somewhat biased, it preserves very well the overall direction of the changes and gives a clear picture of the relative cross-sectional effects of the CV19 shock (e.g., the comparison between industrial and services activities). Obviously, this solution is temporary because we cannot keep fixed the model forever.
The above procedure can be improved by means of an intervention analysis. In this way, the initial lockdown was modeled by means of a level shift. This approach produces an updated estimate of the effects but it is more prone to revisions.
The CV19 shock has been largely unusual due to its huge size and its sharp effects but it can be clearly linked to exogenous events with known and public dates of occurrence, like the starting and ending dates of lockdowns and other constraints on mobility and capacity. The exogenous and quasi-deterministic nature of the CV19 shock makes it amenable for a classical intervention analysis (Box and Tiao 1975). In this way, two years after its initial impact, we can represent most of it by means of a single, two-sided transitory change intervention (a “tent” type variable). We have presented here some additional tests aimed at qualifying this approach.
The accumulation of empirical experience, theoretical developments, and specific computational tools will surely improve modeling daily economic time series. For future work, we plan to compare TBATS with non-parametric filtering methods, as in Ollech (2021) and to explore procedures for the automatic detection and removal of outliers designed for the special features of daily economic time series.
Footnotes
Appendix A
Acknowledgements
We thank J. Abelaira, R. Frutos, D. García, and R. Ledo for their input at different stages of this project. We also thank the anonymous referees for their comments and suggestions that have contributed to improve notably the text. The opinions are those of the authors and do not necessarily reflect the views of the Spanish Tax Agency.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
