Skip to content

Instantly share code, notes, and snippets.

@karnigili
Last active August 17, 2021 15:07
Show Gist options
  • Save karnigili/75757f2c52fc8273b9e0a670259a0417 to your computer and use it in GitHub Desktop.
Save karnigili/75757f2c52fc8273b9e0a670259a0417 to your computer and use it in GitHub Desktop.
linear_reg.stan
data {
int<lower=0> N; // n data
vector[N] x; // regressor
vector[N] y; // regressand
}
parameters {
real alpha; // intercept
real beta; // coefficient
real<lower=0> sigma; // variance
}
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