Skip to content

Advanced Workbench

The Advanced Workbench groups three panels: Bayesian inference, Mixed Models, and Time Series & DSP.

Time Series & DSP

Access

  • (Ctrl+Alt+Shift+N) Mixed Models, (Ctrl+Alt+Shift+S) Time Series & DSP, (Ctrl+Alt+Shift+B) Bayesian Inference.
  • CLI: leap mixed ..., leap timeseries ..., leap arima ..., leap fft ..., leap filter ..., leap bayes ....

Bayesian inference

Two tabs: Conjugate / A-B and MCMC.

Conjugate / A-B

Beta-Binomial and Normal-Normal conjugate posteriors drive a two-arm A/B comparison:

\[\text{Beta}(\alpha, \beta) \mid \text{Binomial}(k, n) \Rightarrow \text{Beta}(\alpha + k, \beta + n - k)\]
\[\text{Normal}(\mu_0, \sigma_0^2) \mid \text{Normal}(\bar{x}, \sigma^2/n) \Rightarrow \text{Normal}(\mu_{\text{post}}, \sigma^2_{\text{post}})\]

Posterior means, SDs, \(P(\text{A best})\), \(P(\text{B beats A})\), expected loss of choosing B, relative uplift \(E[(\theta_B - \theta_A)/|\theta_A|]\) and its 95% HDI are all reported.

MCMC (HMC)

Multi-chain Hamiltonian Monte Carlo over a regression OLS fit, with merged posterior samples. Diagnostics reported from the fit:

\[\hat{R} = \sqrt{\frac{\text{variance across chains}}{\text{variance within chains}}}, \qquad ESS \; \text{(effective sample size)}\]

with \(\hat{R}\) targeting 1.00–1.05 and ESS the effective sample size per parameter after thinning. Table binding loads a y (response) and x (covariate) column pair; an OLS regression is fitted with the covariate as a single x.

Mixed models (LMM)

Linear mixed-effects models fitted by REML (or ML) via LEAP's shared leap-stats engine:

\[y_i = x_i^\top \beta + u_{g(i)} + \varepsilon_i, \qquad u_g \sim \mathcal{N}(0, \tau^2 I), \quad \varepsilon_i \sim \mathcal{N}(0, \sigma_e^2)\]

REML estimation maximizes the restricted likelihood over \(\tau^2\) and \(\sigma_e^2\); the model also reports ICC \(= \tau^2 / (\tau^2 + \sigma_e^2)\), fixed-effect estimates with SE / t / p, and per-group BLUP intercepts. Tukey / Dunnett-style multiple-comparisons summaries are derived from the fixed effects table (Bonferroni/Tukey adjustment is applied over the named predictors).

Time Series & DSP

Tabs: Forecast, ACF / PACF, Spectral & Filter.

Forecast

  • Holt-Winters triple-additive (\(\alpha\) level, \(\beta\) trend, \(\gamma\) seasonal):
\[\ell_t = \alpha\,(y_t - s_{t-m}) + (1-\alpha)(\ell_{t-1} + b_{t-1}), \qquad b_t = \beta(\ell_t - \ell_{t-1}) + (1-\beta)b_{t-1}\]
\[s_t = \gamma\left(y_t - \ell_t\right) + (1-\gamma)s_{t-m}\]
  • ARIMA(1,1,1) fit via leap-stats ARIMA, with 95% fan bounds from the analytic variance of the forecasts.

ACF / PACF

\[\rho(h) = \frac{\gamma(h)}{\gamma(0)}, \qquad \phi_{\max}(h) = \text{partial autocorrelation at lag } h\]

Ljung-Box tests residual autocorrelation through lag \(m\); the ADF unit-root test (constant regressor) reports the \(\tau\) statistic and 5% rejection.

Spectral & Filter

Welch one-sided PSD (in dB) with configurable window (Hann / Hamming / Blackman-Harris / Flat-Top), peak detection, THD and SNR:

\[\text{THD} = \frac{\sqrt{\sum_{i=2}^{K} P_i}}{P_1} \times 100\%, \qquad SNR = 10\log_{10}\left(\frac{P_{\text{signal}}}{P_{\text{noise}}}\right)\]

Butterworth low-pass filtering (filtfilt) with 1..=8 order.

Active-table integration

  • Bayesian: load_table_xy loads a y/x column pair (must be ≥ 8 rows, finite, equal length); the Normal-Normal arms are derived by splitting on the median of x.
  • Mixed Models: demo group data (panel is synthetic); group count is editable.
  • Time Series & DSP: the Data Source bar loads any numeric column as the active series (≥ 4 rows, finite); it is stored by name and selected for the active forecast/spectral view.

Bayes mixed

GUI / CLI parity

Open Mixed Models with (Ctrl+Alt+Shift+N), Time Series & DSP with (Ctrl+Alt+Shift+S) or Bayesian Inference with (Ctrl+Alt+Shift+B). Pick columns from the Data Source bar; forecasts, spectra and posteriors update live.

leap mixed data.csv --y yield_pct --x x1,x2 --group batch --slope rep --mode reml
leap timeseries data.csv --column yield_pct --mode holt-winters --period 12 --hw-model triple-additive --h 6 --svg ts.svg
leap timeseries data.csv --column yield_pct --mode acf --max-lag 10 --svg acf.svg
leap arima data.csv --column yield_pct --p 1 --d 1 --q 1 --horizon 6 --svg arima.svg
leap fft data.csv --column yield_pct --fs 100 --mode psd --segment-len 64 --window hann --svg fft.svg
leap filter data.csv --column yield_pct --mode butterworth --kind lp --order 4 --cutoff 0.2 --svg filtered.svg
leap bayes data.csv --mode mcmc --y yield_pct --x x1,x2 --chains 4 --warmup 400 --draws 800 --seed 7
leap bayes data.csv --mode conjugate --kind beta-binomial --prior-alpha 2 --prior-beta 2 --alpha 0.05
leap bayes data.csv --mode ab --group arm --value metric --ab-kind normal --prior-mean 0 --prior-sd 1 --n-draws 4000