From 8969cf18aadfb6dba98ee9251259dbc1cfe6a1a5 Mon Sep 17 00:00:00 2001 From: simonsteiger Date: Tue, 22 Oct 2024 19:04:53 +0200 Subject: [PATCH 1/2] add dangling code example --- index.qmd | 16 ++++++++++++++++ theming/dark.scss | 3 +-- theming/light.scss | 2 ++ theming/rules/_cards.scss | 5 +++++ theming/rules/_sourceCode.scss | 3 +++ 5 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 theming/rules/_sourceCode.scss diff --git a/index.qmd b/index.qmd index 36c9ef99f..9fd2f8d82 100644 --- a/index.qmd +++ b/index.qmd @@ -36,6 +36,22 @@ description: | +
+```julia +@model function demo(x, y) + # Assumptions + σ2 ~ InverseGamma(2, 3) + σ = sqrt(σ2) + μ ~ Normal(0, σ) + + # Observations + x ~ Normal(μ, σ) + y ~ Normal(μ, σ) +end +``` +
+ + -[API reference](/library/){.button .btn} - - -
-
-
Intuitive
- Turing models are easy to write and communicate — syntax is close to mathematical notations. +```{=html} +
+
+ Three normal probability distributions + + Turing.jl + + + Bayesian inference with probabilistic programming + +
- -
-
General-purpose
- Turing supports models with discrete parameters and stochastic control flow. +
+
+
+ Intuitive +
+ Turing models are easy to write and communicate — syntax is close to mathematical notations. +
+
+
+ General-purpose +
+ Turing supports models with discrete parameters and stochastic control flow. +
+
+
+ Modular & composable +
+ Turing is modular, written entirely in Julia, and is interoperable with the powerful Julia ecosystem. +
- -
-
Modular & composable
- Turing is modular, written entirely in Julia, and is interoperable with the powerful Julia ecosystem. +
+``` +
+
+
+
+ Hello, World in Turing
+ Some text about how easy it is to [get going](https://turinglang.org/docs/tutorials/00-introduction/).
+
+```julia +@model function coinflip(; N::Int) + # Prior belief about the probability of heads + p ~ Beta(1, 1) + + # Heads or tails of a coin are drawn from `N` + # Bernoulli distributions with success rate `p` + y ~ filldist(Bernoulli(p), N) -
+ return y +end; +``` +
+
+
+
```julia -@model function demo(x, y) - # Assumptions - σ2 ~ InverseGamma(2, 3) - σ = sqrt(σ2) - μ ~ Normal(0, σ) - - # Observations - x ~ Normal(μ, σ) - y ~ Normal(μ, σ) +@model function putting_model(d, n; jitter=1e-4) + v ~ Gamma(2, 1) + l ~ Gamma(4, 1) + f = GP(v * with_lengthscale(SEKernel(), l)) + f_latent ~ f(d, jitter) + binomials = Binomial.(n, logistic.(f_latent)) + y ~ product_distribution(binomials) + return (fx=f(d, jitter), f_latent=f_latent, y=y) end ```
+
+
+ Goodbye, World in Turing +
+ Some text about how easy it is to interface with external packages like AbstractGPs. Learn more about modelling [Gaussian Processes](https://turinglang.org/docs/tutorials/15-gaussian-processes/) with Turing.jl. +
+
+