and

$$ \hat{y}_{t}^{n}=a_{n}+b_{n}^{T}X_{t}+X_{t}^{T}c_{n}X_{t}+\omega_{n,t}. $$

Formally, this can be stacked into one equation and expressed as

$$ \underbrace{\left[\begin{array}{c}{{{\hat{f}_{t}}}} \\{{{\hat{g}_{t}}}} \\{{{\hat{\pi}_{t}}}} \\{{{---}}} \\{{{y_{t}^{1}}}} \\{{{\vdots}}} \\{{{y_{t}^{n}}}} \\{{{\vdots}}} \\{{{y_{t}^{N}}}}\end{array}\right]}_{(M+N)\times1}=\underbrace{\left[\begin{array}{c}{{{0}}} \\{{{0}}} \\{{{0}}} \\{{{0}}} \\{{{---}}} \\{{{a_{1}}}} \\{{{\vdots}}} \\{{{a_{n}}}} \\{{{\vdots}}} \\{{{a_{N}}}}\end{array}\right]}_{(M+N)\times1}+\underbrace{\left[\begin{array}{cccc}{{{1}}}&{{{0}}}&{{{0}}} \\{{{0}}}&{{{1}}}&{{{0}}} \\{{{0}}}&{{{0}}}&{{{1}}} \\{{{---}}}&{{{---}}}&{{{---}}} \\{{{b_{1,1}}}}&{{{b_{2,1}}}}&{{{b_{3,1}}}} \\{{{\vdots}}}&{{{\vdots}}}&{{{\vdots}}} \\{{{b_{1,n}}}}&{{{b_{2,n}}}}&{{{b_{3,n}}}} \\{{{\vdots}}}&{{{\vdots}}}&{{{\vdots}}} \\{{{b_{1,N}}}}&{{{b_{2,N}}}}&{{{b_{3,N}}}}\end{array}\right]}_{(M+N)\times M}\underbrace{\left[\begin{array}{c}{{{f_{t}}}} \\{{{g_{t}}}} \\{{{\pi_{t}}}}\end{array}\right]}_{M\times1}+\left[\begin{array}{cccc}{{{f_{t}}}}&{{{g_{t}}}}&{{{\pi_{t}}}}\end{array}\right]\odot\underbrace{\left[\begin{array}{c}{{{\mathbf{0}_{\mathbf{M}\times\mathbf{M}}}}} \\{{{\mathbf{0}_{\mathbf{M}\times\mathbf{M}}}}} \\{{{\mathbf{0}_{\mathbf{M}\times\mathbf{M}}}}} \\{{{---}}} \\{{{\mathbf{c}_{1}}}} \\{{{\vdots}}} \\{{{\mathbf{c}_{n}}}} \\{{{\vdots}}} \\{{{\mathbf{c}_{\mathbf{N}}}}}\end{array}\right]}_{M(M+N)\times M}\odot\left[\begin{array}{c}{{{f_{t}}}} \\{{{g_{t}}}} \\{{{\pi_{t}}}}\end{array}\right]+\underbrace{\left[\begin{array}{c}{{{\omega_{r,t}}}} \\{{{\omega_{y,t}}}} \\{{{\omega_{\pi,t}}}} \\{{{---}}} \\{{{\omega_{y1,t}}}} \\{{{\vdots}}} \\{{{\omega_{yn,t}}}} \\{{{\vdots}}} \\{{{\omega_{yN,t}}}}\end{array}\right]}_{(M+N)\times1}, $$

where $ \hat{X}_{t}=\left(\hat{f}_{t},\hat{g}_{t},\hat{\pi}_{t}\right) $ is the observable state vector of macro variables with measurement errors $ \omega_{it} $ and $ X_{t}=(f,g_{t},\pi_{t}) $ is the unobservable state vector. Here, M and N denote the numbers of macro variables and yields respectively. The third term of RHS represents the quadratic multiplication where $ 0_{M\timesM} $ and $ c_{n} $ are $ M\times M $ matrices. When we set the matrix $ c_{n}=0_{M\timesM} $ , the QTSM reduces to the ATSM and we have a linear state-space model.

• State equation. The state equation with the parameters $ \mu^{P} $ and $ \Phi^{P} $ is given by

$$ X_{t+1}=\mu^{P}+\Phi^{P}X_{t}+\Sigma\varepsilon_{t+1}, $$

which can be expressed as

$$ \left[\begin{array}{l}f_{t+1}\\ g_{t+1}\\ \pi_{t+1}\end{array}\right]=\left[\begin{array}{l}\mu_{1}\\ \mu_{2}\\ \mu_{3}\end{array}\right]+\left[\begin{array}{l l l}\phi_{11}&\phi_{12}&\phi_{12}\\ \phi_{12}&\phi_{12}&\phi_{12}\\ \phi_{12}&\phi_{12}&\phi_{12}\end{array}\right]\left[\begin{array}{l}f_{t}\\ g_{t}\\ \pi_{t}\end{array}\right]+\left[\begin{array}{l}\varepsilon_{f,t+1}\\ \varepsilon_{g,t+1}\\ \varepsilon_{\pi,t+1}\end{array}\right]. $$

The equation is a standard VAR(1) system.

#### A.2.2 MCMC algorithm

As can be seen from the measurement equation, the state space model is non-linear so that we have adopted MH within Gibbs with single-move sampler for unobservable macro variables $ X_{t} = (f_{t}, g_{t}, \pi_{t}) $ , following the Bayesian procedure in Ang et al. (2011).

The algorithm of MCMC based on Ang et al. (2011) is consist of the following five steps.

• Step 1: Drawing the latent factor $ X_{t} = (f_{t}, g_{t}, \pi_{t}) $ . We adopt the single-move sampler and generate the latent factors using random walk MH with the conditional posterior