added geometric average.
Set neutral type names, replacing stock/flow/deflator.time-shift
parent
d35ee4b58e
commit
e7442bcf78
|
@ -7,9 +7,10 @@ function [ya, yass, gya, gyass] = quarterly2annual(y,yss,GYTREND0,type,islog)
|
||||||
% y quarterly time series
|
% y quarterly time series
|
||||||
% yss steady state of y
|
% yss steady state of y
|
||||||
% GYTREND0 growth rate of y
|
% GYTREND0 growth rate of y
|
||||||
% type 1 flow (default)
|
% type 1 sum (default)
|
||||||
% 2 deflator
|
% 2 average
|
||||||
% 0 stock
|
% 3 last period (Q4)
|
||||||
|
% 4 geometric average
|
||||||
% islog 0 level (default)
|
% islog 0 level (default)
|
||||||
% 1 log-level
|
% 1 log-level
|
||||||
%
|
%
|
||||||
|
@ -62,6 +63,10 @@ switch type
|
||||||
case 3
|
case 3
|
||||||
yass=yss;
|
yass=yss;
|
||||||
tmp = y;
|
tmp = y;
|
||||||
|
case 4
|
||||||
|
yass = yss*(exp(-GYTREND0*3/2));
|
||||||
|
tmp = (lagged(y+yss,3)*exp(-GYTREND0*3).*lagged(y+yss,2)*exp(-GYTREND0*2).*lagged(y+yss,1)*exp(-GYTREND0).*(y+yss)).^(1/4); % annualized level
|
||||||
|
tmp = tmp - yass;
|
||||||
otherwise
|
otherwise
|
||||||
error('Wrong type input')
|
error('Wrong type input')
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue