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.
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:
In this part, I will go through a walk through of how I prepared my data for this analysis
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:
As monthly data will provide a better view for long term trends, I transformed the dataset in Excel from daily data to monthly data.
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:
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:
These are the steps in building my Prophet model
- Preparing the dataset according to Prophet’s structural requirements by having
dsandyas the variables (explained in 1.2)
- 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)
- 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
- Plotting graphs to visualise the results using the code
plot(m,forecast)
There are 2 forecasts that has been done which are future projections for the next 12 and 36 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.
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.
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.
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