Stock and Watson outliers

Hi. I’m new here :) I am trying to replicate “Trend, Seasonal, and Sectoral Inflation in the Euro Area” (Stock and Watson 2019). In the paper, the authors propose an unobserved component stochastic volatility (UCSV) model for inflation.

I am doing OK with most parts of the model, but I am struggling with how they model the outlier process. Specifically, let o[t] denote a multiplicative outlier.

for each t, o[t] equals 1 with probability p and U(2,10) with probability (1-p), where p ~ Beta(a,b).

Can you please help me with modeling the o[t] part using Stan?

I’m not sure of the details, but you are going to want to use the log_mix function for mixture models like this and see also the chapter in the user guide:

Thank! will do that.