What this does
SlicTranspiler turns editable Julia/StanBlocks source into Stan, checks the generated program with stanc, and keeps source and output side by side. Most prepared Library examples transpile as soon as you open them; large workspaces and shared links stay review-first until you choose Transpile.
The workbench
- Compose data, functions, anonymous submodels and endpoint models in one copyable Julia script. Section summaries keep their global line ranges visible while collapsed; Data starts collapsed.
- Arrange the source and generated-code panes with the center divider. Drag it, focus it and use the arrow keys, or use its edge buttons to collapse either pane completely; your layout stays in this browser.
- Edit the bluish-outlined code in place. Binding names live in the code itself, so there is no second label to drift out of sync.
- Transpile an endpoint with its button or ⌘/Ctrl + Enter; the Stan program and its
stanc result appear on the right and that endpoint is highlighted. - The Function tab transpiles a single
@deffun into its emitted Stan function. - The Library collects runnable examples and a guided Model spotlight; call any Library function by name.
- Share builds a link that reopens the editor with your source.
SLIC in a nutshell
y ~ normal(mu, sigma)- A ~ statement — a prior on a parameter, or a likelihood when the left side is data.
mu = alpha + beta * x- An = assignment — a deterministic transform.
beta::vector[k] ~ normal(0, 1)- A typed declaration. Left bare (
beta::vector[k]) it becomes a flat-prior parameter. - No loops or
if in a model body - Control flow lives in a
@deffun Stan function (the Function tab); the model calls it straight-line. theta ~ plate(y; outer=N) do yi … end- The one sampling loop — a fresh parameter and observation per group.
- Submodels
- Name a reusable fragment and pass its inputs by keyword:
eta ~ regression(; x). - Observations
weighted, truncated, censored and interval_censored wrap a family; missing outcomes are imputed automatically.
Try a Spotlight model
These prepared examples open editable and already transpiled:
- Linear regressionThe whole shape of a SLIC model in four lines: priors, a linear predictor, one Gaussian likelihood.
- Hierarchical radonPartial pooling — an index vector and a group-level prior tie many small groups into one model.
- Heteroscedastic motorcycle · HSGPA Gaussian process via Hilbert-space basis functions, with the observation noise its own second GP. Based on a model by Aki Vehtari.
- Birthdays · HSGP + horseshoeThe full gpbf8rhs model: trend and periodic GPs, time-varying weekday effects, 366 horseshoe-shrunk day effects, and holiday overrides. Based on a model by Aki Vehtari.
- Population PK/PD · FribergA nonlinear population model: an eight-state two-compartment PK/neutropenia ODE, correlated PK and PD variability, solver dispatch, and proportional concentration/neutrophil likelihoods. Based on a model by Casey Davis (stanpmx).
- Grey-seal IPM · mechanistic state-spaceThe final rung: the full structured SLIC port of n-kall/sealIPM. One year-recursive state process feeds eight observation streams through Form-A submodels, custom likelihood families with explicit predictive totals, and ODE hunting dynamics.
Browse every prepared source in the Library.
StanBlocks documentation ↗