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

Author

Alvin Bong

To do:

✅ Correlation analysis with Nino. index

✅ Check if there is any raw data. Add information on data and location of data.

✅ Extreme events: Try plotting anomalies (to determine periodicity, spectrum analysis)

✅ Feel lack rigor/indepth analysis, mostly EDA for now, consult Dr. Haziq for advice.
Advice: Since interdiscipline field, need to consult geography background experts, to check if I am asking the right questions.
✅ Discussed with senior Amir , gained ideas on project outline (similar to his ongoing project on rainfall analysis.)

1 Research Question

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 temperature varies by month?

  • How has Brunei’s temperature evolved over time?

  • Any periodicities? Are they consistent with global temperature trends/ENSO?

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 4.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)

Call:
lm(formula = T2M ~ YEAR, data = df %>% select(YEAR, T2M) %>% 
    group_by(YEAR) %>% summarize(T2M = mean(T2M)))

Residuals:
     Min       1Q   Median       3Q      Max 
-0.47319 -0.14064 -0.00593  0.11482  0.48698 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept) -8.987713   4.420146  -2.033   0.0485 *  
YEAR         0.018083   0.002208   8.190 3.64e-10 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.1797 on 41 degrees of freedom
Multiple R-squared:  0.6207,    Adjusted R-squared:  0.6114 
F-statistic: 67.08 on 1 and 41 DF,  p-value: 3.635e-10

4 Findings

4.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. This 43-month (\(\approx\) 3.6 years) 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 in Brunei’s temperature data are not uniform but vary within the 2–7 year range, reflecting the irregular timing of ENSO events. To further verify this alignment with ENSO, we explore linear regression and cross-correlation methods in the next section.

Figure 4: Spectral Analysis of Detrend Temperature Anomalies

4.2 Anomalies vs ENSO

Although Figure 5 shows similar trends between the temperature anomaly and the Nino 3.4 index, the linear regression in Figure 6 reveals a weak correlation (\(\rho=0.36\)). However, this low correlation is likely due to a time delay between the two variables, commonly referred to as a lag. Using cross-correlation analysis (Figure 7), we observe a significant correlation peak (95% confidence interval) spanning from approximately lag -0.3 to 0.7 months, indicating that while temperature anomalies and ENSO are closely aligned, there may be a slight time lag, with either the Nino 3.4 index or the temperature anomaly occasionally leading the other.

Additionally, the strongest correlation occurs at approximately 0.5, indicating a relatively stronger positive relationship when the two series are aligned in time. The correlation explains up to approximately 25% of the variance (r² = 0.5²) at lag 0.3, double the 12.5% explained by the zero-lag linear regression. This is a notable finding in climate studies, where temperature is influenced by multiple interacting factors.

Figure 5: Time Series of Nino 3.4 Index & Temperature Anomaly
Figure 6: Scatter plot (Temperature Anomaly vs Nino 3.4 Index)

Call:
lm(formula = df$anomaly ~ df$nino3.4)

Residuals:
    Min      1Q  Median      3Q     Max 
-1.3068 -0.2670  0.0105  0.2578  1.4041 

Coefficients:
             Estimate Std. Error t value Pr(>|t|)    
(Intercept) -0.002107   0.016995  -0.124    0.901    
df$nino3.4   0.167287   0.019210   8.709   <2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.386 on 514 degrees of freedom
Multiple R-squared:  0.1286,    Adjusted R-squared:  0.1269 
F-statistic: 75.84 on 1 and 514 DF,  p-value: < 2.2e-16
Figure 7: Cross-correlation function (ccf) of anomaly against Nino 3.4 Index

4.3 Forecast Models

5 Conclusion

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.

6 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.