Language 0.8 example catalog

Fifty small models, each tested

Copy a complete file, compare modeling patterns, or run the catalog validator to check the parser, model lowering, derivatives, initial state, and generated quantities.

Stan-inspired, not Stan-compatible

01–10 · Foundations

Conjugacy, likelihoods, and constraints

ScriptPatternMain feature
01 beta-binomialCoin toss posteriorBounded probability and predictive binomial RNG
02 A/B testTwo independent armsMultiple bounded parameters
03 normal meanKnown observation scaleConjugate location
04 location/scaleVectorized normal dataPositive scale and prediction
05 robust locationOutlier-resistant modelVectorized Cauchy likelihood
06 gamma–PoissonCount-rate posteriorPositive rate and count RNG
07 exponential rateWaiting-time modelVectorized positive data
08 BernoulliBinary outcomeBeta prior and Bernoulli RNG
09 binomialGrouped binary outcomesBinomial likelihood
10 bounded latentLatent location on [-2,2]Two-sided transform and uniform prior

11–20 · Regression and structure

Transformed parameters, links, hierarchy, order, and simplex state

ScriptPatternMain feature
11 precisionScale-to-precision conversionTransformed parameter
12 standardized effectNon-centered latent effectDerived scientific parameter
13 log responseNormal model on log dataVector data and prediction
14 Poisson log linkCount regressionexp link
15 logisticSingle binary observationinv_logit link
16 two-point logisticTwo predictor valuesMultiple transformed probabilities
17 two groupsDifference in meansTwo vectorized likelihoods
18 non-centered groupsPartial-pooling skeletonStandardized effects
19 ordered meansMonotone locationsOrdered vector and indexing
20 three categoriesCategory probabilitiesSimplex and manual log target

21–30 · Priors, transformations, and prediction

Prior predictive simulation and generated quantities

ScriptPatternMain feature
21 beta predictivePrior-only probabilityBernoulli prior prediction
22 gamma predictivePrior-only ratePoisson prior prediction
23 half-Cauchy scalePositive constrained scaleCauchy prior on a transformed parameter
24 bounded locationFinite prior supportUniform prior and normal likelihood
25 centered dataSubtract a known offsetTransformed data block
26 endpoint sumBaseline plus changeTransformed parameter block
27 normal RNGContinuous predictionnormal_rng
28 Bernoulli RNGBinary predictionbernoulli_rng
29 binomial RNGFuture successesbinomial_rng
30 Poisson RNGFuture countpoisson_rng

31–40 · Extended surface

Remaining RNGs, manual density terms, indexing, and pooled groups

ScriptPatternMain feature
31 gamma RNGPositive predictionShape/rate convention
32 exponential RNGFuture waiting timeexponential_rng
33 uniform RNGReference simulationuniform_rng
34 Cauchy RNGHeavy-tailed predictioncauchy_rng
35 manual targetExplicit prior and likelihoodtarget += *_lpdf
36 nonlinear meanExponential response curveNonlinear transformed parameter
37 indexed vectorThree explicit observationsOne-based indexing
38 ordered priorFour latent cutpointsVectorized prior on ordered state
39 simplex regularizationBalanced weightsManual simplex prior
40 pooled groupsGrand mean and contrastTwo vectorized group likelihoods

41 · Data and control flow

Start with a real file-backed workflow

ScriptPatternMain feature
41 CSV normal meanCSV observations through Java or scriptfor, indexing, external data binding, and normal prediction

Run it with McmcDataIngestionExamples.java or follow the data and compilation tutorial.

42–50 · Version 0.8.2 additions

Apply the expanded language and probability catalog

ScriptPatternMain feature
42 robust Student-tLocation/scale data with an outlierstudent_t, transformed degrees of freedom, and RNG
43 Bernoulli-logitBinary regressionLogit likelihood and RNG without manual probability conversion
44 beta-binomialOverdispersed grouped successesMean/concentration transformation and predictive count
45 negative-binomial log linkOverdispersed count regressionneg_binomial_2_log likelihood and RNG
46 piecewise errorsRobustify observations past a cutoffScoped locals, while, if, assignment, and |
47 contamination mixtureClean and outlier observation regimeslog_mix and local log densities
48 Weibull lifetimePositive event timesVectorized Weibull likelihood and RNG
49 circular directionAngular observationVon Mises likelihood and circular RNG
50 reaction timeGaussian core with exponential delayExponentially modified normal likelihood and RNG

The companion ModelScriptCompilationExamples.java loads a checked-in script and compares in-memory, cached-JDK, and generated-source workflows.

51 · First-passage reaction time

Fit a Wiener drift-diffusion likelihood

ScriptPatternMain feature
51 Wiener reaction timeUpper-response reaction timesStable wiener likelihood and conditional wiener_rng

The four-parameter likelihood follows Stan's upper-response convention. JDistlib's RNG is an extension and samples time conditional on that response.

Validate

Run the semantic catalog gate

./gradlew validateModelScripts

The validator supplies representative typed data for each file, compiles the script, checks its analytic gradient against central finite differences, requires a finite initial density, and evaluates generated quantities.