code to estimate running continuum