RDP 2013-10: Stochastic Terms of Trade Volatility in Small Open Economies Appendix C: Estimating Stochastic Volatility

This appendix describes our procedure for estimating the stochastic volatility of the terms of trade. For a more detailed description of the use of the particle filter to estimate macroeconomic models, see Fernández-Villaverde and Rubio-Ramírez (2007).

Denote the vector of parameters to be estimated as Ψ = {ρqσqq} and the log of the prior probability of observing a given vector of parameters Inline Equation (Ψ). The function Inline Equation (Ψ) summarises what is known about the parameters prior to estimation. The log-likelihood of observing the dataset qT ≡ {q1,…,qT} for a given parameter vector is denoted Inline Equation (qT | Ψ).

The likelihood of the data given the parameters factorises to:

The final term in this expression expands as follows:

Computing this expression is difficult because the sequence of conditional densities Inline Equation has no analytical characterisation. A standard procedure, which we follow, is to substitute the density p (σq,t|qt−1; Ψ) with an empirical draw from it. To obtain these draws, we follow Algorithm 1, which we borrow from Fernández-Villaverde et al (2011).

Algorithm 1

Step 0: initialisation

Sample N particles, Inline Equation from the initial distribution p(σq,0|Ψ).

Step 1: prediction

Sample N one-step-ahead forecasted particles Inline Equation using Inline Equation, the law of motion for the states (Equation (2)) and the distribution of shocks Inline Equation.

Step 2: filtering

Assign each draw Inline Equation the weight Inline Equation, where:

Step 3: resampling

Generate a new set of particles by sampling N times with replacement from Inline Equation using the probabilities Inline Equation. Call the draw Inline Equation. In effect, this step builds the draws Inline Equation recursively from Inline Equation using the information on qt.

If t < T, set t = t + 1 and return to Step 1. Otherwise stop.

Using the law of motion for the terms of trade in Equation (1), we can evaluate Inline Equation for any Inline Equation. Moreover, from the law of large numbers we know that:

Algorithm 1 provides a sequence of Inline Equation for all t. Consequently, the algorithm gives us the information needed to evaluate Equation (C1).

To calculate the posterior distribution of the parameters, we repeat this procedure 25,000 times. At each iteration, we update our parameter draw using a random walk Metropolis-Hastings procedure, scaling the proposal density to induce an acceptance ratio of around 25 per cent. We discard the initial 5,000 draws and conduct our posterior inference on the remaining draws. For each evaluation of the likelihood we use 2,000 particles.