@ Below is an example of how your might call the Hodrick Prescott filer procedure below In this example I filter logged series - to compute percentage standard deviations of variables at business cycle frequencies I would then simply compute the standard deviations of the columns in varhp horizon = 200; lamda = 1600; hpmat=hpf(horizon,lambda); varhp = hpmat*(ln(consumption)~ln(GDP)~ln(investment)); @ proc hpf(n,l); @ Calculates an n x n matrix that can be used to compute cyclical component. inputs: n = number of observations in data set l = lambda (see Prescott, "Theory Ahead of Measurement..") output: hpfilt = n x n matrix @ local nobs,a,i,ai;nobs=n; a=zeros(nobs,nobs); a[1,1]=1+l;a[1,2]=-2*l; a[1,3]=l; a[2,1]=-2*l; a[2,2]=1+5*l; a[2,3]=-4*l; a[2,4]=l; a[nobs-1,nobs-3]=l; a[nobs-1,nobs-2]=-4*l; a[nobs-1,nobs-1]=1+5*l; a[nobs-1,nobs]=-2*l; a[nobs,nobs-2]=l; a[nobs,nobs-1]=-2*l; a[nobs,nobs]=1+l;i=3; do until i>(nobs-2); a[i,i]=1+6*l; a[i,i+1]=-4*l; a[i,i+2]=l; a[i,i-1]=-4*l; a[i,i-2]=l; i=i+1; endo; ai=eye(nobs)-inv(a); retp(ai); endp;