My question is related to Gali chapter 8 (implemented by prof. Pfeifer) and the accurate way to read data from a file.
On github, you mentioned that all variables are in logdeviations from the steady state, but interest rate which is mean 0.
After reading the guide on observable variables, I proceeded the following way:

GDP (real quarterly volumes) → log(gdp) → get cylical component using univariateHP filter
Read it from the file like: y_obs = yhat or y_obs = y_gap 
Nominal interest rate (net annual percentages) → make it quarterly percentages ln(1 + rate/400) → get cyclical component using univariateHP filter
Read it from the file like: i_obs = i 
Inflation Rate (net quarterly percentages) → get cyclical component using univariateHP filter
Read it from the file like: pi_obs = pi
Question 1: You mentioned that interest rate is mean 0, not in logdeviations from steady state. HPfilter also demeans the data and the cyclical component is mean 0. Nonetheless, shouldn’t there be a difference between the way you match output gap and how you match inflation / interest rate given one is mean 0 and the others in logdeviations?
Question 2: Given that all variables (but the abovementioned ones) are in logdeviations, is it appropriate to just detrend variables (log consumption per capita, log NX per capita) using univariate HP filter and consider the cyclical component as logdeviation from steady state and read it like c_obs = c & c_NX = NX plus some shock to avoid stochastic singularity?
Question 3: Is it ok to just take the log difference of variables such as nominal exchange and read it like er_obs = er  er(1) + eps_er. I don’t understand why this is appropriate…I saw a lot of posts where people read variables like this, but I did not really understand why  er in the model is log deviation from steady state while er_obs is basically log difference of nominal rates → growth rate. How do these two match?
Thank you