#### Temporal distributions

##### Temporal smoothing with car.normal

In one dimension, the intrinsic Gaussian CAR distribution reduces to a Gaussian random walk (see e.g.Fahrmeir and Lang, 2001). Assume we have a set of temporally correlated random effects

θ_{t}, t=1,..., T (where T is the number of equally-spaced time points). In the simplest case of a random walk of order 1, RW(1), we may write

θ_{t} |

θ_{-}_{t}_{ }~ Normal

( θ_{t+1},

φ ) for t = 1

~ Normal

( (θ_{t-1}_{ }+ θ_{t+1})/2,

φ / 2 ) for t = 2, ...., T-1

~ Normal

( θ_{t-1},

φ ) for t = T

where

θ_{-}_{t}_{ }denotes all elements of

**θ**except the

θ_{t}. This is equivalent to specifying

θ_{t} |

θ_{-}_{t}_{ }~ Normal

( Σ_{k} C

_{tk} θ_{k},

φ M

_{tt}) for t = 1, ..., T

where C

_{tk} = W

_{tk} / W

_{t+}, W

_{t+} =

Σ_{k} W

_{tk} and W

_{tk} = 1 if k = (t-1) or (t+1) and 0 otherwise; M

_{tt} = 1/W

_{t+}. Hence the RW(1) prior may be fitted using the

`car.normal`

distribution in WinBUGS, with appropriate specification of the weight and adjacency matrices, and num vector (see the

Air Pollution Example)

_{}A second order random walk prior is defined as

θ_{t} |

θ_{-}_{t}_{ }~ Normal

( 2

θ_{t+1}_{ }- θ_{t+2},

φ ) for t = 1

~ Normal

( (2

θ_{t-1}_{ }+ 4

θ_{t+1}_{ }- θ_{t+2})/5,

φ / 5 ) for t = 2

~ Normal

( (-θ_{t-2}_{ }+ 4

θ_{t-1}_{ }+ 4

θ_{t+1}_{ }- θ_{t+2})/6,

φ / 6 ) for t = 3, ...., T-2

~ Normal

( (-θ_{t-2}_{ }+ 4θ_{t-1}_{ }+ 2

θ_{t+1})/5,

φ / 5 ) for t = T-1

~ Normal

( -θ_{t-2}+ 2

θ_{t-1},

φ ) for t = T

Again this is equivalent to specifying

θ_{t} |

θ_{-}_{t}_{ }~ Normal

( Σ_{k} C

_{tk} θ_{k},

φ M

_{tt}) for t = 1, ..., T

where C

_{tk} is defined as above, but this time with W

_{tk} =

-1 if k = (t-2) or (t+2), W

_{tk} = 4 if k = (t-1) or (t+1) and t in (3, T-2), W

_{tk} = 2 if k = (t-1) or (t+1) and t = 2 or T-1, W

_{tk} = 0 otherwise; M

_{tt} = 1/W

_{t+}.

Note that if the observed time points are not equally spaced, it is necessary to include missing values (NA) for the intermediate time points (see the

Air Pollution Example).