Examples Gallery¶
Complete .qvr programs spanning probabilistic regressions,
latent-variable models, state-space models, language models,
encoder-decoder networks, and weighted deductions. Every example
ships a ## Try it section with synthetic-data generation, an
SVI fit, and a Bayesian posterior block; all snippets are
executed in CI.
All source files live under docs/examples/source/.
Regressions¶
- Bayesian Linear Regression: Normal likelihood with Normal-prior weights.
- Beta Regression: Beta-distributed response with logit link.
- Gamma Regression: Gamma response with log link.
- Horseshoe Regression: sparse linear regression under the horseshoe prior.
- Negative Binomial Regression: overdispersed count response.
- Zero-Inflated Poisson Regression: count response with a separate zero-inflation channel.
- Item Response Theory (2PL): Rasch-style logistic IRT with item difficulty and discrimination.
- Weibull Survival: proportional-hazards survival with Weibull baseline.
Latent-variable models¶
- Factor Analysis: linear factor decomposition with free per-dimension noise.
- Probabilistic PCA: isotropic-noise special case of factor analysis.
- Latent Dirichlet Allocation: topic model with Dirichlet priors on per-document and per-topic distributions.
- Gaussian Mixture Model: finite mixture with grouped marginalization over the cluster label.
- Variational Autoencoder: amortized inference over a continuous latent with neural decoder.
- Bayesian Neural Network: feed-forward classifier with Normal priors over every weight.
- Probabilistic Matrix Factorization: low-rank Bayesian completion of a sparse rating matrix.
State-space and time-series models¶
- AR(1): first-order autoregressive Normal scalar series.
- Changepoint Model: piecewise-constant means with a sampled change point.
- Stochastic Volatility: AR(1) log-variance driving Normal returns.
- Linear-Gaussian SSM: Kalman-filter dynamics with learnable transition / emission.
- Hidden Markov Model (Discrete): row-stochastic transition and emission matrices over finite states.
- Hidden Markov Model (Continuous): Gaussian-emission HMM with continuous-state latent trajectory.
- Deep Markov Model: nonlinear-MLP transition and emission cells.
Language models¶
- Vanilla RNN LM: single-cell Elman RNN scored by a Categorical head.
- GRU LM: gated recurrent unit cell.
- LSTM LM: long short-term memory cell.
- Bidirectional RNN LM: forward + backward RNN with a masked-token target.
- Transformer LM: stacked self-attention with a Categorical head.
Encoder-decoder and structured outputs¶
- Sequence-to-Sequence: encoder-decoder with attention scored by a target-side Categorical.
- Tree-Structured Categorical: hierarchical Categorical observation over a parametric tree.
Weighted deductions¶
- PCFG: probabilistic context-free grammar with learnable production weights.
- CCG: combinatory categorial grammar with forward / backward application and composition.
- Type-Logical Grammar (Lambek): Lambek calculus with residuated slashes and tensor.
- PMCFG: probabilistic multiple context-free grammar with WH-movement via a rank-2 non-terminal.
- Multimodal TLG: Lambek calculus extended with diamond and box modalities.
- Custom Sequent Rules: user-defined sequents over a free residuated category.
- Quantifier Scope: continuation-monad lift for generalized quantifiers.
- Montague NLI: Montague-style lambda-term LFs plus modus-ponens NLI prover.