Understanding Brunei’s Climate Through Air Temperature Data (Ongoing Project)

Author

Alvin Bong

1 Introduction & Literature Review

Climate change has been prevalent worldwide, causing adverse effects felt by all. Given temperature being one of the most important indicators of climate change, it would be interesting to explore:

  • How does Brunei’s temperature varies by month & how it evolved over time?

  • Is there any periodicities & are they consistent with global temperature trends/ENSO?

  • Different forecast models for to predict temperature trends

2 Data Collection and Wrangling

The temperature dataset is sourced from NASA POWER API using {nasapower} package in R, covering years 1981 to 2023, corresponding to the location (115,5) (Sparks 2018). Nino 3.4 index for Section 5.2 is obtained from NOAA website (Rayner et al. 2003). To wrangle data for suitable analysis:

  • anomaly obtained by subtracting temperature of each month from the monthly mean

  • detrend obtained by residues of linear regression across the anomalies.

Code
# add anomalies
monthly_means <- df %>% 
  group_by(MONTH) %>% 
  summarise(T2M_mean = mean(T2M))

df <- df %>%
  left_join(monthly_means, by = "MONTH") %>%
  mutate(anomaly = T2M - T2M_mean) %>% 
  arrange(DATE)

# detrend
time <- 1:length(df$anomaly)
fit <- lm(df$anomaly ~ time) 
anomalies_detrended <- residuals(fit)

2.1 Variable of interest

NASA provides two temperature-related variables: T2M (temperature at 2 meters) and TS (surface temperature). A comparison shows that both are highly correlated (\(\rho=0.96\)), making one sufficient for analysis. Since T2M better represents the temperature experienced by a person, this project uses T2M. However, using TS would likely yield similar results.

3 EDA

3.1 Monthly Distribution

From Figure 1, we see that temperature are highest from April to September, with a peak in May, indicating the warmest part of the year. A general cooling trend is observed in the last quarter of the year, with an abrupt temperature drop from December to January. This marks the transition into the coolest part of the year, spanning January to March. During this three months, the average temperature drops below 27°C.

Another significant observation is that the Range and Interquartile Range (IQR) seems widest in November and January, suggesting higher variability and less consistent temperatures during these months. This could indicate transitional weather patterns.

Figure 1

3.2 Yearly & Monthly Trend

Although air temperature appears relatively stable in Figure 2, with quite consistent seasonal cycles, Figure 3 reveals a gradual upward trend. Prior to 1990, temperatures hovered around or below 27°C, but in recent years have exceeded 27.5°C. While this may seem negligible, it amounts to approximately 0.9°C over a 50-year period (assuming the current rate of change holds). This is supported by a linear regression model, which yields a small p-value of \(3.64 \times 10^{-10} < 0.01\) and a Pearson correlation coefficient of (\(\rho=0.79\)), indicating a moderate to strong positive trend over time and supporting the alternative hypothesis of increasing temperature.

While linear regression may not be the most accurate model for capturing long-term trends due to autocorrelated residuals (temperature of consecutive months may be related), violating the independence assumption, it still offers valuable insight into the general general direction of temperature changes over time.

Additionally, from Figure 2 and Figure 3, we observe temperature peaks in 1998, 2016, 2019 and 2023. Notably, the annual plot (Figure 3) appears to have fewer peaks compared to the monthly plot (Figure 2), likely due to monthly autocorrelation smoothing out short-term extremes into broader yearly trends. Nevertheless, the present of temperature peaks raises some important questions: What are the periodicities (cycle lengths) of Brunei’s air temperature anomalies? Do the anomalies align with the El Niño-Southern Oscillation (ENSO) cycle?

Figure 2: Monthly T2M (1981-2023)
Figure 3: Annual Mean T2M (1981-2023)

4 Methods

5 Results

5.1 Spectrum Analysis

Spectral analysis of the deseasonalized, detrended temperature anomalies (Figure 4), revealed periodicities at approximately 18, 29, 37, 65, and 86 months, with the dominant cycle at 43 months (\(\approx\) 3.6 years). This 43-months cycle falls within the typical ENSO range of 2–7 years, suggesting a potential alignment with the ENSO cycle. The presence of multiple peaks indicates that ENSO-driven cycles are not uniform but exhibit variability within this range, likely reflecting the irregular timing and intensity of ENSO events. To further validate this relationship, Section 5.2 explore linear regression and cross-correlation analyses.

Figure 4: Spectral Analysis of Detrend Temperature Anomalies

5.2 Anomalies vs ENSO

The trends depicted in Figure 6 suggest a similarity between temperature anomalies and the Nino 3.4 index, though the Nino index is more extreme in the peaks and troughs. However, the linear regression in Figure 5 reveals a weak correlation (\(\rho=0.36\)). This low correlation is likely attributable to a time lag between the two variables, a common phenomenon in climate data.

Cross-correlation analysis (Figure 7) reveals a significant correlation peak within the 95% confidence interval, ranging from approximately -0.3 to 0.7 months. This suggests a close alignment between temperature anomalies and the ENSO (El Niño-Southern Oscillation) index, with a slight time lag where either the Nino 3.4 index or the temperature anomaly may occasionally lead.

Additionally, the strongest correlation at a lag of approximately 0.4 months, indicates a relatively robust positive relationship when the two series are appropriately aligned. This correlation accounts for up to approximately 25% of the variance (r² = 0.5²) at lag 0.3 months, doubling the 12.5% (r² = 0.36²) explained by the zero-lag linear regression.

Figure 5: Scatter plot (Temperature Anomaly vs Nino 3.4 Index)
Figure 6: Time Series of Nino 3.4 Index & Temperature Anomaly
Figure 7: Cross-correlation function (ccf) of anomaly against Nino 3.4 Index

5.3 Forecast Models

From Table 1, linear regression exhibits the lowest MAE (0.253°C), RMSE (0.308°C), and MAPE (0.915%), achieving the highest accuracy of 99.1%. The remaining models (ARIMA, Random Forest and Gaussian Process) have a similar MAPE values around 1.2%, with MAE differences of about 0.07°C compared to linear regression. These findings suggest that while linear regression performs best, the models are fairly similar in overall performance. Despite the high accuracy and low errors, individual errors can vary more significantly, as seen in Figure 8). Particularly, during months with peak temperatures, the models often underestimate, with the maximum underestimation reaching up to 1 degree Celsius.

Using the linear regression model, which performed best, to estimate average monthly temperature for 2024, 2025, and 2026 (Figure 9), it can be observed that temperatures peak in May, reaching over 28 degrees Celsius, and drop to below 27 degrees Celsius in January and February. This pattern is consistent with the monthly temperature distribution in BSB, Brunei (Figure 1).

Figure 8: Forecast Models Comparison: ARIMA, Linear Regression, Random Forest, Gaussian Process
Figure 9: Forecast using linear model for year 2024, 2025 & 2026.
Table 1: Forecast Metrics of various Models.
Metric ARIMA Linear Regression Random Forest Gaussian Process
Mean Absolute Error (MAE) 0.320 0.253 0.312 0.328
Root Mean Square Error (RMSE) 0.412 0.308 0.396 0.419
Mean Absolute Percentage Error (MAPE) 0.012 0.009 0.011 0.012
Accuracy (1 - MAPE) 0.988 0.991 0.989 0.988

6 Conclusions

This project can be summarised in three main points:

  • Temperature is gradually increasing in Brunei.

  • Brunei is not immune to El Niño effects. Extreme heat in 1998 & 2023 (aligning with global anomalies)

  • May is the hottest month in Brunei.

Limitations:

  • T2M is a secondary

7 Acknowledgements

The author expresses gratitude to NASA for the data used in the project. These data were obtained from the NASA Langley Research Center (LaRC) POWER Project funded through the NASA Earth Science/Applied Science Program.

References

Rayner, Na A, De E Parker, EB Horton, Chris K Folland, Lisa V Alexander, DP Rowell, Elizabeth C Kent, and A Kaplan. 2003. “Global Analyses of Sea Surface Temperature, Sea Ice, and Night Marine Air Temperature Since the Late Nineteenth Century.” Journal of Geophysical Research: Atmospheres 108 (D14).
Sparks, Adam H. 2018. “Nasapower: A NASA POWER Global Meteorology, Surface Solar Energy and Climatology Data Client for r.” The Journal of Open Source Software 3 (30): 1035. https://doi.org/10.21105/joss.01035.