Skip to content

Commit

Permalink
stan demos
Browse files Browse the repository at this point in the history
  • Loading branch information
Jachym.Barvinek committed Jul 31, 2024
1 parent a248723 commit 0e8be24
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions assets/stan_demos/ar_k.stan
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
data {
int<lower=0> K; // model order
int<lower=0> N; // dataset size
vector[N] y;
}
parameters {
real alpha;
row_vector[K] beta;
real sigma;
}
model {
for (n in (K+1):N) {
real mu = alpha + (beta * y[n-K:n]);
y[n] ~ normal(mu, sigma);
}
}

0 comments on commit 0e8be24

Please sign in to comment.