Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using scikit-learn's robust linear estimator fitting inside SFFCorrector #174

Open
barentsen opened this issue Jan 15, 2018 · 0 comments

Comments

@barentsen
Copy link
Member

barentsen commented Jan 15, 2018

Right now, in SFFCorrector, we fit the motion polynomials as follows:

            # Next, we fit the motion polynomial after removing outliers
            self.outlier_cent = sigma_clip(data=self.rot_col,
                                           sigma=sigma_2).mask
            coeffs = np.polyfit(self.rot_row[~self.outlier_cent],
                                self.rot_col[~self.outlier_cent], polyorder)
            self.poly = np.poly1d(coeffs)
            self.polyprime = np.poly1d(coeffs).deriv()

The fitting is made robust by applying sigma-clipping before polyfit. This isn't great because the sigma-clipping is not relative to e.g. the running mean.

It may be better to use a different robust fitting technique, e.g. see here: http://scikit-learn.org/stable/auto_examples/linear_model/plot_robust_fit.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants