We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6faa10e commit d6e8c80Copy full SHA for d6e8c80
misc/moving-avg/arma11_alt.stan
@@ -0,0 +1,25 @@
1
+# ARMA(1,1) with Wayne Folta-style err encoding
2
+
3
+data {
4
+ int<lower=1> T; // number of observations
5
+ real y[T]; // observed outputs
6
+}
7
+parameters {
8
+ real mu; // mean term
9
+ real phi; // autoregression coeff
10
+ real theta; // moving avg coeff
11
+ real<lower=0> sigma; // noise scale
12
13
+model {
14
+ real err;
15
+ mu ~ normal(0,10);
16
+ phi ~ normal(0,2);
17
+ theta ~ normal(0,2);
18
+ sigma ~ cauchy(0,5);
19
+ err <- y[1] - mu + phi * mu;
20
+ err ~ normal(0,sigma);
21
+ for (t in 2:T) {
22
+ err <- y[t] - (mu + phi * y[t-1] + theta * err);
23
24
+ }
25
0 commit comments