In the past many user repeatedly requested an one sided HP Filter in VBA. With just a few extra lines of code it is possible to extend my implementation of the HP Filter. It is a serial implementation. You have only have to add the code in the add-in or in your Excel sheet.
Best Kurt
'************************************************** '* Kurt Annen * '* 02.06.19 * '* One Sided HP filter * '* serial implementation * '* © 2019 [web:reg] Kurt Annen - www.web-reg.de * '************************************************** Function HP_OS_S(data As Range, lambda As Double) Dim nobs As Long, i As Long, j As Long, tmp1 As Variant, tmp2 As Variant, rng As Range nobs = data.Rows.Count ReDim tmp1(1 To nobs, 1 To 1) ' loop through time series For i = 1 To nobs Set rng = data.Resize(i, 1) tmp2 = HP(rng, lambda) tmp1(i, 1) = tmp2(i, 1) Next i Set rng = Nothing HP_OS_S= tmp1 End Function
Kim
Thank you so much.