 # Setting of mixing model and writing of mod file

I am now building a DSGE model, and the frequency of some variables is different. For example, some variables are quarterly and some variables are annual (for symbolic reality), that is, the annual variable only changes once every four quarters. I would like to ask how this should be written in the mod file

Hi, If you have different frequencies in the same model you need to write the model in the highest frequency (here quarterly) and add definitions for the lower frequency data (annual). Suppose you have a variable X, for this variable we define two variables X_{4,t} and X_{1,t} respectively for the quarterly and annual frequencies. The equation for X_{4,t} is given by the model (behaviours are expressed in the highest frequency) and you need to add an equation defining X_{1,t} as a function of X_{4,t}. This equation depends on the nature of the variable X (stock, flow, rate or factor):

• If X is a stock variable then its level in a given year is the level of the last quarter:
X_{1,t} = X_{4,t}
• If X is a flow variable then its level is the sum of the quarterly levels over a year:
X_{1,t} = \sum_{i=0}^3X_{4,t-i}
• If X is a rate (for instance an interest or tax rate) then its level is given by the arithmetic average over a year:
X_{1,t} = \frac{1}{4}\sum_{i=0}^3X_{4,t-i}
• If X is a factor (for instance a growth or inflation factor) then it’s level is given my the geometric average over a year:
X_{1,t} = \left(\prod_{i=0}^3X_{4,t-i}\right)^\frac{1}{4}

Obviously you do not need all the observations for X_{1,t}, only one over four makes sense. If you simulate the model you will take one observation every four observations (the fourth one if your convention is that the the first simulated data is for the first quarter of a year). If you estimate a model using a model with quarterly and annual data, then for the annual data you need to provide a time series with NaNs for all the periods except the last quarters.

Best,
Stéphane.