In a post on my Blog in December 2011 I discussed how the Hodrick-Prescott filter can be viewed as the solution to a regression problem, and how this then enables one to construct confidence bands for the extracted trend component. Eviews and gretl files that implement this idea, are available on this site. The gretl files are courtesy of Riccardo ("Jack") Luccetti.