October 13, 2026
Prediction of probable dengue cases in São Paulo with Google Trends data
Prediction of Probable Dengue Cases in São Paulo with Google Trends Data
Maria Clara Baptista da Silva; Wallace Gusmão Ferreira
DOI: 10.22167/2675-6528-202603255
Article derived from a Course Conclusion Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.
Summary
Dengue, an arbovirus of high public health relevance, presented a significant increase in cases in the state of São Paulo in 2024, reinforcing the importance of techniques capable of early estimating the magnitude of outbreaks, given that the consolidation of official data is frequently delayed. The study aimed to identify the most effective model for the nowcast of probable dengue cases from Google Trends data and, additionally, to evaluate the potential of these approaches for forecasting subsequent months. To this end, several models were compared, including multiple linear regression, LASSO, Random Forests, SARIMA, and SARIMAX, using monthly data from the state of São Paulo. The results indicated that Google Trends showed predictive utility for nowcasting, with emphasis on the SARIMAX model, which achieved an RMSE of 19.106, MAE of 12.507, and MAPE of 38.5%. However, in the forecasting stage, the results were less satisfactory, highlighting the models’ limitations in adequately anticipating periods of more abrupt case growth. It was concluded that Google Trends constitutes a relevant complementary source for timely dengue monitoring, with greater contribution to nowcasting than to forecasting subsequent months.
Keywords: Dengue; Nowcasting; Time series; Epidemiological surveillance.
1. Introduction
Dengue is an arbovirus infection of great relevance to global public health, caused by the DENV virus and transmitted by the Aedes aegypti mosquito. This systemic infection can manifest from mild cases to severe forms, such as hemorrhagic fever, and can lead to death. In Brazil, dengue outbreaks have been recorded since the colonial period, with the first documented case in 1685 in Recife and the first epidemic in 1692 in Salvador, which resulted in about two thousand deaths (Salles et al., 2018).
The recurrence and severity of dengue outbreaks in the country underscore the need for effective monitoring. In the state of São Paulo, the year 2024 was marked by a significant increase in cases and deaths, surpassing the sum of the last ten years, according to data from the Notifiable Diseases Information System (SINAN, 2025). This scenario was aggravated by the simultaneous circulation of the four dengue virus serotypes, including serotypes three and four, which had not circulated for a longer time, increasing the susceptible population to infection (Butantan Institute, 2024).
Despite the criticality of dengue monitoring and control for public health, the compilation and dissemination of official case data face significant challenges. Notification depends on public and private health services, which can be bureaucratic and time-consuming. Studies indicate that less than 50% of cases are reported within one week, less than 75% within four weeks, and no more than 90% within nine weeks (Bastos et al., 2019). This delay compromises the ability to respond quickly and effectively to epidemics.
To mitigate delays in data consolidation, machine learning techniques have been explored in the prediction of dengue cases and other notifiable diseases. Tools like “X”, formerly known as “Twitter”, a microblogging social network, allow for instant information publication. The use of “X” data is justified by its real-time characteristic, with studies demonstrating its effectiveness, such as that by Marques-Toledo (2017), which indicated a 93% capacity in explaining the deviation of dengue cases. However, the reach of “X” is limited to its user profile, with about 70% of the user base between 18 and 34 years old in February 2025 (Statista, 2025).
An alternative to broaden the scope and continue obtaining real-time data is the use of Google Trends. This tool from the main internet search engine allows quantifying the level of interest in keywords on a scale of zero to one hundred. Previous studies have already demonstrated the correlation between the number of cases of diseases of public concern and the level of interest in related topics, such as Covid-19 (Furletti et al., 2022) and Influenza (Orellano et al., 2015). This correlation can be explored for nowcasting dengue cases, identifying increases in searches for terms such as “Dengue Symptoms” or “Dengue Test”, which are likely to be searched by individuals with symptoms of the disease (Cruz & Izbicki, 2018).
The concept of nowcast refers to the prediction of the present or immediate future, combining the terms “now” and “forecast”, as described by Penteado (2023). This method is particularly relevant for estimating the number of dengue cases, given the delay in consolidating the final data for each period. The application of nowcast can provide more timely information for epidemiological surveillance, allowing for a more agile and targeted response.
Given the urgency in obtaining real-time data for dengue monitoring and the promise of online search tools like Google Trends, it becomes fundamental to investigate the effectiveness of different predictive models to estimate and forecast the occurrence of the disease. Thus, the present study aims to identify the most effective model for the nowcast of probable dengue cases from Google Trends data and, additionally, to evaluate the potential of these approaches for forecasting subsequent months.
2. Material and Methods
The present study was characterized as a quantitative research, of a predictive nature, with a methodological approach based on time series modeling. The objective was to identify the most effective model for the nowcast of probable dengue cases from Google Trends data and, additionally, to evaluate the potential of these approaches for forecasting the subsequent months in the state of São Paulo.
The data were collected from two main sources. Probable monthly dengue cases in the state of São Paulo were obtained from the Notifiable Diseases Information System (SINAN), made available through Tabnet of DataSUS, which is the official source of epidemiological data from the Ministry of Health of Brazil. The collection period for this variable covered from January 2014 to May 2025, considering the date of onset of the first symptom of each reported case.
The second data source was Google Trends, a tool from the Google search engine that quantifies the level of interest in searched keywords. The keywords selected for dengue forecasting were: “teste dengue”, “sintomas dengue”, “dengue”, “chikungunya”, “dengue plaquetas”, “tratamento dengue”, “manchas dengue”, and “febre dengue”, based on a previous analysis (Cruz & Izbicki, 2018).
Initially, a Pearson correlation analysis was performed between all explanatory variables (Google Trends data) and the response variable (probable dengue cases). A Pearson correlation coefficient r ≥ 0.9 was adopted as the selection criterion. The keywords “chikungunya” and “dengue treatment” did not meet this criterion and were therefore excluded from subsequent analyses.
For the nowcasting stage, several predictive models were applied. The first model tested was Multiple Linear Regression (MLR), using 80% of the database for training and 20% for testing, without altering the temporal order of the observations. The model was adjusted by the ordinary least squares method, according to the standard implementation of the Python scikit-learn library, considering the selected predictor variables. The Variance Inflation Factor (VIF) was calculated to assess the presence of multicollinearity among the predictors.
Next, the LASSO regression (“Least Absolute Shrinkage and Selection Operator”) was applied, also with an 80% split of the dataset for training and 20% for testing, preserving the temporal order. The penalty parameter `alpha` was optimized by grid search (GridSearchCV) with TimeSeriesSplit cross-validation (five partitions), testing 200 `alpha` values logarithmically distributed in the interval between 10^-4 and 10^2.
The Random Forest method was also employed, with the same 80% split for training and 20% for testing, maintaining the temporal order of observations. The “RandomForestRegressor” algorithm was used with 500 trees (n_estimators = 500). The number of predictors considered in each tree split was defined as the square root of the total number of explanatory variables (max_features = “sqrt”), as per James et al. (2013). A random seed was fixed (random_state = 42) and parallel processing was used (n_jobs = -1).
For the nowcast, the SARIMAX model was used, which allows the inclusion of exogenous variables, in this case, Google Trends data. The analysis was conducted in six time windows, corresponding to the periods of November and December 2022, 2023, and 2024, and January and February 2023, 2024, and 2025. In each window, the model was adjusted based on observations prior to the period of interest to estimate the subsequent two months.
The definition of the autoregressive, moving-average, differencing, and their seasonal components parameters for SARIMAX was performed using the `auto_arima` procedure. This procedure allows for the automatic selection of the model structure based on the Akaike information criterion (AIC), considering seasonal models (seasonal = True) with monthly periodicity (m = 12).
For the forecasting stage of the subsequent months, the SARIMA model was evaluated through two approaches. In the univariate approach, the SARIMA model was adjusted solely with the historical series of probable dengue cases, without the inclusion of exogenous variables. Two scenarios were considered for the years 2023, 2024, and 2025: training until December of the previous year for forecasting January and February, and training until February of the current year for forecasting March and April.
In the hybrid approach, initially, the two most recent months were nowcasted using SARIMAX with Google Trends variables. Subsequently, these nowcasted values were incorporated into the original series, forming an extended series, upon which a univariate SARIMA model was fitted to forecast the subsequent two months. The structure of the SARIMA models, both in the univariate and hybrid approaches, was automatically defined by `auto_arima`, with annual seasonality (m = 12) and AIC-based selection.
The predictive performance of all models was evaluated using the error metrics: Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), and Mean Absolute Percentage Error (MAPE). All analyses and modeling were performed using the Python programming language (version 3.12) in the Spyder development environment.
3. Results and Discussion
The analysis of the research results allowed for the evaluation of the effectiveness of different predictive models for the nowcast and the forecast of probable dengue cases in the state of São Paulo, using data from Google Trends. Initially, the capacity of linear regression models, such as Multiple Linear Regression and LASSO, and a machine learning model, Random Forests, was explored. Subsequently, time series models were applied, such as SARIMAX for nowcasting and SARIMA for forecasting, seeking to capture the temporal dynamics of the dengue case series.
Data on probable dengue cases, obtained from DataSUS, revealed a temporal evolution with a significant peak in 2024, attributed to the simultaneous circulation of the four virus serotypes, according to information from the Butantan Institute (2024). A period of minimum cases was also observed between 2017 and 2018, explained by factors such as prevention programs and natural population protection (SUDAM, 2017). Google Trends keywords, selected based on previous studies by Cruz and Izbicki (2018), showed peaks of interest aligned with the increase in cases, except for “chikungunya” and “dengue treatment”, which were excluded from subsequent analyses for not reaching a Pearson correlation coefficient of 0.9 with dengue cases.
Multiple Linear Regression
The application of Multiple Linear Regression (MLR) for the nowcast, using all selected predictor variables from Google Trends, resulted in an RMSE of 64.924, an MAE of 37.630, and a MAPE of 29.4%. The comparison between actual and predicted values indicated that the model was able to follow the general trend of the dengue cases time series. However, MLR showed a notable limitation in underestimating peaks of epidemiological relevance, especially in April 2024 and March 2025.
This underestimation of peaks is a known characteristic of linear regression models, which tend to estimate the conditional mean of the response variable, as pointed out by Marrie (2009). The ability to predict peaks is crucial for epidemiological surveillance, as it allows for early detection of outbreaks and the mobilization of resources for control and preparation of health services (Tejeda et al., 2023). The Variance Inflation Factor (VIF) analysis revealed strong multicollinearity among the explanatory variables, with all values above 5.
The variables “Dengue Symptoms” and “Dengue” showed the highest VIF values, indicating high covariance. This finding was expected, given that Google Trends searches for dengue frequently involve terms related to the disease, its symptoms, and treatments, which favors the joint variation of these keywords (Ho et al., 2018). Although OLS provided an initial basis, multicollinearity limited the individual interpretation of coefficients and compromised the stability of estimates, justifying the exploration of alternative models.
Least Absolute Shrinkage and Selection Operator (LASSO)
To address the issue of multicollinearity and improve the stability of estimates, the LASSO (Least Absolute Shrinkage and Selection Operator) model was applied. This technique, which penalizes the coefficients of predictor variables, resulted in the exclusion of the “Dengue” variable by zeroing its coefficient, while the other variables were kept with penalized coefficients. The selection of the penalty parameter (alpha) was performed through grid search with temporal cross-validation, ensuring the model’s adequacy to the series structure.
The performance of LASSO was superior to that of OLS, with an RMSE of 32.311, MAE of 19.747, and MAPE of 34.62%. Notably, LASSO demonstrated a significant improvement in estimating the peak of April 2024, a period in which OLS presented greater adjustment difficulty. This improvement suggests that the regularization promoted by LASSO contributed to increasing the model’s predictive capacity, especially during periods of greater series variation, by reducing the influence of less relevant variables and promoting feature selection (Tibshirani, 1996).
Random Forests
Next, the Random Forest method was employed for nowcasting, a technique that differs from linear models by constructing multiple decision trees. The results obtained with Random Forests were less satisfactory compared to RLM and LASSO, presenting an RMSE of 123.646, MAE of 56.446, and a MAPE of 35%. A clear tendency to underestimate the peaks of cases was observed, a limitation already described by Cruz and Izbicki (2018) for this type of approach.
The difficulty of Random Forests in extrapolating extreme or rare events, such as the peak in dengue cases observed in 2024, is consistent with the literature (Hatteffard et al., 2023). This occurs because the algorithm learns from the patterns present in the training data, making it less effective for predicting occurrences outside the spectrum of variability already observed. Although the correlation between predictor variables is not as severe a limitation as in linear models (Strobl, 2008), the overall performance indicated that this predictive approach did not ideally capture the complexity of epidemic peaks.
The analysis of the residuals from the three regression models (RLM, LASSO, and Random Forests) revealed patterns of autocorrelation and non-normality. In the linear models, heteroscedasticity was also identified, with more intense errors during peak periods. These findings indicate that, despite being useful as initial nowcasting strategies, these models are unable to fully represent the temporal dynamics of dengue cases, especially at times of greater series variation (Hyndman and Athanasopoulos, 2013). This observation directed the research towards the evaluation of time series models, which are intrinsically more suitable for capturing the serial dependence of the data.
Time series – SARIMAX for Nowcasting
For the nowcast, the SARIMAX model was used, allowing the inclusion of exogenous variables from Google Trends. The decomposition of the dengue cases time series, which revealed a trend of sharp growth from 2021 onwards and a seasonal behavior compatible with peaks in hot and rainy months (Ministry of Health, 2025), indicated the need for differencing due to the non-stationarity of the series, confirmed by the augmented Dickey-Fuller test with a p-value of 0.21.
The structure of the SARIMAX model, including the autoregressive, moving average, and differencing parameters, as well as its seasonal components, was automatically defined by the auto_arima procedure, considering a monthly periodicity (m = 12). The model was evaluated across six time windows, simulating the delay in data consolidation by estimating the subsequent two months based on previous observations. The SARIMAX results were satisfactory in several windows, particularly for the nowcasts of January and February, and November and December 2024.
Even in windows with the highest MAPE, such as November and December of 2022 and 2023, the RMSE and MAE values remained relatively low in absolute terms. This behavior can be attributed to the fact that MAPE tends to increase during periods of low case occurrence. Considering the set of six evaluated windows, the overall performance of SARIMAX was RMSE = 19.106, MAE = 12.507, and MAPE = 38.5%, indicating a robust nowcasting capability, especially when incorporating the autocorrelation and seasonality of the time series, as well as the influence of exogenous variables.
Selection of the ideal model for Nowcast
For the selection of the most effective model for the nowcast, a final comparison was made between LASSO and SARIMAX, the two best-performing approaches. LASSO was evaluated on the same six time windows as SARIMAX, maintaining the methodological parameters. The comparison of error metrics revealed that, although the MAPE values were close between the two models, SARIMAX presented substantially lower RMSE and MAE values.
Specifically, SARIMAX achieved an RMSE of 19.106 and MAE of 12.507, while LASSO registered an RMSE of 37.968 and MAE of 19.488, both with a MAPE of approximately 38%. This difference in absolute and quadratic error metrics indicated that SARIMAX demonstrated superior overall performance in performing the nowcast. SARIMAX’s superiority is consistent with the literature, as it combines the influence of predictor variables with the ability to model the autocorrelation and seasonality of the time series, characteristics that LASSO, focused on predictor penalization, does not directly address (Hyndman and Athanasopoulos, 2013).
Time Series – Forecasting
Understanding that epidemiological analysis requires not only the nowcast but also the forecast of case evolution (Tejeda et al., 2023), the study evaluated the forecasting potential for subsequent months using the SARIMA model. Two approaches were employed: a univariate one, based solely on the historical series of cases, and a hybrid one, which incorporated the nowcasted values from SARIMAX before forecasting. The structure of the SARIMA models was automatically defined by auto_arima, with annual seasonality (m = 12) and AIC-based selection.
In the univariate approach, SARIMA showed heterogeneous performance among the evaluated windows. The forecasts were more satisfactory in 2025, but in 2023 and 2024, a relevant underestimation of cases was observed, especially during periods of sharper growth in the series. The general metrics obtained for univariate forecasting were RMSE = 107.797, MAE = 67.200, and MAPE = 38.5%, indicating a limited capacity to adequately predict subsequent months, especially when facing abrupt changes or epidemic peaks of greater magnitude, as the projection is based on previously observed historical patterns (Hyndman and Athanasopoulos, 2013).
The hybrid approach, which initially performed the nowcast of the two most recent months with SARIMAX and then incorporated these values into the series to adjust a univariate SARIMA for forecasting, also did not perform well. The forecasts were far from the observed values, with high errors in the different windows analyzed. This indicates that the use of previously estimated months, instead of consolidated data, introduces additional uncertainty in the forecasting step, accumulating errors throughout the process.
Thus, the combination between nowcast and SARIMA forecasting did not prove adequate to accurately represent the evolution of cases in the subsequent months. The results suggest that, although Google Trends is a promising source for nowcasting, short-term dengue forecasting still demands additional information and more sophisticated models to represent abrupt oscillations and larger magnitude outbreaks. The predictive capacity of time series models is reduced when confronted with extreme events that are not well represented in the training data, a common challenge in series with high variability.
In summary, Google Trends data demonstrated predictive utility for the nowcasting of probable dengue cases, with the SARIMAX model standing out as the most effective due to its ability to incorporate both exogenous variables and the temporal and seasonal structure of the series. However, for forecasting subsequent months, the evaluated models presented significant limitations, especially in anticipating epidemic peaks and in scenarios of abrupt growth, suggesting that the contribution of Google Trends is more robust for estimating the immediate present than for future projections.
4. Conclusion
The present study sought to identify the most effective model for the nowcast of probable dengue cases using Google Trends data and, additionally, to evaluate the potential of these approaches for forecasting subsequent months. It was found that Google Trends data showed predictive utility for estimating recent dengue cases. In the nowcasting stage, the performance of multiple linear regression, LASSO, Random Forests, and SARIMAX models was compared. It was observed that, among the evaluated approaches, the SARIMAX model demonstrated the most robust performance, with an RMSE of 19.106, MAE of 12.507, and MAPE of 38.5%. Its superiority lies in its ability to incorporate both the influence of exogenous variables from Google Trends and the autocorrelation and seasonality structure of the dengue case time series. LASSO also presented satisfactory results, with an RMSE of 37.968, MAE of 19.488, and MAPE of 38.3%, standing out for its variable selection, but with absolute and quadratic error metrics superior to SARIMAX. In contrast, Multiple Linear Regression and Random Forests showed significant limitations, especially in underestimating epidemic peaks, indicating that they did not fully capture the temporal dynamics of the cases.
Regarding the forecast for the subsequent months, the results were less satisfactory. The univariate approach with SARIMA showed limited performance, with general metrics of RMSE of 107.797, MAE of 67.200, and MAPE of 38.5%, and a tendency to underestimate cases during periods of sharp growth. The hybrid strategy, which incorporated nowcasted values before forecasting, also proved inadequate, as the uncertainty from the nowcasting step impacted the final forecast, accumulating errors. This suggests that, although Google Trends is a relevant complementary source for timely dengue monitoring, its contribution is more robust for nowcasting than for short-term disease forecasting, which still requires additional information and more sophisticated models to represent abrupt oscillations and larger magnitude outbreaks. For future studies, it is recommended to incorporate additional variables, such as climatic and environmental factors, evaluate weekly time series for greater sensitivity to rapid changes, and apply count models, such as Poisson and Negative Binomial, for dependent variables of a discrete nature. Additionally, it is suggested to compare the predictive models with a “naive” model to assess the incremental contribution of online searches.
Bibliographic References
Bastos, L.S.; Economou,T.; Gomes M.F.C.; Villela, D.A.M.; Coelho, F.C.; Cruz, O.G.; Stoner, O.; Bailey, T.; Codeço, C.T. 2019. A modelling approach for correcting reporting delays in disease surveillance data. Statiscs in Medicine 38(22): 4363-4377.
Cruz, L.O.; Izbicki, R. 2018. Monitoramento online da dengue: usando o Google Trends para predizer epidemias. Brazilian Journal of Biometrics, 36(3), 512-526.
Furletti, L.A.; Carvalho, I.L.; Silva, H.B.; Peixoto, L.C. 2022. Aplicação de regressão linear múltipla para analisar a relação entre buscas por palavras-chave na internet e casos de Covid-19 no Brasil. Exacta, 21(4), 892-904.
Ho, H.T.; Carvajal, T.M.; Bautista, J.R.; Capistrano, J.D.R.; Viacrusis, K.M.; Hernandez, L.F.T.; Watanabe, K. 2018. Using Google Trends to Examine the Spatio-Temporal Incidence and Behavioral Patterns of Dengue Disease: A Case Study in Metropolitan Manila, Philippines. Tropical Medicine and Infectious Disease 3(14), 118.
Instituto Butantan. 2024. Por que os casos de dengue aumentaram no Brasil? Circulação dos quatro vírus e mudanças climáticas ajudam a explicar crescimento. Disponível em: <https://butantan.gov.br/noticias/por-que-os-casos-de-dengue-aumentaram-no-brasil-circulacao-dos-quatro-virus-e-mudancas-climaticas-ajudam-a-explicar-crescimento>. Acesso em: 20 mar. 2025. Neglected Tropical Diseases.
James, G.; Witten, D.; Hastie, T.; Tibshirani, R. 2013. An introduction to statistical learning with applications in R. Nova York, Nova York, Estados Unidos da América.
Marques-Toledo, C.A.; Degener, C.M.; Vinhal, L.; Coelho, G.; Meira, W.; Codeço, С.Т.; Teixeira, M.M. 2017. Dengue prediction by the web: Tweets are a useful tool for estimating and forecasting Dengue at country and city level. PLOS Neglected Tropical Diseases, 11(7).
Marrie, R.A.; Dawson, N.V.; Garland, A. 2009. Quantile regression and restricted cubic splines are useful for exploring relationships between continuous variables. Journal of Clinical Epidemiology 62(5), 511-517.
Orellano, P.W.; Reynoso, J.I.; Antman, J.; Argibay, O. 2015. Uso de la herramienta Google Trends para estimar la incidencia de enfermedades tipo influenza en Argentina. Cad. Saúde Pública, Rio de Janeiro 31 (4), 691-700.
Penteado, E.M. (2023). Nowcast de Desemprego usando Google Trends, uma revisão da temática pós-pandemia. Monografia de Final do Curso de Economia. Pontifícia Universidade Católica do Rio de Janeiro (PUC-RJ), Rio de Janeiro, Rio de Janeiro, Brasil.
Salles, T.S.; da Encarnação Sá-Guimarães, T.; de Alvarenga, E.S.L.; Guimarães-Ribeiro, V.; de Meneses, M.D.F.; de Castro-Salles, P.F.; Dos Santos, C.R.; do Amaral Melo, A.C.; Soares, M.R.; Ferreira, D.F.; Moreira, M.F. 2018. History, epidemiology and diagnostics of dengue in the American and Brazilian contexts: a review. Parasit Vectors 11(1):264.
Sistema de Informação de Agravos e Notificação [SINAN]. 2025. Doenças e Agravos de Notificação – 2007 em diante (SINAN). Disponível em: <https://datasus.saude.gov.br/acesso-a-informacao/doencas-e-agravos-de-notificacao-de-2007-em-diante-sinan/>. Acesso em: 05 set. 2025.
Statista. 2025. Distribution of X (formerly Twitter) users worldwide as of February 2025, by age group. Disponível em: < https://www.statista.com/statistics/283119/age-distribution-of-global-twitter-users/>. Acesso em: 02 abr. 2026.
Superintendência do Desenvolvimento da Amazonia [SUDAM]. 2017. Casos de dengue no Brasil caem 90% em 2017. Disponível em <http://antigo.sudam.gov.br/index.php/o-que-e-rss/17-ultimas-noticias/1079-casos-de-dengue-no-brasil-caem-90-em-2017#:~:text=A%20redu%C3%A7%C3%A3o%20foi%20de%2096,2016%20para%2017%20em%202017>. Acesso em: 10, junho, 2025.
Tejeda, G. S.; Valladares, D.B.; Morales, F.C.; Cisneros, J.T.; Tamarindo, B. E. E.; Laith, H.; Kroeger, A. 2023. Early warning and response system for dengue outbreaks: Moving from research to operational implementation in Mexico. PLOS Global Public Health 3(9), e0001691.
Tibshirani, R. 1996. Regression Shrinkage and Selection Via the Lasso. Journal of the Royal
Article originating from the Final Course Project of the Specialization in Data Science and Analytics of the MBA USP/Esalq
To learn more about the course, click here and access the MBX Academy platform