logo

🌸 Introduction

Hello and welcome to my first ever website designed by myself. This website will present my analysis of London’s monthly average temperature trends using time series forecast. The data used in this analysis came from Meteostat website and I used Meta’s Prophet model on RStudio as a forecasting tool. Through this website, you’ll explore the step-by-step process of this forecast.

🌸 Objective

As I have been living in London for the past few years, I noticed that the temperature changes every month. I want to find which month does the temperature drop or rise significantly indicating a change of season. This project aims to:

  • Identify seasonal patterns and temperature trends over time
  • Develop a forecasting model to predict future temperature
  • Visualize potential climate trends in London

🌸 Part 1: Data Preparation

In this part, I will go through a walk through of how I prepared my data for this analysis

1.1 Understanding the Dataset

First, I searched for data on temperature of London which I obtained from Meteostat. The data was originally in form of daily temperature records for london where each entry included:

  • Date(Daily)
  • Average Temperature(in Celcius)

As monthly data will provide a better view for long term trends, I transformed the dataset in Excel from daily data to monthly data.

1.2 Data Preparation Process

As the data comes in daily figures, I used Excel to group the daily data by month and calculated its average. I then formatted the column to match with prophet’s requirement on R by using the code: monthly_london<-monthly_london%>%rename(ds=month,y=`average monthly temperature`)%>%mutate(ds=as.yearmon(ds))

The final dataset included are:

  • ds: month
  • y: average temperature for that month

🌸 Part 2: Forecasting Model

2.1 Introduction to Prophet

Prophet is an advanced forecasting procedure implemented in R and Phyton and is used to forecast time series data.Prophet is ideal for this analysis due to its:

  • Detection of seasonality automatically
  • Handling of missing datas effectively
  • User-friendliness and simpleness

2.2 Modelling the forecast

These are the steps in building my Prophet model

  1. Preparing the dataset according to Prophet’s structural requirements by having ds and y as the variables (explained in 1.2)
  1. Generating forecast for future trend using the code m=prophet::prophet(monthly_london) f=prophet::make_future_dataframe(m,periods=12, freq = "m")
  • periods = 12,36 (forecasting for the next 12 and 36 months)
  • “m” in freq = "m" indicates months
    forecast<-predict(m,f)
  1. Uses yearly seasonalities in detecting London’s seasonal temperature pattern
  • Prophet by default will fit weekly and yearly seasonalities
  • Since dataset is structured with monthly data, Prophet automatically uses yearly seasonality without having to add the code yearly.seasonality = TRUE
  1. Plotting graphs to visualise the results using the code plot(m,forecast)

🌸 Part 3: Results

There are 2 forecasts that has been done which are future projections for the next 12 and 36 months.

3.1 Forecast for 12 months

This graph extends to early 2026 which covers 12 months ahead from the available data. The model effectively projected clear seasonal pattern of increasing and decreasing temperature as seen from previous years.It projected highest peak at around halfway through the year and lowest temperature towards the end of the year.The shaded area is the uncertainty band and it is narrow. This reflects that the model is relatively confident in the projection for the short term time.

3.2 Forecast for 36 months

This graph extends all the way to early 2028, 3 years past the available data. It can be seen that the model shows similar trend throughout the year with highest peaks in the middle of the year and lowest being towards the end of the year. However, the uncertainty band is noticeably wider in later periods indicating lower confidence in the projections for long term forecast. Thus, the graph should be interpreted with caution as it may lack precision in certain aspects.

3.3 Forecasted graph with plotted values

The graph visualizes both, the actual data from the dataset and the projected data for the next 36 months using the Prophet model. The green dots represent actual data and pink dot represents forecasted values. The grey shaded area around the lines indicates uncertainty intervals. This interactive graph feature will allow you to go through each points at a specific time for a detailed insights.

🌸 Part 4: Conclusion

This analysis has successfully portray London’s seasonal changes throughout the year by forecasting future London’s monthly average temperature. The combination of using Excel and Prophet on R has effectively modelled it in a good way which highlighted both seasonal trends throughout the past years and future predictions for upcoming years. We can see clear and consistent pattern of warming trend in summer months and cooling trend during winter months. However, there are some improvements that can be done in the future to make the analysis more accurate such as: - Incorporating humidity, rainfall and wind - Exploring extreme weather events and adding it as a changepoint - Expanding dataset for more accurate longer term forecast