Thanks a lot! I've fixed the script now. It seems the problem was not transposing quantile's output.

On Tue, Mar 16, 2010 at 12:52 AM, Allin Cottrell <cottrell@wfu.edu> wrote:

On Mon, 15 Mar 2010, [ISO-8859-1] Patricio Cuarón wrote:

> Hello. I'm trying to implement the Gallego-Johnson method for building
> confidence intervals for the HP filter. The methodology is explained in

http://www.bcentral.cl/estudios/documentos-trabajo/pdf/dtbc202.pdf

It appears they're plotting the 0.25 and 0.75 quantiles (they
don't state anywhere what confidence level they're using).

<script>
open fedstl.bin
# US real GDP
data gdpc96
smpl 1957:1 2001:04
scalar block = $nobs^{1/3}
series y = 100*log(gdpc96)
genr gap = hpfilt(y)
genr trend = y - gap
matrix A = {}
scalar n = 999
loop i=1..n --quiet
  # create series as trend + resampled cycle/gap
  boot_y = trend + resample(gap, block)
  # apply filter to get bootstrap gap
  boot_gap = hpfilt(boot_y)
  A ~= {boot_gap}
endloop

A = A'
series gap_hi = quantile(A, 0.75)'
series gap_lo = quantile(A, 0.25)'

gnuplot gap_lo gap gap_hi --single-yaxis --with-lines \
 --time --output=display
</script>

Allin Cottrell


_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users