DSGE model.

To simplify the representation of the algorithms of a simulation smoother, we rewrite the state space model of $ (2.12) $ and $ (2.13) $ described in Section 2.1 into $ (A.1) $ , and $ (A.2) $ as below.

$$ \tilde{\boldsymbol{X}}_{t}=\tilde{\boldsymbol{\Lambda}}\tilde{\boldsymbol{S}}_{t}+\boldsymbol{\nu}_{t},\qquad\boldsymbol{\nu}_{t}\sim N(\mathbf{0},\mathbf{R}), $$

$$ \tilde{\boldsymbol{S}}_{t}=\tilde{\mathbf{G}}\tilde{\boldsymbol{S}}_{t-1}+\tilde{\mathbf{H}}\boldsymbol{\varepsilon}_{t},\qquad\boldsymbol{\varepsilon}_{t}\sim N(\mathbf{0},\mathbf{Q}(\boldsymbol{\theta})), $$

First, a Kalman filter for the state space model is implemented as follows before carrying out the simulation smoother.

$$ \begin{array}{r l r}{\eta_{t}}&{=}&{\tilde{\boldsymbol{X}}_{t}-\tilde{\boldsymbol{\Lambda}}\tilde{\boldsymbol{S}}_{t|t},\qquad\mathbf{F}_{t}=\tilde{\boldsymbol{\Lambda}}\tilde{\mathbf{P}}_{t|t}\tilde{\boldsymbol{\Lambda}}^{\prime}+\mathbf{R},\qquad\mathbf{K}_{t}=\tilde{\mathbf{G}}\tilde{\mathbf{P}}_{t|t}\tilde{\boldsymbol{\Lambda}}^{\prime}\mathbf{F}_{t}^{-1},}\end{array} $$

$$ \mathbf{L}_{t}=\tilde{\mathbf{G}}-\mathbf{K}_{t}\tilde{\mathbf{\Lambda}},\qquad\tilde{\mathbf{S}}_{t+1|t+1}=\tilde{\mathbf{G}}\tilde{\mathbf{S}}_{t|t}+\mathbf{K}_{t}\boldsymbol{\eta}_{t},\qquad\tilde{\mathbf{P}}_{t+1|t+1}=\tilde{\mathbf{G}}\tilde{\mathbf{P}}_{t|t}\mathbf{L}_{t}^{\prime}+\tilde{\mathbf{H}}\mathbf{Q}(\boldsymbol{\theta})\tilde{\mathbf{H}}^{\prime} $$

where $\eta_{t}$ is forecasting errors, $\mathbf{K}_{t}$ is Kalman gain, $\tilde{\mathbf{P}}_{t}$ is variance covariance matrix of state variables $\tilde{\mathbf{S}}_{t}$. Filtering of $\tilde{\mathbf{S}}_{t|t}$, $\tilde{\mathbf{P}}_{t|t}$ iterates forward for period $t=1,2,\cdots,T$. And for initial value $\tilde{\mathbf{S}}_{1|1}$, $\tilde{\mathbf{P}}_{1|1}$, we set $\tilde{\mathbf{X}}_{1}=\tilde{\mathbf{\Lambda}}\tilde{\mathbf{S}}_{1}$, and $\tilde{\mathbf{P}}_{1|1}=\tilde{\mathbf{G}}\tilde{\mathbf{P}}_{1|1}\tilde{\mathbf{G}}^{\prime}+\tilde{\mathbf{H}}\mathbf{Q}(\boldsymbol{\theta})\tilde{\mathbf{H}}^{\prime}$, where subscript $t|t$ of $\tilde{\mathbf{S}}_{t|t}$ denotes conditional expected value of $\tilde{\mathbf{S}}_{t}$ up to information on $\mathbf{X}_{1},\cdots,\mathbf{X}_{t}$, thus, $E(\tilde{\mathbf{S}}_{t}|\mathbf{X}_{1},\mathbf{X}_{2},\cdots,\mathbf{X}_{t})$.

Next, we generate values of $ r_{t-1} $ , $ N_{t-1} $ by implementing the simulation smoother. This algorithm is iterated backward from period: $ t = T, \cdots, 2, 1 $ using values obtained from a Kalman filter, as following equations (A.3), (A.4).

$$ \boldsymbol{r}_{t-1}=\tilde{\boldsymbol{\Lambda}}^{\prime}\mathbf{F}_{t}^{-1}\boldsymbol{\eta}_{t}-\mathbf{W}_{t}^{\prime}\mathbf{C}_{t}^{-1}\boldsymbol{d}_{t}+\mathbf{L}_{t}^{\prime}\boldsymbol{r}_{t}, $$

$$ \mathbf{N}_{t-1}=\tilde{\boldsymbol{\Lambda}}^{\prime}\mathbf{F}_{t}^{-1}\tilde{\boldsymbol{\Lambda}}+\mathbf{W}_{t}^{\prime}\mathbf{C}_{t}^{-1}\mathbf{W}_{t}+\mathbf{L}_{t}^{\prime}\mathbf{N}_{t}\mathbf{L}_{t}, $$

where $ W_{t} $ and $ C_{t} $ are obtained from equations.

$$ \mathbf{W}_{t}=\mathbf{Q}(\boldsymbol{\theta})\tilde{\mathbf{H}}^{\prime}\mathbf{N}_{t}\mathbf{L}_{t}, $$

$$ \mathbf{C}_{t}=\mathbf{Q}(\boldsymbol{\theta})-\mathbf{Q}(\boldsymbol{\theta})\tilde{\mathbf{H}}^{\prime}\mathbf{N}_{t}\tilde{\mathbf{H}}\mathbf{Q}(\boldsymbol{\theta}), $$

and random variable $ d_{t} $ is generated from $ N(\mathbf{0}, \mathbf{C}_{t}) $ . Initial value $ r_{T} $ and $ N_{T} $ are set at $ r_{T} = 0 $ , and $ N_{T} = O $ .

And also smoothing of structural shocks $ \hat{\varepsilon}_{t|T} $ , are implemented via backward iteration using the following equations. Subscript t|T of $ \hat{\varepsilon}_{t|T} $ denotes expected value conditional on total sample period such as $ E(\varepsilon_{t}|X_{1},X_{2},\cdots,X_{T}) $ .

$$ \hat{\boldsymbol{\varepsilon}}_{t|T}=\mathbf{Q}(\boldsymbol{\theta})\tilde{\mathbf{H}}^{\prime}\boldsymbol{r}_{t}+\boldsymbol{d}_{t}\qquad\boldsymbol{d}_{t}\sim N(\mathbf{0},\mathbf{C}_{t}),\qquad t=T,\cdots,2,1 $$

Finally, generation of state variables $ \tilde{S}_{t} $ is carried out by forward iteration of the following equation.

$$ \tilde{\boldsymbol{S}}_{t+1|T}=\tilde{\mathbf{G}}\tilde{\boldsymbol{S}}_{t}+\mathbf{H}\hat{\boldsymbol{\varepsilon}}_{t|T},\qquad t=1,2,\cdots,T, $$