Skip to Content
EconometricsEconometrics
  • Article
  • Open Access

3 December 2026

26 Pages

Global Models and Neural Networks for Forecasting Tax Revenue in the Cantons of Ecuador

and
1
Department of Economic, Administrative and Commerce Sciences, Universidad de las Fuerzas Armadas ESPE, Sangolqui 171103, Ecuador
2
Department of Energy and Mechanical Sciences, Universidad de las Fuerzas Armadas ESPE, Sangolqui 171103, Ecuador
*
Author to whom correspondence should be addressed.

Abstract

Knowing how much tax will be collected each month in each canton supports budget planning, intergovernmental transfers and the targets of the tax administration. These forecasts are usually produced with a separate statistical model for each canton, which in small cantons must be estimated from short and highly volatile series. This study compares that practice with an alternative: a single model trained on all the cantons of Ecuador simultaneously, in three versions, namely, a linear regression and two neural networks. The data are the open records of Ecuador’s Internal Revenue Service on tax collection, declared sales and active taxpayers. The study has five stages: building the database and two representations of each canton’s history; comparing the models in a rolling out-of-sample design in which each month is forecast using only earlier data; tuning the network configuration with a bio-inspired evolutionary algorithm and comparing it with random search; weighting the cantons by size; and explaining which variables drive each forecast. All computations were carried out in Python. When each canton’s history was expressed relative to its own level, the single global model outperformed the per-canton model for total revenue, value-added tax and income tax, with statistically significant differences; the advantage held for cantons of all sizes, except for value-added tax in the largest cantons, where the errors were practically equal. Per-canton models given the same predictors did not reproduce this advantage, which points to pooling the cantons as its source, and the advantage held when the information was lagged two months to reflect publication delays. The neural networks alone did not outperform the linear regression; averaging them with it reduced the error significantly for total revenue and income tax after adjustment across the three taxes. Weighting the cantons by size traded canton-level accuracy for accuracy of the national total, and no weight was best for all taxes. The result is a reproducible tool, available as a web calculator, for anticipating revenue and evaluating scenarios such as an amnesty on interest and penalties.

1. Introduction

Taxes finance most of the public budget. Ministries of finance therefore need to know how much revenue will be collected in order to set expenditure, the targets of the tax administration and the transfers to local governments (Buettner & Kauder, 2010; Leal et al., 2008). When forecasts fail, unplanned spending cuts or deficits that require additional borrowing follow, which is why fiscal institutions closely monitor the accuracy of their projections (Mikesell, 2018).
This study addresses revenue forecasting at the territorial level, that is, for each locality of the country. The regional offices of the tax administration need to anticipate, month by month, the revenue collected in their area, and local governments need to anticipate their own revenue. The revenue studied here is the first kind: national taxes collected by the central tax administration and recorded in each canton according to the taxpayer’s domicile. It is not the own-source revenue of the municipalities, and the transfers that municipalities receive are set by law as a share of central government revenue, not by the revenue collected in their canton. Studies on local governments show that these forecasts are typically produced with simple methods, such as expert judgement or the extrapolation of past trends (Cirincione et al., 1999; Reddick, 2004; Williams & Kavanagh, 2016).
Local tax revenue has three features. First, it rises and falls in the same months every year because it follows the filing calendar. Second, it shifts abruptly with tax reforms and with tax amnesties, which waive interest and penalties for taxpayers who settle their debts within a given period. Third, localities differ greatly in size. In Ecuador, the Internal Revenue Service (Servicio de Rentas Internas, SRI) publishes the monthly revenue collected in each canton: some cities contribute hundreds of millions of dollars per month, while other cantons collect a few tens of thousands. Previous work by the first author shows that these disparities between cantons persist over time (Gómez Medina et al., 2026; Urbina Poveda et al., 2026), and other studies show that amnesties change the revenue collected in the months in which they are in force (Espinosa-Jaramillo et al., 2024; Otavalo Cacuango, 2022).
Forecasting the revenue of a canton therefore requires separating three components: the pattern that repeats every year, the changes caused by reforms or amnesties, and the noise inherent to small series. Moreover, this must be done with few observations per canton, although with many cantons that behave in a similar way.
Getting it right matters because every forecast error is money that is missing from, or left over in, the budget. In this study the error is measured in three ways: the relative error of each canton in each month; the error relative to that of repeating the value of the same month of the previous year (Hyndman & Koehler, 2006); and the error of the national total, obtained by summing the forecasts of all cantons, which is the figure of interest to the central government.
There are several ways to forecast. The simplest repeats the value of the same month of the previous year; it is known as the seasonal naïve forecast and serves as a minimum benchmark. Seasonal ARIMA (SARIMA) models are the classical statistical method for monthly series: they learn the trend and the annual pattern from the series itself, and today they are selected automatically (Hyndman & Khandakar, 2008). A hybrid of statistical models and neural networks won M4, the fourth edition of the international forecasting competitions organised by Spyros Makridakis (Makridakis et al., 2020; Smyl, 2020). Long short-term memory (LSTM) networks are recurrent neural networks that read the data in order and retain relevant information from many months back (Hewamalage et al., 2021; Hochreiter & Schmidhuber, 1997). Other models, such as DeepAR, learn from many series at the same time (Salinas et al., 2020). In tax revenue, classical models have been compared with neural networks and decision trees in Cambodia, where ARIMA achieved the lowest errors in most cases (Chhim & Lim, 2026); in Rwanda, where a neural network was compared with a VAR model (Uwizeye, 2025); and for corporate income tax payments in the United States, with neural networks and random forests (Swenson, 2024).
These methods can be divided into two groups (Januschowski et al., 2020). Local models estimate a separate model for each series. Global models estimate a single model for all series at once. Montero-Manso and Hyndman showed that a global model can be as accurate as local ones, with far fewer parameters per series and that its advantage grows with the number of series (Montero-Manso & Hyndman, 2021).
The recent literature points in the same direction. The M4 and M5 editions of those competitions rewarded methods that learn from many series simultaneously (Makridakis et al., 2020, 2022); clustering similar series improves neural networks (Bandara et al., 2020); and averaging the forecasts of several models, an idea more than fifty years old, remains one of the most reliable ways to reduce error (Bates & Granger, 1969; Wang et al., 2023).
The underlying problem is that studies of tax revenue still treat each series separately: that of the country, a region or a single tax (Chhim & Lim, 2026; Swenson, 2024; Uwizeye, 2025). With a single monthly series of about one hundred observations, a neural network has little to learn from, and classical models tend to perform better. The revenue of hundreds of cantons, by contrast, provides thousands of observations with similar patterns, and how much global models gain from them has not yet been measured.
There are three ways to exploit many series: training a global model on all of them (Hewamalage et al., 2021; Montero-Manso & Hyndman, 2021); averaging the forecasts of several models (Wang et al., 2023); and searching for the best network configuration with search algorithms, including those inspired by biological evolution (Das & Suganthan, 2011; Young et al., 2015), such as differential evolution (Storn & Price, 1997).
Each approach has a cost. A global model gives the same weight to every series during training and may neglect the few large series that determine the total. The way the series are prepared before training changes what the network can learn (Hewamalage et al., 2021). Finally, searching for the best network configuration requires many training runs, which are only worthwhile if the forecast improves on unseen data.
Comparing errors is not enough to establish that one model is better than another, since the difference may be due to chance. Forecasting econometrics uses the Diebold–Mariano test for this purpose, which compares the errors of two models over the same months (Diebold & Mariano, 1995), with the small-sample correction of Harvey, Leybourne and Newbold (Harvey et al., 1997).
Other tools serve related purposes. The model confidence set identifies the models that cannot be distinguished from the best one (Hansen et al., 2011), and the Wilcoxon signed-rank test compares paired replications without assuming normality (Wilcoxon, 1945). To understand what a model does, SHAP values decompose each forecast into the contributions of the input variables (Lundberg & Lee, 2017).
Overall, the reviewed literature leaves three gaps. First, studies of tax revenue with neural networks work with a single series and do not exploit the fact that territorial revenue forms a panel, that is, many series observed over the same months (Chhim & Lim, 2026; Swenson, 2024; Uwizeye, 2025). Second, the reviewed comparisons do not include a global linear model with the same information as the network; without it, it is not possible to tell whether the improvement comes from pooling the series or from using a neural network.
Third, the effect of tax amnesties has been studied with national aggregates (Alm et al., 1990; Espinosa-Jaramillo et al., 2024; Otavalo Cacuango, 2022) but not within a model that forecasts each canton and measures how much the amnesty contributes to the expected revenue. Nor has it been studied what happens to the forecast of the national total when a global model learns from cantons of such different sizes.
This study builds a database with the monthly revenue of the 221 cantons of Ecuador, their declared sales, their active taxpayers and national economic activity. It then compares local and global models: each month is forecast using only earlier data, as if the forecaster were at that point in time, and the differences are evaluated with the Diebold–Mariano test. The contributions are four: (C1) a comparison between a per-canton SARIMA and three global models (linear, multilayer perceptron (MLP) and LSTM) for three taxes, showing that the representation of each canton’s history determines which model performs best; (C2) the separation of the gain from pooling the series and the gain from using neural networks, by means of a global linear model, per-canton models that receive the same information as the global models, and forecast averaging; (C3) a replicated comparison between differential evolution and random search for selecting the network configuration, with the same number of evaluations; and (C4) an analysis of the trade-off between canton-level and national accuracy when large cantons receive more weight, together with a SHAP-based explanation of the forecasts and a paired scenario that describe how the forecast responds to tax amnesties.
The final model was implemented as a bilingual (Spanish and English) web calculator that forecasts next month’s revenue for any canton and also accepts user-supplied data, so that it can be used outside academia.
The paper is organised as follows. Section 2 reviews the literature. Section 3 presents the methodology: the problem and the models with their equations. Section 4 describes how the research was conducted. Section 5 presents the setup and the results, and Section 6 discusses the findings and concludes.

2. Literature Review

Univariate statistical models, in particular, SARIMA with automatic order selection (Hyndman & Khandakar, 2008), are the standard benchmark for forecasting monthly public revenue (Buettner & Kauder, 2010; Leal et al., 2008). They matter because they capture the annual pattern of the tax calendar with few parameters and are easy to interpret. They are studied as a benchmark because any new method must outperform them on unseen data, and on short series, they often beat machine learning methods (Chhim & Lim, 2026). Their weakness appears when there are many short and noisy series: each one is estimated from its own data and does not exploit what it shares with the others.
Neural networks for tax revenue have mostly been tested on a single series. In Rwanda, a neural network was compared with a VAR model (Uwizeye, 2025); for corporate income tax payments in the United States, neural networks and random forests produced stable forecasts, even during the pandemic (Swenson, 2024); and in Cambodia, ARIMA had a lower error than neural networks and decision trees in most tests (Chhim & Lim, 2026). These studies matter because they show that the advantage of a network depends on how much data it can learn from, and they leave open what happens when many series are available.
Global models share their parameters across all series and are trained on all of them simultaneously (Januschowski et al., 2020; Montero-Manso & Hyndman, 2021). They are attractive for territorial revenue because the cantons share the tax calendar and the same reforms, so that a small canton can benefit from what is learned in the large ones. Training them requires expressing each series relative to its own level, and the way this is done affects the result (Bandara et al., 2020; Hewamalage et al., 2021). They are a sound basis for research because they won the recent competitions (Makridakis et al., 2020, 2022), but they have not been tested on local tax revenue.
Two further lines of work bear on pooling. Simulation studies show that global models gain most when the series share patterns and that they remain competitive on heterogeneous series when the model is flexible enough (Hewamalage et al., 2022). In panel econometrics, units exposed to common shocks, such as national reforms, the business cycle or commodity prices, display cross-sectional dependence, which can be measured with the CD statistic (Pesaran, 2015, 2021). For forecasting, this dependence has two consequences: it is part of the shared information that a global model exploits, and it makes the forecast errors of different units correlated, so that a test that treats the units as independent overstates the evidence.
Averaging the forecasts of several models reduces error, and its usefulness has been documented for more than fifty years (Bates & Granger, 1969; Wang et al., 2023). It is relevant here because a linear model and a network may err in different ways; their average can outperform both even if the network alone does not outperform the linear model.
The configuration of a network (the number of layers and neurons and the learning rate) can be searched with evolutionary algorithms (Young et al., 2015). Differential evolution mimics natural selection: it evaluates a population of configurations, creates new ones by combining existing ones and keeps those that perform best (Das & Suganthan, 2011; Storn & Price, 1997). It is studied because the configuration affects the network’s performance, and it is expected to find better configurations than random search with the same number of evaluations. Comparing the two is necessary to determine whether the additional effort is worthwhile.
Finally, SHAP values explain each forecast by distributing it among the input variables, using a rule from cooperative game theory (Lundberg & Lee, 2017), and studies of tax amnesties analyse how these programmes change tax payments (Alm et al., 1990; Espinosa-Jaramillo et al., 2024; Otavalo Cacuango, 2022). Amnesties raise revenue in the months in which they are open, but their net effect is debated: the additional revenue is often small, and repeated programmes may lead taxpayers to expect new ones and weaken compliance (Alm et al., 2009; Baer & Le Borgne, 2008; Leonard & Zeckhauser, 1987); the response to an amnesty also depends on institutional factors such as political participation (Torgler & Schaltegger, 2005). Combining both makes it possible to measure how much an amnesty contributes to the revenue expected by the model. This study brings these lines together in a single design applied to the 221 cantons of Ecuador.

3. Methodology

  • Data.
Let y i , t ≥ 0 denote the revenue, in US dollars, of canton i ∈ { 1 , … , N } in month t ∈ { 1 , … , T } , with N = 221 . To make large and small cantons comparable, the logarithm is used:
Y i , t = log 1 + y i , t , z i , t = Y i , t − Y i , t − 12 .
The variable z i , t is the change with respect to the same month of the previous year; a value of 0.10 corresponds approximately to a 10% increase.
  • Two representations of the history.
The first representation gives the model the year-on-year changes of the previous twelve months, ( z i , t − 1 , … , z i , t − 12 ) . The second gives the previous 24 months measured relative to the mean of the last year:
m i , t = 1 12 ∑ k = 1 12 Y i , t − k , n i , t , k = Y i , t − k − m i , t ( k = 1 , … , 24 ) , τ i , t = Y i , t − m i , t .
All cantons are thus placed on the same scale: the model learns the shape of the series rather than its size. The model forecasts τ i , t , and the forecast is recovered by adding back the mean, Y ^ i , t = m i , t + τ ^ i , t .
  • Other variables.
In addition to the history, the model receives the year-on-year change, lagged one month, of the canton’s declared sales, of active companies and active individual taxpayers, of national non-oil business activity and of the oil price. It also receives an indicator equal to 1 if a tax amnesty is in force in that month, another for the months of the COVID-19 lockdown, the size of the canton (the mean of its log revenue up to the previous month) and eleven month-of-year indicators. With the second representation, the vector x i , t has 43 components.
  • Global model and loss function.
A global model is a single function f θ with the same parameters for all cantons. Its parameters are chosen to minimise the expected loss:
R ( θ ) = ∫ ρ δ τ − f θ ( x ) d P ( x , τ ) ≈ ∑ i = 1 N ∑ t ∈ T i w i ρ δ τ i , t − f θ ( x i , t ) ∑ i = 1 N ∑ t ∈ T i w i ,
where the integral is the population risk and the sum is its empirical counterpart; T i is the set of training months of canton i, w i is its weight and ρ δ is the Huber loss (Huber, 1964),
ρ δ ( e ) = 1 2 e 2 , | e | ≤ δ , δ | e | − 1 2 δ , | e | > δ .
This loss grows quadratically for small errors and only linearly for large ones, so that an extreme jump in a small canton does not dominate the training.
  • Canton weights.
The weight depends on the mean revenue of the canton, s i , raised to an exponent α :
w i = s i α 1 N ∑ j = 1 N s j α , s i = 1 | T i | ∑ t ∈ T i y i , t .
With α = 0 , all cantons have the same weight; with α = 1 , each canton is weighted by its revenue; α = 0.5 is an intermediate case. The exponent is a tuning parameter. To avoid choosing it with the test data, five values, α ∈ { 0 , 0.25 , 0.5 , 0.75 , 1 } , were evaluated in a validation period that precedes the test, and the value with the lowest error of the national total in that period was selected before the test was examined; the test results for all five values are reported as a sensitivity analysis.
  • The three global models.
The linear model is f θ ( x ) = β 0 + ∑ j = 1 43 β j x j . The multilayer perceptron (MLP) is a feed-forward network in which each layer combines the outputs of the previous one through a rectified linear activation, h ( l ) = max 0 , W ( l ) h ( l − 1 ) + b ( l ) , starting from h ( 0 ) = x . The LSTM network (Hochreiter & Schmidhuber, 1997) reads the 24 months in order; at each month k, it decides what to forget and what to store in a memory cell c k :
c k = f k ⊙ c k − 1 + i k ⊙ tanh W c n k + U c h k − 1 + b c , h k = o k ⊙ tanh ( c k ) ,
where f k , i k and o k are gates with values between 0 and 1 that control how much is forgotten, stored and output. At the end of the sequence, h 24 is concatenated with the remaining variables to produce the forecast.
  • Per-canton benchmark.
For each canton, a SARIMA ( 1 , 1 , 1 ) ( 0 , 1 , 1 ) 12 model is estimated:
( 1 − ϕ i B ) ( 1 − B ) ( 1 − B 12 ) Y i , t = ( 1 + ϑ i B ) ( 1 + Θ i B 12 ) ε i , t ,
where B is the backshift operator. In words, the model explains the change of each month from the change of the previous month and from the recent and previous-year errors, with parameters specific to each canton. The seasonal naïve forecast is Y ^ i , t = Y i , t − 12 .
This specification extends the airline model of Box and Jenkins, ( 0 , 1 , 1 ) ( 0 , 1 , 1 ) 12 , with one autoregressive term (Box et al., 2015). It was fixed in advance for every canton for three reasons: the regular and seasonal differences remove the trend and the annual pattern of the tax calendar; it estimates only three parameters per canton, which matters because each canton has between 89 and 101 monthly observations before each forecast origin; and a common specification avoids selecting the model with the test data. Its parameters are re-estimated by maximum likelihood at each forecast origin, at the start of each twelve-month test block, and within the block the one-step forecasts are updated with the observed revenue without re-estimating the parameters; the global models follow the same schedule. Because a fixed specification may favour the global models, three additional per-canton benchmarks were estimated. The first is a SARIMA whose orders are selected for each canton and each forecast origin by the Akaike information criterion, with p , q ∈ { 0 , 1 , 2 } , P , Q ∈ { 0 , 1 } and d = D = 1 . The second is a regression with SARIMA errors (SARIMAX) that receives the same explanatory information as the global models:
Y i , t = q i , t ⊤ β i + u i , t , ( 1 − ϕ i B ) ( 1 − B ) ( 1 − B 12 ) u i , t = ( 1 + ϑ i B ) ( 1 + Θ i B 12 ) ε i , t ,
where q i , t contains the logarithms of the canton’s declared sales, active companies and active individuals, of the non-oil activity index and of the oil price, all lagged one month, together with the amnesty and lockdown indicators. The third is a ridge regression estimated separately for each canton with exactly the 43 inputs of the global models, with the penalty selected by leave-one-out cross-validation. The last two benchmarks use the same information as the global models but do not pool the cantons; comparing them with the global models separates the gain from pooling from the gain from the additional explanatory variables.
  • Forecast combination.
The combined forecast is the simple average of the models in a set M : Y ^ i , t c = 1 | M | ∑ m ∈ M Y ^ i , t ( m ) (Bates & Granger, 1969; Wang et al., 2023).
  • Error measures.
With H test months, N cantons and the error e i , h = Y i , h − Y ^ i , h ,
RMSE = 1 N H ∑ i = 1 N ∑ h = 1 H e i , h 2 , MASE i = 1 H ∑ h = 1 H | e i , h | 1 | T i | ∑ t ∈ T i | z i , t | , MAPE nat = 100 H ∑ h = 1 H ∑ i y i , h − ∑ i y ^ i , h ∑ i y i , h .
The RMSE is the typical error of a canton in a month; since it is computed on logarithms, it can be read approximately as a relative error. The MASE compares the canton’s error with that of repeating the same month of the previous year (Hyndman & Koehler, 2006): a value below 1 means that the model outperforms that simple rule. The national MAPE is the percentage error of the national total, obtained by summing the canton forecasts with y ^ i , h = exp ( Y ^ i , h ) − 1 .
  • Diebold–Mariano test.
To determine whether the difference between models A and B is genuine or may be due to chance, the difference between their mean squared errors across cantons is computed for each month, d h = 1 N ∑ i = 1 N e i , h A 2 − 1 N ∑ i = 1 N e i , h B 2 , together with the statistic (Diebold & Mariano, 1995; Harvey et al., 1997)
DM = H − 1 H d ¯ σ ^ LR 2 / H , σ ^ LR 2 = γ ^ 0 + 2 ∑ k = 1 L 1 − k L + 1 γ ^ k , γ ^ k = 1 H ∑ h = k + 1 H d h − d ¯ d h − k − d ¯ ,
where d ¯ is the mean of the d h and the factor ( H − 1 ) / H is the Harvey–Leybourne–Newbold small-sample correction for one-step-ahead forecasts. The long-run variance σ ^ LR 2 is the Newey–West estimator with Bartlett weights (Newey & West, 1987), which allows the monthly loss differentials to be autocorrelated; with H = 24 , the usual rule L = ⌊ 4 ( H / 100 ) 2 / 9 ⌋ gives L = 2 . With L = 0 , the statistic reduces to the one used in the first version of this study, which is also reported. The statistic is compared with a Student’s t distribution with H − 1 degrees of freedom. A positive value indicates that B has a lower error than A, and the p-value is the probability of observing a difference at least as large if both models were equally accurate; values below 0.05 are considered significant. For the national total, the same test is used, with d h equal to the difference between the squared percentage errors of the national total in month h.
Three further checks address the small number of test months. First, the autocorrelation of each series d h is examined with the Ljung–Box test up to lag 6 (Ljung & Box, 1978). Second, because the t approximation may be poor with H = 24 , the p-value and a 95% confidence interval for the mean loss differential d ¯ are also obtained with a moving-block bootstrap (Künsch, 1989): blocks of three consecutive months are resampled with replacement 19,999 times, which preserves the short-run dependence of the series. Third, the p-values are adjusted for multiple testing with the Holm procedure (Holm, 1979). Each research question, that is, each comparison between two models evaluated on the three taxes, is one family of three hypotheses, as in the first version of this study; as a more conservative check, the adjustment is also applied across all the comparisons and taxes of each table, and both adjusted values are reported. Since d h averages the losses of the 221 cantons in month h, any correlation between the errors of different cantons in the same month is already contained in d h ; the effective sample size of the test is therefore the number of months, not the number of forecasts (Diebold, 2015). The cross-sectional dependence of the errors is reported with the CD statistic of Pesaran (Pesaran, 2015, 2021).
  • Differential evolution.
Each network configuration is encoded as a vector u ∈ [ 0 , 1 ] 5 with five components: number of layers, number of neurons, dropout rate (the fraction of neurons randomly deactivated during training to prevent memorisation), learning rate and weight decay. The DE/rand/1/bin variant (Storn & Price, 1997) creates, for each configuration u p in the population, a mutant vector and a trial vector:
v p = u a + F u b − u c , u p , j ′ = v p , j , r j < C R or j = j rand , u p , j , otherwise ,
where a , b , c are three other distinct members of the population, r j is a uniform random number in [ 0 , 1 ] and j rand is a randomly chosen component that is always taken from the mutant, so that the trial vector never equals the original configuration. The trial vector replaces the original configuration if its error is not larger.
  • SHAP values.
The contribution of variable j to a forecast is measured with the Shapley value (Lundberg & Lee, 2017):
φ j = ∑ S ⊆ F ∖ { j } | S | ! | F | − | S | − 1 ! | F | ! f S ∪ { j } ( x ) − f S ( x ) ,
where F is the set of variables and f S is the expected forecast when only the variables in S are known. In words, it is the average change in the forecast when that variable is added to the others. The contributions of all variables, added to the base value E [ f ( X ) ] , which is the mean forecast of the model, reproduce the forecast: f ( x ) = E [ f ( X ) ] + ∑ j ∈ F φ j .

4. Research Design

The idea can be illustrated with an everyday example. A physician who has treated a single patient for years knows that patient’s history very well but has little to compare against when an unusual symptom appears. A physician who has seen hundreds of patients recognises recurring patterns more quickly. The per-canton SARIMA is like the first physician: it learns only from the history of its own canton. The global model is like the second: it learns from all 221 cantons at once. For the second physician to compare cases, all patients must be presented in the same way; this is why each canton’s history is expressed relative to its own level, regardless of whether it collects one hundred thousand or one hundred million dollars per month.
Figure 1 shows the two representations of the history of the same canton. In the first, the model sees only how much each month changed with respect to the previous year. In the second, it sees the complete shape of the last two years, measured relative to the mean of the last year.
Figure 1. Two representations of a canton’s history (Latacunga, total revenue) used to forecast one month, shown in orange (orange bar in (panel a) and orange dot in (panel b)). (a) Change of each month with respect to the same month of the previous year: the input of the first representation. (b) The previous 24 months in logarithms, measured relative to the mean of the last 12 months (grey area): the input of the second representation.
The complete workflow is summarised in Figure 2. The open data are arranged into a canton–month database; the two input representations are built from it; the models are estimated and each month is forecast using only earlier data; and their errors are compared with the Diebold–Mariano test and explained with SHAP values.
Figure 2. Study workflow, in the order in which it was carried out. Grey: data, test and results; blue: the elements proposed and compared.
  • Data.
The monthly revenue of each canton and each tax group was taken from the SRI open data files, one per year, from January 2017 to September 2026. The files change their field separator and text encoding from year to year, and the code detects both automatically. In these files, the province field does not always correspond to the canton; each canton was assigned to the province in which most of its revenue is recorded, which affects 0.26% of the amount collected. The names were checked against the official list of provinces, cantons and parishes, and all 221 cantons match. The annual totals match the official SRI figures. This revenue corresponds to national taxes recorded in the canton according to the taxpayer’s domicile; it is not the own-source revenue of the municipalities. Table 1 summarises the sources.
Table 1. Sources and variables. All explanatory variables enter with a one-month lag (two months in the sensitivity analysis of Section 5.4), except the amnesty, lockdown and month-of-year indicators, which are treated as known at the time of forecasting.
  • Real-time availability.
The forecasts are intended for the tax administration. For that user, the revenue collected up to month t − 1 is known at the start of month t, because payments are recorded by the banking system as they occur. The declared sales of month t − 1 , by contrast, come from the monthly VAT returns (form 104), which are filed between the 10th and the 28th day of month t, on a date that depends on the ninth digit of the taxpayer’s identification number (Presidencia de la República del Ecuador, 2010); they are complete only at the end of month t. The non-oil activity index is computed by the SRI from the same returns and has at least the same delay. The assumption that all the variables of month t − 1 are available is therefore optimistic for the explanatory variables, and Section 5.4 repeats the evaluation with the explanatory variables lagged two months, and with all information, including revenue, lagged two months. The active-taxpayer series has no values for November 2024 and December 2025. In the first version of this study, these two months were interpolated linearly between the neighbouring months, which uses the value of the following month; in this version, they are filled with the last published value, so that the imputed values use no information from later months, and all the results were recomputed. A separate issue is data revision: the SRI open data files are re-published and may incorporate amended returns; earlier vintages are not archived, so the exercise uses the latest vintage, as is common when real-time vintages are not available (Croushore, 2011).
  • Benchmark models.
The seasonal naïve forecast, which repeats the value of the same month of the previous year, and the per-canton SARIMA (Equation (7)) were estimated with the statsmodels library (Seabold & Perktold, 2010), as were the SARIMA with orders selected by the Akaike criterion and the SARIMAX of Equation (8); the per-canton ridge regression used scikit-learn (Pedregosa et al., 2012). When a SARIMAX or a SARIMA with selected orders did not converge, the fixed SARIMA forecast was used for that canton and origin, and the number of such cases is reported. Each canton was computed in a separate process, with a single computation thread per process, in order to distribute the 221 cantons across the sixteen processor threads without oversubscription.
  • Global models.
The linear model was estimated with the Huber regressor of the scikit-learn library (Pedregosa et al., 2012) for the normalised window, and with ridge regression, whose penalty was selected by cross-validation, for the year-on-year representation. The MLP and the LSTM were implemented in PyTorch (Paszke et al., 2019) and trained with the Adam optimiser (Kingma & Ba, 2014). Training was stopped when the error ceased to decrease on the last 15% of the training data, in chronological order. Each network was trained five times from different random initialisations (seeds), and its forecast is the average of the five. Because the main specification uses different estimators for the two representations, the two representations were also compared holding the estimator fixed: both with the Huber loss (Huber regression for the linear model and Huber loss for the networks) and both with the squared loss (ridge regression and squared loss for the networks).
  • Configuration search.
Differential evolution and random search explored the same configuration space with the same number of evaluations: sixty training runs per search, replicated with ten seeds per method (five in the first version of this study). The error was measured on the twelve months preceding the test period, which was not used in the search. Table 2 lists all the values used.
Table 2. Model and evaluation settings.

Use of Generative Artificial Intelligence

During the preparation of the study and the manuscript, the authors used Claude Opus 5.5 (Anthropic), a generative artificial intelligence tool, as editorial support to improve the clarity, coherence and consistency of the text and to translate it into English and to detect possible omissions in the description of the experiments. This tool did not generate or modify the data, which are the open records of the SRI and FRED; every value and figure reported was computed by the study’s scripts from the data and from the stored experimental outputs. All results were verified by the authors against the original data, logs and scripts of the study. The authors have reviewed and edited the output and take full responsibility for the content of this publication.

5. Experiments and Results

5.1. Setup

The database covers 221 cantons and 117 months. Since the models require two years of history, the usable data run from January 2019 to May 2026, the last month for which the activity index was published. The test used the last 24 months, from June 2024 to May 2026. Each test month was forecast using only information referring to earlier months, under the assumption that the previous month’s data had already been published (Section 5.4 relaxes this assumption); the models were re-estimated at the start of each twelve-month block and, within the block, updated with the observed data. Each tax therefore produced 5304 forecasts per model (221 cantons times 24 months).
Figure 3 shows national revenue and how concentrated it is. The two largest cantons account for 74.4% of the total and the top ten for 89.4%, while the median canton collects about 195,000 dollars per month.
Figure 3. Data overview. (a) Monthly national revenue: total, VAT and income tax; grey: months with a tax amnesty; orange: the lockdown. (b) Mean monthly revenue of each canton between 2023 and 2025, on a logarithmic scale, and cumulative percentage of the total (right axis).
Table 3 summarises the tests carried out. Model comparisons use the Diebold–Mariano test (Equation (10)) over the 24 months, with the mean error across cantons in each month, at a 5% significance level, with the Newey–West variance, the bootstrap check and the Holm adjustment described in Section 3. The two configuration searches were compared with the Wilcoxon signed-rank test, pairing the runs by seed.
Table 3. Tests carried out.

5.2. Local Versus Global Models

The starting point was the national series. With about one hundred months of history, SARIMA had an error of 7.0% over the 24 test months, ARIMA with exogenous variables 8.7%, the LSTM 10.1% and the MLP 14.5%. With a single series, the networks did not outperform the classical model, as in other countries (Chhim & Lim, 2026).
Table 4 reports the canton-level results, recomputed after the correction of the imputation described in Section 4. The linear models and SARIMA are unchanged at the reported precision; the networks, which were retrained, changed by less than 0.01 in RMSE, and their national errors by up to two percentage points. With the year-on-year representation, the three global models had larger errors than the per-canton SARIMA for all three taxes. With the normalised window, the ranking was reversed: the global linear model reduced the RMSE for total revenue from 0.393 to 0.363 and the median MASE from 0.707 to 0.677, and the same occurred for VAT and income tax. With the same 24 months of history and the same exogenous variables, the representation of that history determined which model had the lower error.
Table 4. One-step-ahead forecast error over the 24 test months (221 cantons). RMSE: root mean squared error in logarithms; MASE: median across cantons (below 1 is better than repeating the previous year); MAPE: error of the national total, in percent. Bold: lowest value in each column. The per-canton models with the same information receive the explanatory variables of the global models (SARIMAX) or exactly their 43 inputs (ridge regression); the SARIMA with AIC orders is univariate (univ.).
The per-canton models that receive the same information as the global models did not reproduce this improvement. The SARIMAX had a larger error than the univariate SARIMA for the three taxes (0.404 versus 0.393 for total revenue), the per-canton ridge regression had practically the same error (0.392, 0.504 and 0.494 versus 0.393, 0.493 and 0.499), and selecting the SARIMA orders by the Akaike criterion also increased the error slightly (0.397 for total revenue). The global linear model, which uses the same 43 inputs as the per-canton ridge regression, had a lower error than all of them. The additional predictors therefore do not explain the advantage of the global models; what distinguishes them is that one set of parameters is estimated from all the cantons. The loss function does not explain it either: with the squared loss, the global linear model is a ridge regression on the same inputs as the per-canton ridge regression, and its RMSE was 0.362, 0.449 and 0.470 (Table 5), against 0.392, 0.504 and 0.494 for the per-canton ridge regression, whose difference with SARIMA was not significant (Section 5.3). All the SARIMAX and ridge regressions converged; the SARIMA with selected orders failed numerically in two income tax cantons (24 forecasts), which received the fixed SARIMA forecast.
Table 5. RMSE per canton of the global models with the same estimator in both representations. Huber: Huber regression for the linear model and Huber loss for the networks; squared loss: ridge regression and squared loss.
The difference between the two representations did not depend on the estimator (Table 5). With the Huber loss in both representations, or with the squared loss in both, the RMSE of each global model changed by at most 0.002, whereas changing the representation changed it by 0.07 to 0.11. The Diebold–Mariano test found no difference between the two estimators of the global linear model within either representation ( p > 0.35 for all three taxes) and a significant difference between the representations with either estimator ( p < 0.001 ). The national errors of the networks varied more between estimators (for total revenue, 5.7 and 5.6% for the MLP and 6.7 and 7.1% for the LSTM with the Huber and the squared loss), without changing the ranking.
The advantage of the global models with the normalised window held for cantons of all sizes (Figure 4b–d and Table 6). For total revenue, the SARIMA error fell from 0.536 in the smallest cantons to 0.252 in the largest, that of the global linear model from 0.497 to 0.226, and that of the average of the global models and SARIMA from 0.493 to 0.218. For VAT in the group of the largest cantons, SARIMA and the global linear model had practically the same error (0.227 and 0.228), and the average of the global models and SARIMA had 0.219. The per-canton ridge regression had slightly lower errors than SARIMA in the smallest cantons, but in every group, it remained above the global linear model.
Figure 4. (a) RMSE per canton and month of each model for the three taxes; the seasonal naive benchmark is not drawn and its values are given in the panel title; green: per-canton models; purple, hatched: global models with the year-on-year representation; blue: global models with the normalised window; orange: average of the global models and SARIMA. (b–d) Error by canton size, from the smallest (Q1) to the largest (Q4), for total revenue, VAT and income tax.
Table 6. RMSE per canton by size quartile, from the smallest (Q1) to the largest (Q4) cantons by mean revenue.

5.3. Per-Canton SARIMA as Benchmark

Table 7 reports the Diebold–Mariano tests with the Newey–West variance, the p-values adjusted with the Holm procedure across the three taxes of each comparison, the more conservative adjustment across the 42 comparisons of the table (14 comparisons for each of the three taxes) and the moving-block bootstrap p-values; Table 8 gives 95% confidence intervals. The three global models with the normalised window had lower errors than the per-canton SARIMA for all three taxes, with adjusted p-values below 0.001 across taxes, of 0.014 or less across the whole table, and bootstrap p-values below 0.001. With the year-on-year representation, SARIMA had the lower error, significantly for the three taxes ( p ≤ 0.005 ); under the adjustment across the whole table, the difference for income tax was no longer significant ( p = 0.073 ). Compared with the global linear model, neither the MLP nor the LSTM showed significant differences on their own, and the confidence intervals of their differences include zero. The average of the linear model and the two networks had a lower error than the linear model in the three taxes, significantly for total revenue ( p = 0.010 ) and income tax ( p = 0.015 ) but not for VAT ( p = 0.072 ); the bootstrap confirms the three differences, and their confidence intervals exclude zero for total revenue and income tax. Under the adjustment across all 42 comparisons, the p-values for total revenue and income tax were 0.057 and 0.100. The alternative per-canton benchmarks had larger errors than the global linear model in all three taxes ( p ≤ 0.004 across taxes; under the adjustment across the whole table, all below 0.015 except the per-canton ridge regression in VAT, p = 0.073 ), and the per-canton SARIMAX had a larger error than the univariate SARIMA ( p ≤ 0.029 ).
Table 7. Diebold–Mariano test on the monthly mean squared error ( H = 24 ). DM: statistic with the Newey–West variance ( L = 2 ) and the small-sample correction; Holm: two-sided p-value adjusted with the Holm procedure across the three taxes of each comparison; All: p-value adjusted across the 42 comparisons of the table; MBB: moving-block bootstrap p-value. Lin., MLP, LSTM: global models with the normalised window; Lin. (YoY): global linear model with the year-on-year representation; Avg.: average of the three global models; Avg. + SAR.: average of the global models and SARIMA; Ridge (local) and SARIMA-AIC: per-canton ridge regression and SARIMA with orders selected by the Akaike criterion. A positive statistic indicates that the second model in the comparison has the lower error.
Table 8. 95% moving-block bootstrap confidence intervals. Top: RMSE per canton and MAPE of the national total (%) of the main models. Bottom: mean difference in the monthly mean squared error ( d ¯ in Equation (10)) for the main comparisons; a positive value indicates that the second model has the lower error, and an interval that excludes zero indicates a significant difference. Abbreviations as in Table 7.
The loss differentials showed little serial dependence: of the 42 series, only one had a Ljung–Box p-value below 0.05 (global linear versus the average of the global models, total revenue, p = 0.017 ), and the first-order autocorrelations ranged from − 0.21 to 0.53 . The conclusions with the statistic of the first version ( L = 0 ) and with the Newey–West variance coincide. The forecast errors, by contrast, were strongly dependent across cantons: the CD statistic was between 40.7 and 42.4 for the SARIMA errors and between 62.0 and 72.1 for the global linear model ( p < 0.001 ), with mean pairwise correlations of 0.05 to 0.09. This is why the tests are applied to the monthly average across cantons, whose effective sample is the 24 months.
The national total showed a different picture. For total revenue and income tax, the average of the global models and SARIMA had a lower national error than SARIMA (5.3 versus 6.8% and 8.0 versus 10.3%). For VAT, SARIMA had the lowest error of the national total (4.8% versus 7.0%). None of these national differences was significant (Section 5.5). Figure 5 shows the monthly series. Since the two largest cantons account for about three quarters of revenue, the national total depends mainly on them, and the global models, which give the same weight to every canton during training, are not targeted at that figure. This motivated the size weighting presented below.
Figure 5. National total obtained by summing the forecasts of the 221 cantons over the 24 test months, compared with observed revenue (black). (a) Total revenue. (b) VAT. The dashed orange line is the unweighted average of the global models and SARIMA, and the blue line the average with the weight selected in the validation period ( α = 0.75 for total revenue and α = 1 for VAT).

5.4. Publication Delay

Table 9 repeats the comparison with less information. With the explanatory variables lagged two months, the error of the global linear model rose from 0.363 to 0.368 for total revenue, from 0.450 to 0.455 for VAT and from 0.471 to 0.473 for income tax; for the average of the global models and SARIMA, the loss was significant for total revenue and VAT ( p = 0.011 and p = 0.015 ) but not for income tax ( p = 0.91 ). With all information lagged two months, which amounts to forecasting two months ahead, all errors increased, including that of SARIMA (0.407 for total revenue). In both variants, the global models kept a significantly lower error than the per-canton SARIMA with the same information, with p ≤ 0.002 for all three taxes. The conclusions therefore do not depend on the assumption that the explanatory variables of the previous month are available.
Table 9. Sensitivity to publication delays: RMSE per canton of the per-canton SARIMA, the global linear model (window) and the average of the global models and SARIMA, and Diebold–Mariano p-value (Newey–West) of SARIMA versus the global linear model with the same information.

5.5. Further Experiments

The first factor examined was the network configuration. Figure 6 shows the progress of the searches, now with ten replications per method. In the validation period, the best configuration found by random search had a mean error of 0.3877 (standard deviation 0.0014), and that found by differential evolution 0.3880 (0.0014). The Wilcoxon test over the ten pairs did not detect a significant difference ( p = 0.57 ; the smallest attainable p-value is now 0.002), differential evolution found the better configuration in five of the ten pairs, and the bootstrap 95% confidence interval of the mean difference was [ − 0.0005 , 0.0011 ] . The 1200 configurations tested produced very similar errors: half fell below 0.3955 and the best 10% below 0.3914, compared with 0.3955 for the global linear model in the same period. The absence of a significant difference does not show that the two methods are equivalent; with twelve validation months and many configurations performing almost equally well, this comparison has little power to separate them.
Figure 6. Configuration search for the global MLP (total revenue). (a) Best validation error found as a function of the number of training runs; the line is the median of ten replications and the shaded band, in the colour of each line, the minimum and maximum. (b) Validation error of the 1200 configurations tested by the two methods; the dashed line is the global linear model.
On the test set, the configuration selected by differential evolution, which was also the best in validation (two layers of 85 neurons, without dropout), had an RMSE of 0.364 and a national error of 6.3%; the best configuration of random search (three layers of 20 neurons, dropout 0.44) had 0.366 and 7.1%. Neither differed significantly from the global linear model ( p = 0.64 and p = 0.28 ) or from each other ( p = 0.40 ).
The second factor, the loss function, is reported in Table 5: with the squared loss instead of the Huber loss, the RMSE changed by at most 0.002 for the global models.
The third factor was the size weighting (Equation (5)). Table 10 reports, for each value of α , the national error in the validation period, which was used to choose α , and the canton-level and national errors in the test. The validation criterion selected α = 0.75 for total revenue, α = 1 for VAT and α = 0 for income tax. In the test, the selected value did not give the lowest national error for any tax: for total revenue, the national error was 5.6% with α = 0.75 and 5.3% with equal weights; for VAT, 5.0% with α = 1 and 4.7% with α = 0.5 , compared with 4.8% for SARIMA; and for income tax, 8.0% with equal weights and 7.4% with α = 1 , compared with 10.3% for SARIMA. Increasing α tended to raise the canton-level error, which was higher with α = 1 than with equal weights in all three taxes (0.364 versus 0.358 for total revenue, 0.458 versus 0.448 for VAT and 0.472 versus 0.463 for income tax, where α = 0.25 gave 0.462), although it remained significantly below that of SARIMA for every value of α ( p ≤ 0.008 ). No national difference with respect to SARIMA was significant (adjusted p ≥ 0.10 ), and the confidence intervals of the national error of the different weights overlap widely (Figure 7): with 24 months, errors that differ by one or two percentage points cannot be separated.
Table 10. Average of the global models and SARIMA as a function of the weight given to large cantons. Val.: MAPE of the national total in the validation period, used to select α (bold: selected value). RMSE and MAPE: error per canton and of the national total in the test. In parentheses, the Diebold–Mariano p-value against the per-canton SARIMA, with the Newey–West variance and adjusted with the Holm procedure across the three taxes.
Figure 7. Error of the national total (top) and per canton (bottom) of the average of the global models and SARIMA for each weight α , with 95% moving-block bootstrap confidence intervals. Red circle: value selected in the validation period. Dashed line and shaded band: per-canton SARIMA and its interval.

5.6. Explaining the Forecasts

Figure 8 shows the contribution of each group of variables to the forecasts of the global MLP for total revenue, with the configuration selected by differential evolution, computed with SHAP values over the 5304 test forecasts. It was verified that the sum of these contributions and the base value reproduces the network output with differences below 10 − 6 . The month of the year had the largest mean contribution (0.085), followed by the canton’s own history (0.030 to 0.042 for each block of months) and its declared sales (0.035). The lockdown (0.015) and the tax amnesty (0.012) followed, canton size contributed 0.008, and the number of taxpayers, national non-oil activity and the oil price contributed less than 0.005 each. Panel (b) shows the sign of each contribution: high values of sales, of the last three months and of the same month of the previous year raise the forecast, and the amnesty indicator has positive contributions in the months in which it is active and small negative ones in the rest.
Figure 8. Contribution of each group of variables to the forecasts of the global MLP (total revenue, 24 test months). (a) Mean absolute SHAP value; orange: the tax amnesty. (b) SHAP value of each forecast, coloured by the value of the input (blue: low; red: high; grey: month of the year, which has no order).
In the 1989 forecasts for months with an amnesty, the mean SHAP contribution of the amnesty was + 0.018 , compared with − 0.007 in months without one. This difference compares different months and does not isolate the indicator, so a paired exercise was added: every test forecast was computed twice, with the amnesty indicator set to 1 and to 0 and all other inputs fixed. With the indicator set to 1, the forecast rose on average by 5.5% for the global linear model, 5.7% for the MLP and 7.4% for the LSTM, and by 6.2% for their average (between 5.3 and 7.3% for 80% of the canton-months). These figures describe how the models respond to the indicator, an association learned from past amnesties that may also reflect other changes that occurred in the same months; they point in the same direction as the increase in revenue during amnesty months documented for the country (Espinosa-Jaramillo et al., 2024; Otavalo Cacuango, 2022), but they are not a measurement of the causal effect of an amnesty.

6. Discussion and Conclusions

For forecasting the monthly revenue of the 221 cantons of Ecuador, a single model trained on all cantons had a lower error than a SARIMA estimated for each canton. This held for total revenue, VAT and income tax, with significant differences and for cantons of all sizes except the largest ones in VAT, provided that each canton’s history was expressed relative to its own level. The advantage did not come from the additional predictors: a SARIMAX and a ridge regression estimated for each canton with the same information as the global models had practically the same error as the univariate SARIMA, or a larger one. With year-on-year changes as input, the same models had larger errors than SARIMA, also when the estimator was held fixed, so the difference is due to the representation and not to the estimator. The neural networks alone did not differ from the global linear model; averaged with it, they reduced the error for total revenue and income tax, significantly after adjusting for the three taxes, although not under the more conservative adjustment across all the comparisons. When the explanatory variables, or all the information, were lagged two months to reflect publication delays, the errors increased by less than 0.02 and the global models kept a significant advantage over SARIMA.
An explanation consistent with these results is that the cantons share the tax calendar, the reforms and the business cycle, a common component that is also visible in the strong correlation of the forecast errors across cantons. A model that learns from all of them has thousands of observations with which to estimate patterns that a SARIMA must estimate from about one hundred months of a single canton. The normalised window preserves the full shape of the last two years, including the annual pattern, whereas the year-on-year changes reduce it to twelve differences. That the global linear model achieves most of the improvement indicates that much of the gain comes from pooling the cantons and not only from using neural networks; the improvement of the average is consistent with the network and the linear model making different errors.
Several features of this problem may explain why the networks did not outperform the global linear model; they were not tested directly. Once each history is expressed relative to its own level, much of the predictable variation is the annual calendar and the recent level, which a linear combination of the lagged values already captures. Among the 1200 network configurations evaluated in the configuration search, the median validation error was 0.3955, the same as that of the global linear model, so that the additional flexibility of the networks bought little. And with 24 test months, differences of one or two percent in the error cannot be separated from noise. Networks are more likely to add value when the relation between the inputs and revenue is non-linear and stable, for example, a response to reforms that changes with the size of the canton, when longer histories or more units are available, or, as in this study, when they are averaged with a linear model whose errors differ from theirs. For a tax administration, this means that a global linear model delivers most of the gain at a small computational cost and is easier to explain and that a network is worth adding as part of an average rather than as a replacement.
These findings have direct practical value. For planners in the tax administration, a single model produces a monthly forecast for every canton, including the small ones, with a lower error than a per-canton model. The forecasts refer to national taxes recorded in each canton. They serve the regional offices of the tax administration and, through the national total, the central budget on which the transfers to local governments depend; they are not forecasts of the own-source revenue of the municipalities, such as property taxes and fees, which would require municipal data. For researchers in public economics, the study shows that the comparison between neural networks and classical models depends on how much data are available and on how they are represented. It also shows that a global linear model is the necessary benchmark to determine whether an improvement is due to the network or to pooling the series.
The size weighting is a trade-off, not a general improvement. Giving more weight to the large cantons tended to raise the canton-level error in all three taxes, and its effect on the error of the national total depended on the tax: in the test, the national error was lowest with equal weights for total revenue, with α = 0.5 for VAT and with the largest weights for income tax, and the value selected in the validation period did not give the lowest test error for any tax. None of the national differences with respect to SARIMA was significant, because 24 months cannot separate errors that differ by one or two percentage points. The weight should therefore be chosen for each purpose: equal weights when the canton forecasts are the goal, and a value selected in a validation period, as done here, when the national total matters most; no single value can be recommended for all taxes on the basis of this evidence.
The final model was implemented as a web calculator that runs in the user’s browser, reproduces the PyTorch forecasts with differences of the order of 10 − 6 , displays an error range computed from the test errors of cantons of similar size, and allows scenarios to be evaluated, such as a change in sales or a new amnesty. The amnesty scenarios of the calculator, like the SHAP values and the paired scenario of Section 5.6, show how the model’s forecast responds to the amnesty indicator. They reflect an association learned from past amnesties, which may also capture other changes that occurred in the same months, such as filing deadlines or the recovery after the lockdown; they are not an estimate of the effect of an amnesty on revenue.
It is advisable not to use year-on-year changes alone as input, and to treat the size weight as uncertain, because the value selected in a twelve-month validation period did not carry over to the test. With ten replications per method, the difference between the two searches was not significant (Wilcoxon p = 0.57 ), and differential evolution found the better configuration in five of the ten pairs. This does not show that the two methods are equivalent: the validation period has twelve months and many configurations perform almost equally well, so the comparison has little power to separate them.
The scope of the evidence should be kept in mind when applying these results. The test covers 24 months, so differences in the national total of one or two percentage points cannot be declared significant. The forecasts are one month ahead; the two-month lag sensitivity approximates longer delays but not multi-step forecasting. The SRI does not archive earlier versions of its open data, so the exercise uses the latest vintage rather than the data available at each date. And all model choices were made with a single validation year.
Future work includes forecasting several months ahead with models trained for each horizon, extending the analysis to the remaining tax groups and to the transfers to local governments, comparing the models with the model confidence set, and studying the effect of amnesties with a design intended to identify causal effects.

Author Contributions

Conceptualisation, M.A.U.P.; methodology, M.A.U.P. and D.J.M.-C.; software, D.J.M.-C.; validation, M.A.U.P. and D.J.M.-C.; formal analysis, M.A.U.P. and D.J.M.-C.; investigation, M.A.U.P.; data curation, D.J.M.-C.; writing—original draft preparation, M.A.U.P.; writing—review and editing, M.A.U.P. and D.J.M.-C.; visualisation, D.J.M.-C.; supervision, M.A.U.P.; conception of the study and development of the econometric models, M.A.U.P.; development of the neural networks, D.J.M.-C. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The revenue, sales, active taxpayer and IAENP data are open data from the Internal Revenue Service of Ecuador (https://www.sri.gob.ec/datasets, accessed on 20 October 2026); the oil price is from FRED (https://fred.stlouisfed.org, accessed on 20 October 2026). The web calculator is available at https://myri1999-ship-it.github.io/pronosticosimpuestos/, accessed on 20 October 2026; the code and the forecasts are available from the corresponding author upon request.

Acknowledgments

The authors thank the Universidad de las Fuerzas Armadas ESPE for its support.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Alm, J., Martinez-Vazquez, J., & Wallace, S. (2009). Do tax amnesties work? The revenue effects of tax Amnesties during the transition in the Russian Federation. Economic Analysis and Policy, 39(2), 235–253. [Google Scholar] [CrossRef] [Scilit]
  2. Alm, J., McKee, M., & Beck, W. (1990). Amazing grace: Tax amnesties and compliance. National Tax Journal, 43(1), 23–37. [Google Scholar] [CrossRef] [Scilit]
  3. Asamblea Nacional del Ecuador. (2018, August 21). Ley Orgánica para el Fomento Productivo, Atracción de Inversiones, Generación de Empleo, y Estabilidad y Equilibrio Fiscal. Registro Oficial Suplemento 309. Registro Oficial del Ecuador, Corte Constitucional del Ecuador.
  4. Asamblea Nacional del Ecuador. (2023, December 20). Ley Orgánica de Eficiencia Económica y Generación de Empleo. Registro Oficial Tercer Suplemento 461. Registro Oficial del Ecuador, Corte Constitucional del Ecuador.
  5. Asamblea Nacional del Ecuador. (2025, June 26). Ley Orgánica de Integridad Pública. Registro Oficial Tercer Suplemento 68. Registro Oficial del Ecuador, Corte Constitucional del Ecuador.
  6. Baer, K., & Le Borgne, E. (2008). Tax amnesties: Theory, trends, and some alternatives. International Monetary Fund. [Google Scholar] [CrossRef] [Scilit]
  7. Bandara, K., Bergmeir, C., & Smyl, S. (2020). Forecasting across time series databases using recurrent neural networks on groups of similar series: A clustering approach. Expert Systems with Applications, 140, 112896. [Google Scholar] [CrossRef] [Scilit]
  8. Bates, J. M., & Granger, C. W. J. (1969). The combination of forecasts. Journal of the Operational Research Society, 20(4), 451–468. [Google Scholar] [CrossRef] [Scilit]
  9. Box, G. E. P., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2015). Time series analysis: Forecasting and control (5th ed.). Wiley. [Google Scholar]
  10. Buettner, T., & Kauder, B. (2010). Revenue forecasting practices: Differences across countries and consequences for forecasting performance. Fiscal Studies, 31(3), 313–340. [Google Scholar] [CrossRef] [Scilit]
  11. Chhim, T., & Lim, S. (2026). Forecasting tax revenue in Cambodia: A comparative study of traditional time-series models and machine-learning methods. Economies, 14(9), 399. [Google Scholar] [CrossRef] [Scilit]
  12. Cirincione, C., Gurrieri, G. A., & van de Sande, B. (1999). Municipal government revenue forecasting: Issues of method and data. Public Budgeting & Finance, 19(1), 26–46. [Google Scholar] [CrossRef] [Scilit]
  13. Croushore, D. (2011). Frontiers of real-time data analysis. Journal of Economic Literature, 49(1), 72–100. [Google Scholar] [CrossRef] [Scilit]
  14. Das, S., & Suganthan, P. N. (2011). Differential evolution: A survey of the state-of-the-art. IEEE Transactions on Evolutionary Computation, 15(1), 4–31. [Google Scholar] [CrossRef] [Scilit]
  15. Diebold, F. X. (2015). Comparing predictive accuracy, twenty years later: A personal perspective on the use and abuse of diebold–mariano tests. Journal of Business & Economic Statistics, 33(1), 1. [Google Scholar] [CrossRef] [Scilit]
  16. Diebold, F. X., & Mariano, R. S. (1995). Comparing predictive accuracy. Journal of Business & Economic Statistics, 13(3), 253–263. [Google Scholar] [CrossRef] [Scilit]
  17. Espinosa-Jaramillo, M. T., Chenet Zuta, M. E., Olivares-Zegarra, S. d. R., & Urbina Poveda, M. A. (2024). Condonación de impuestos en Ecuador: Estrategias y efectos en la recaudación. Revista de Ciencias Sociales, 30(4), 261–273. [Google Scholar] [CrossRef] [Scilit]
  18. Gómez Medina, H. M., Urbina, M., Jerez Calero, M. E., Cuenca, V., Córdova, A., & Cuenca, E. (2026). Clustering spatiotemporal patterns of infrastructure investment in Ecuador: A cantonal-level analysis (2008–2022). In Information management and big data (pp. 403–418). Springer Nature. [Google Scholar] [CrossRef] [Scilit]
  19. Hansen, P. R., Lunde, A., & Nason, J. M. (2011). The model confidence set. Econometrica, 79(2), 453–497. [Google Scholar] [CrossRef] [Scilit]
  20. Harvey, D., Leybourne, S., & Newbold, P. (1997). Testing the equality of prediction mean squared errors. International Journal of Forecasting, 13(2), 281–291. [Google Scholar] [CrossRef] [Scilit]
  21. Hewamalage, H., Bergmeir, C., & Bandara, K. (2021). Recurrent neural networks for time series forecasting: Current status and future directions. International Journal of Forecasting, 37(1), 388–427. [Google Scholar] [CrossRef] [Scilit]
  22. Hewamalage, H., Bergmeir, C., & Bandara, K. (2022). Global models for time series forecasting: A simulation study. Pattern Recognition, 124, 108441. [Google Scholar] [CrossRef] [Scilit]
  23. Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735–1780. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  24. Holm, S. (1979). A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics, 6(2), 65–70. [Google Scholar]
  25. Huber, P. J. (1964). Robust estimation of a location parameter. The Annals of Mathematical Statistics, 35(1), 73–101. [Google Scholar] [CrossRef] [Scilit]
  26. Hyndman, R. J., & Khandakar, Y. (2008). Automatic time series forecasting: The forecast package for R. Journal of Statistical Software, 27(3), 1–22. [Google Scholar] [CrossRef] [Scilit]
  27. Hyndman, R. J., & Koehler, A. B. (2006). Another look at measures of forecast accuracy. International Journal of Forecasting, 22(4), 679–688. [Google Scholar] [CrossRef] [Scilit]
  28. Januschowski, T., Gasthaus, J., Wang, Y., Salinas, D., Flunkert, V., Bohlke-Schneider, M., & Callot, L. (2020). Criteria for classifying forecasting methods. International Journal of Forecasting, 36(1), 167–177. [Google Scholar] [CrossRef] [Scilit]
  29. Kingma, D. P., & Ba, J. (2014). Adam: A method for stochastic optimization. arXiv. [Google Scholar] [CrossRef] [Scilit]
  30. Künsch, H. R. (1989). The jackknife and the bootstrap for general stationary observations. The Annals of Statistics, 17(3), 1217–1241. [Google Scholar] [CrossRef] [Scilit]
  31. Leal, T., Pérez, J. J., Tujula, M., & Vidal, J. (2008). Fiscal forecasting: Lessons from the literature and challenges. Fiscal Studies, 29(3), 347–386. [Google Scholar] [CrossRef] [Scilit]
  32. Leonard, H. B., & Zeckhauser, R. J. (1987). Amnesty, enforcement, and tax policy. Tax Policy and the Economy, 1, 55–85. [Google Scholar] [CrossRef] [Scilit]
  33. Ljung, G. M., & Box, G. E. P. (1978). On a measure of lack of fit in time series models. Biometrika, 65(2), 297–303. [Google Scholar] [CrossRef]
  34. Lundberg, S., & Lee, S.-I. (2017). A unified approach to interpreting model predictions. arXiv. [Google Scholar] [CrossRef] [Scilit]
  35. Makridakis, S., Spiliotis, E., & Assimakopoulos, V. (2020). The M4 Competition: 100,000 time series and 61 forecasting methods. International Journal of Forecasting, 36(1), 54–74. [Google Scholar] [CrossRef] [Scilit]
  36. Makridakis, S., Spiliotis, E., & Assimakopoulos, V. (2022). M5 accuracy competition: Results, findings, and conclusions. International Journal of Forecasting, 38(4), 1346–1364. [Google Scholar] [CrossRef] [Scilit]
  37. Mikesell, J. L. (2018). Often wrong, never uncertain: Lessons from 40 years of state revenue forecasting. Public Administration Review, 78(5), 795–802. [Google Scholar] [CrossRef] [Scilit]
  38. Montero-Manso, P., & Hyndman, R. J. (2021). Principles and algorithms for forecasting groups of time series: Locality and globality. International Journal of Forecasting, 37(4), 1632–1653. [Google Scholar] [CrossRef] [Scilit]
  39. Newey, W. K., & West, K. D. (1987). A simple, positive semi-definite, heteroskedasticity and autocorrelation consistent covariance matrix. Econometrica, 55(3), 703–708. [Google Scholar] [CrossRef] [Scilit]
  40. Otavalo Cacuango, E. V. (2022). Análisis de la remisión tributaria y su impacto en la recaudación de impuestos en el Ecuador, periodo 2018. Revista Eruditus, 3(1), 63–80. [Google Scholar] [CrossRef] [Scilit]
  41. Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Köpf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., … Chintala, S. (2019). Pytorch: An imperative style, high-performance deep learning library. arXiv. [Google Scholar] [CrossRef] [Scilit]
  42. Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Müller, A., Nothman, J., Louppe, G., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., & Duchesnay, É. (2012). Scikit-learn: Machine learning in python. arXiv. [Google Scholar] [CrossRef] [Scilit]
  43. Pesaran, M. H. (2015). Testing weak cross-sectional dependence in large panels. Econometric Reviews, 34(6–10), 1089–1117. [Google Scholar] [CrossRef] [Scilit]
  44. Pesaran, M. H. (2021). General diagnostic tests for cross-sectional dependence in panels. Empirical Economics, 60(1), 13–50. [Google Scholar] [CrossRef] [Scilit]
  45. Presidencia de la República del Ecuador. (2010). Reglamento para la aplicación de la Ley de Régimen Tributario Interno. Decreto Ejecutivo 374, Registro Oficial Suplemento 209. (Article 158; in Force with Subsequent Amendments). Registro Oficial del Ecuador, Corte Constitucional del Ecuador.
  46. Presidencia de la República del Ecuador. (2021, November 29). Ley Orgánica para el Desarrollo Económico y Sostenibilidad Fiscal tras la Pandemia COVID-19. Decree-Law, Registro Oficial Tercer Suplemento 587. Registro Oficial del Ecuador, Corte Constitucional del Ecuador.
  47. Reddick, C. G. (2004). An empirical examination of revenue forecasting techniques in local governments. Municipal Finance Journal, 24(4), 25–48. [Google Scholar] [CrossRef] [Scilit]
  48. Salinas, D., Flunkert, V., Gasthaus, J., & Januschowski, T. (2020). DeepAR: Probabilistic forecasting with autoregressive recurrent networks. International Journal of Forecasting, 36(3), 1181–1191. [Google Scholar] [CrossRef] [Scilit]
  49. Seabold, S., & Perktold, J. (2010). Statsmodels: Econometric and statistical modeling with Python. In Proceedings of the 9th python in science conference (pp. 92–96). SciPy. [Google Scholar] [CrossRef] [Scilit]
  50. Smyl, S. (2020). A hybrid method of exponential smoothing and recurrent neural networks for time series forecasting. International Journal of Forecasting, 36(1), 75–85. [Google Scholar] [CrossRef] [Scilit]
  51. Storn, R., & Price, K. (1997). Differential evolution—A simple and efficient heuristic for global optimization over continuous spaces. Journal of Global Optimization, 11(4), 341–359. [Google Scholar] [CrossRef] [Scilit]
  52. Swenson, C. (2024). Using machine deep learning AI to improve forecasting of tax payments for corporations. Forecasting, 6(4), 968–984. [Google Scholar] [CrossRef] [Scilit]
  53. Torgler, B., & Schaltegger, C. A. (2005). Tax amnesties and political participation. Public Finance Review, 33(3), 403–431. [Google Scholar] [CrossRef] [Scilit]
  54. Urbina Poveda, M. A., Gómez, H. M., Jerez Calero, M. E., Cuenca, E., Córdova, A., & Cuenca, V. (2026). The infrastructure paradox in Ecuador: Public investment and the persistence of territorial disparities in cantons with low initial development. Economies, 14(4), 139. [Google Scholar] [CrossRef] [Scilit]
  55. Uwizeye, C. (2025). Digitalising tax compliance and elevating revenue forecasting in Rwanda: Evidence from statistical modelling and machine learning. African Multidisciplinary Tax Journal, 5, 311–330. [Google Scholar] [CrossRef] [Scilit]
  56. Wang, X., Hyndman, R. J., Li, F., & Kang, Y. (2023). Forecast combinations: An over 50-year review. International Journal of Forecasting, 39(4), 1518–1547. [Google Scholar] [CrossRef] [Scilit]
  57. Wilcoxon, F. (1945). Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 80. [Google Scholar] [CrossRef] [Scilit]
  58. Williams, D. W., & Kavanagh, S. C. (2016). Local government revenue forecasting methods: Competition and comparison. Journal of Public Budgeting, Accounting & Financial Management, 28(4), 488–526. [Google Scholar] [CrossRef] [Scilit]
  59. Young, S. R., Rose, D. C., Karnowski, T. P., Lim, S.-H., & Patton, R. M. (2015). Optimizing deep learning hyper-parameters through an evolutionary algorithm. In Proceedings of the workshop on machine learning in high-performance computing environments (pp. 1–5). ACM. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.