Other than putting things in a loop that you can,
there's not a good alternative. You're doing the right
thing in constructing the errors ahead of time.
The alternative is to leave the final sigma error
y ~ normal(y_hat, sigma);
rather than using
y - y_hat ~ normal(0, sigma);
But you need to do the subtraction thing for all those
other errors unless there's some exponential family magic
that lets you simplify.
- Bob
> // nu[t] <- mu + phi1 * y[t-12] + theta[1] * err[t-1] + theta[2] * err[t-12] ;
> nu[t] <- mu + phi1 * y[t-12] + phi2 * y[t-13] + theta[1] * err[t-1] + theta[2] * err[t-12] + theta[1] * theta[2] * err[t-13];
> err[t] <- y[t] - nu[t];
> }
>
> mu ~ normal(0, 10); // priors
> phi1 ~ normal(0, 2);
> phi2 ~ normal(0, 2);
> theta ~ normal(0, 2);
> sigma ~ cauchy(0, 5);
> err ~ normal(0, sigma); // likelihood
> }
>
>
>
>
>