Skip to content

Instantly share code, notes, and snippets.

@WardBrian
Created July 15, 2024 16:04
Show Gist options
  • Save WardBrian/93d12876923790f23d9c5cb481e8cd34 to your computer and use it in GitHub Desktop.
Save WardBrian/93d12876923790f23d9c5cb481e8cd34 to your computer and use it in GitHub Desktop.
Linear Regression
{
"N": 10,
"x": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
],
"y": [
1.175246231294085,
2.407986514262124,
3.722795906507695,
4.913215145535075,
6.086548493077272,
7.278023025499204,
8.587414785721538,
9.990151691417916,
11.251678394115302,
12.406899413685272
]
}
data {
int<lower=0> N;
vector[N] x;
vector[N] y;
}
parameters {
real alpha;
real beta;
real<lower=0> sigma;
}
model {
y ~ normal(alpha + beta * x, sigma);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment