%% HP filter for theta %% Pmk times series % 1980Q1-2020Q2, import price of intermediate goods function xx=AR1hp_c_theta_pmk(xx) data = xlsread('NewKoreanData.xlsx','Shocks','B85:B246'); data = log(data); [~, data] = hpfilter(data,1600); xx = AR1theta(data); function theta = AR1theta(y) x = y(1:end-1); y = y(2:end); x = [ones(length(x),1) x]; B = (x'*x)\(x'*y); theta = B(2); end end