Skip to content

High-accuracy weekly temperature forecasting using Unobserved Components Model (UCM). Noise minimized via weekly aggregation. Captures level, trend, seasonality, and cycles. Achieved MAE: 1.29 °C, RMSE: 2.66 °C. Data: Open-Meteo (CC BY 4.0).

Notifications You must be signed in to change notification settings

silenceforest/NoiseReduced-WeatherModeling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather Forecasting with Unobserved Components Model (UCM)

Excellent forecasting performance was achieved:

  • MAE (°C): 1.29
  • RMSE (°C): 2.66

This excellent performance is primarily attributed to the careful preprocessing of the data, particularly the weekly grouping. Aggregating high-frequency weather data into weekly averages significantly minimized the influence of short-term noise and irregularities, thereby enabling the Unobserved Components Model (UCM) to more accurately capture the underlying trend, seasonal, and cyclic patterns.


Visualizations

Below are the key outputs of the modeling process. All visualizations are based on smoothed states extracted from the fitted Unobserved Components Model (UCM).


📈 Forecast: 52-Week Temperature Prediction

Forecast
Forecasted weekly mean temperatures with 95% confidence interval. The blue line represents the predicted values; the shaded area denotes the uncertainty range. Historical data (train/test) is shown for reference.


📉 Level Component

Level
The estimated level (baseline) of the temperature series, evolving over time. Captures long-term shifts independent of seasonality or cycles.


🔄 Seasonal Component

Seasonal
The estimated seasonal pattern with a period of 52 weeks, reflecting recurring annual dynamics. The stochastic nature allows it to adapt to small inter-annual shifts.


📊 Trend Component

Trend
A dynamic trend component showing the evolution of the rate of change in the temperature level. Useful for identifying periods of acceleration or stabilization in temperature trends.

Methodology Overview

The analysis applies a structural time series modeling approach using the Unobserved Components Model (UCM) to forecast weekly aggregated temperatures. Key methodological steps include:

  • Weekly Aggregation:
    Aggregating the data on a weekly basis effectively reduces high-frequency noise, allowing the model to focus on more stable and interpretable long-term patterns. This step was instrumental in achieving the reported high performance (MAE: 1.29 °C, RMSE: 2.66 °C).

  • Model Configuration:
    The UCM is parameterized with:

    • A local linear trend to capture both the level and the rate of change.
    • A seasonal component with a period of 52 weeks, reflecting the annual cycle present in the data.
    • Stochastic seasonal and stochastic cyclic components that allow these effects to vary over time, thereby increasing the model's flexibility and adaptability to real-world data.
  • Forecasting and Evaluation:
    A 52-week forecast is produced and evaluated using standard error metrics, providing a robust assessment of model performance.


Data Source and License

The temperature data is sourced from Open-Meteo, which offers free access to weather forecast information.
License: The data is distributed under the Creative Commons Attribution 4.0 International License (CC BY 4.0). For more details on the licensing terms, please refer to Open-Meteo's license page.


Usage Instructions

  1. Clone the Repository:

    git clone https://github.com/yourusername/WeatherForecasting_UCM.git
    cd WeatherForecasting_UCM

  2. Launch the Jupyter Notebook:

    Open the WeatherForecasting_UCM.ipynb notebook using Jupyter Notebook or JupyterLab.

  3. Run the Notebook Cells Sequentially:

    Execute the cells in order to:

    • Load and preprocess the temperature data.
    • Aggregate the data to weekly averages.
    • Fit the UCM and generate a 52-week forecast.
    • Evaluate the forecasting performance.
    • Extract and visualize key model components.
  4. Review the Visualizations:

    Interactive visualizations are generated within the notebook, and static representations are available as image files: Forecast.png, Level.png, Seasonal.png, and Trend.png.


License

This repository is distributed under the MIT License.


For questions, suggestions, or contributions, please open an issue or submit a pull request.

About

High-accuracy weekly temperature forecasting using Unobserved Components Model (UCM). Noise minimized via weekly aggregation. Captures level, trend, seasonality, and cycles. Achieved MAE: 1.29 °C, RMSE: 2.66 °C. Data: Open-Meteo (CC BY 4.0).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published