The Performance problem of tbats is resolved.
The code will be pushed by end of the week.
Update:
We have moved Plots.jl to package extension Thanks to @nilshg suggestion, such inputs are very valuable to us, please test the package and give us feedback.
I removed Plots from direct dependencies, add as weak dependency which reduces package load time for users who don’t need plotting.
At the moment Durbyn.jl has only 3 external dependencies: Distributions.jl, Polynomials.jl, Tables.jl all very established packages. Only Distributions.jl is heavy, which pulls in several dependencies.
TBATS now has grammar interface:
using Durbyn
using Durbyn.ModelSpecs
# Create sample data
data = (sales = randn(120) .+ 15,)
# Basic TBATS with defaults
spec = TbatsSpec(@formula(sales = tbats()))
fitted = fit(spec, data)
fc = forecast(fitted, h = 12)
# TBATS with monthly seasonality
spec = TbatsSpec(@formula(sales = tbats(seasonal_periods=12)))
fitted = fit(spec, data)
fc = forecast(fitted, h = 12)
# TBATS with multiple seasonal periods (e.g., hourly data with daily and weekly)
spec = TbatsSpec(@formula(sales = tbats(seasonal_periods=[24, 168])))
fitted = fit(spec, data)
fc = forecast(fitted, h = 12)
# TBATS with specific component selection
spec = TbatsSpec(@formula(sales = tbats(
seasonal_periods=12,
use_box_cox=true,
use_trend=true,
use_damped_trend=false,
use_arma_errors=true
)))
fitted = fit(spec, data)
fc = forecast(fitted, h = 12)
# Additional options at fit time
fitted = fit(spec, data, bc_lower=0.0, bc_upper=1.5, biasadj=true)
We just shipped the Theta and auto Theta forecasting models in Durbyn.jl
What’s inside:
- Full suite of Theta variants (STM, OTM, DSTM, DOTM)
- Automatic model selection + seasonal adjustment
- Forecasts with prediction intervals in pure Julia
Hi everyone,
I’m sharing a set of open-source workshop materials for learning time series forecasting in Julia using Durbyn.jl.
The course is organised into five Jupyter notebooks covering:
- Julia fundamentals – types, functions, multiple dispatch, packages
- Data wrangling – select, query, mutate, groupby, joins, PanelData
- Statistical analysis – ACF/PACF, Box-Cox, STL decomposition, unit root tests, differencing
- Forecasting – Naive, ETS, ARIMA, BATS/TBATS, Theta, ARAR, Croston (intermittent demand)
- Case study – End-to-end workflow on the M3 Competition dataset (3,003 series)
No prior Julia experience is required, the first notebook covers all the essentials.
The materials are licensed under CC BY 4.0, so feel free to use and adapt them. Feedback and contributions are welcome!
I’ve submitted Durbyn.jl, to the General registry. It is currently in the mandatory waiting period and should be available via Pkg.add("Durbyn") once merged.
Kolmogorov-Wiener Optimal Filters — coming in the next release
The next version of Durbyn.jl will include Kolmogorov-Wiener optimal finite-sample filters, based on Schleicher (2002), “Kolmogorov-Wiener Filters for Finite Time-Series”.
The core problem: standard symmetric filters (HP, Baxter-King bandpass, Butterworth) lose observations at endpoints — exactly where you need estimates most. The KW approach computes MSE-optimal filter weights at every observation, including endpoints, using the autocovariance structure from an ARIMA model.
This is particularly relevant for macroeconomists and business cycle researchers working on output gaps, trend-cycle decomposition, or real-time filtering where endpoint bias directly affects policy conclusions.
# Optimal HP filter with endpoint correction
r = kolmogorov_wiener(y, :hp; m=12, lambda=1600.0)
# Trend/cycle decomposition (trend + cycle = data, exact)
d = kw_decomposition(y; m=12)
# Bandpass for business cycle frequencies
r = kolmogorov_wiener(y, :bandpass; low=6, high=32, m=4)
# Forecasting with prediction intervals
fc = forecast(d; h=24)
plot(fc)
plot(d)
Supports HP, bandpass, Butterworth, and custom transfer functions, seasonal/nonseasonal ARIMA, Box-Cox transforms, and multi-step-ahead Wiener-optimal forecasting.
Reference: Schleicher, C. (2002). Kolmogorov-Wiener Filters for Finite Time-Series. Working Paper, University of British Columbia.

