Examples
Each example below is a self-contained, end-to-end analysis — the code, the inferred parameters and the resulting figures, with commentary that walks through how the model is built and what it reveals. The first two use illustrative datasets as a gentle introduction; the rest apply bayesloop to real, openly-available data from a range of scientific fields — epidemiology, seismology, climatology, macroeconomics, sports, solar physics, neuroscience, finance, energy and movement ecology — with several comparing it head-to-head against the standard model in their field.
As with the tutorials, the code cells of each example can be run directly in the browser. Selecting the run button on a cell starts a Python session, and the code may then be modified and executed again. Two of the examples depend on compiled packages that the in-browser Python cannot load, and note this at the top.
- Anomalous diffusion
- Stock market fluctuations
- Measles in the United States: abrupt break or gradual decline
- The rate of great earthquakes over time
- Atlantic hurricanes: a shift in activity in the 1990s
- The Great Moderation: dating a fall in US growth volatility
- A century of baseball: dating the home-run regime shifts
- Sunspots: the 20th-century “Grand Maximum”
- Real-time seizure detection from EEG
- Online COVID-19 forecasting with a time-varying growth rate
- Real-time S&P 500 volatility: bayesloop versus GARCH
- Weather-adjusted electricity demand and the COVID shock
- Animal movement: a continuum the HMM cannot represent