Hey there,
I'm sort of porting some functionality from our partner's matlab code and luckily statsmodels already has lowess.
That said, I noticed the output of statsmodel's lowess is less robust to outliers compared to matlab's.
I do know in the equivalent matlab code, it's using the "rlowess" method instead of just the "lowess" (`smooth(hrv_vals,0.1,'rlowess')`), which according to matlab's docs:
A robust version of 'lowess'
that assigns lower weight to outliers in the regression. The method assigns zero weight to data outside six mean absolute deviations.
A few visual examples below. All of those plots have the matlab version above, and the python attempt below.
Any ideas how to proceed?
Best,
Leon Sasson