Bayesian optimisation of prophet temperature model with daily and yearly seasonalities plus extra regressors
If you like BayesianProphet, give it a star, or fork it and contribute!
Prophet decomposition showing trend plus yearly and daily seasonality in Cambridge UK temperature observations:
Required:
- Recent version of python
- Prophet package
- BayesianOptimization package
- pandas package
- Jupyter
To install the python packages:
pip install -r requirements.txt
After the above dependencies have been installed either,
- clone the repository and open the notebook(s) in a local installation of Jupyter, or
- try notebook(s) remotely
See my time series and other models for Cambridge UK temperature forecasts in R repository for a detailed explanation of the data (including cleaning), baseline models, daily and yearly seasonality descriptions plus R prophet model. Assumptions and limitations are covered in the above repository and will not be repeated here. Additional exploratory data analysis is available in my Cambridge University Computer Laboratory Weather Station R Shiny repository.
My primary interest is in "now-casting" or forecasts within the next 1 to 2 hours. This is because I live close to the data source and the UK met office only update their public facing forecasts every 2 hours.
The python prophet implementation has a few advantages over the R implementation. I'm interested in forcing trend growth to be flat. The already mentioned R prophet model has strong seasonality and using zero changepoints usually results in either slightly increasing or decreasing trend.
I use over 10 years of training data (mid-2008 to 2018 inclusive) and select test and validation data from 2019. Compute time is acceptable when using zero changepoints, so I use simple grid search for discrete parameters such as seasonality modes and separately regressor modes.
The parameter space of each prior scale runs over at least 4 orders of magnitude. Grid search is no longer an option. Especially with 4 (2 seasonalities and 2 regressors) or more prior scales to tune.
Bayesian optimisation of prior scale parameters should give similar results to random search in less time.
- Update data to include 2020
- Add standard deviations to MSE, MAE and MAPE values
- Examine Global Forecast System (GFS) weather model
- runs four times a day, produces forecasts up to 16 days in advance
- data is available for free in the public domain
- model serves as the basis for the forecasts of numerous services
- potentially use as additional exogeneous variables
- Expand documentation:
- Include highlights from notebook(s)
- Summarise the best prophet model including parameters and cross-validation results
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Terrence Neumann has written Bayesian Hyperparameter Optimization for Time Series which covers Bayesian optimisation of prophet models in R.
A Python implementation of global optimization with gaussian processes
Time series and other models for Cambridge UK temperature forecasts in R
Cambridge University Computer Laboratory Weather Station R Shiny Web App
Time series and other models for Cambridge UK temperature forecasts in python