Use the printed parameterization , , and . Let , be the design matrix with rows , and . Conditional on and the parameters, contributes no extra dependence on by conditional independence.
The stationary autoregressive normal distribution has prior density proportional to
Its Gaussian autoregressive conditional precision is the tridiagonal matrix with
Combining this prior with and completing the square gives
The precision matrix is positive definite. Compute its lower Cholesky decomposition , solve , draw , and solve . Then return . This Gaussian sampling from a precision Cholesky factor is exact because . Tridiagonal structure gives linear cost in and preserves the conditional correlation between days. Notice that the solve uses , not .
These conditionals are normalized for every fixed positive , despite the joint posterior impropriety explained in part (a). If the intended model uses instead, replace the observation coefficient by throughout; the information and precision terms then use and .