lightkurve.correctors.
RegressionCorrector
(lc)¶Bases: lightkurve.correctors.corrector.Corrector
Remove noise using linear regression against a DesignMatrix
.
Given a column vector of data \(\y\) and a design matrix of regressors \(X\), we will find the vector of coefficients \(\w\) such that:
We will assume that the model fits the data within Gaussian uncertainties:
We make the regression robust by placing Gaussian priors on \(\w\):
We can then find the maximum likelihood solution of the posterior distribution \(p(\w  \y) \propto p(\y  \w) p(\w)\) by solving the matrix equation:
Where \(\covw\) is the covariance matrix of the coefficients:
LightCurve
The light curve that needs to be corrected.
Attributes Summary
Shorthand for self.design_matrix_collection. 
Methods Summary

Find the best fit correction for the light curve. 

Returns diagnostic plots to assess the most recent call to 

Returns a diagnostic plot visualizing how the bestfit coefficients compare against the priors. 
Attributes Documentation
X
¶Shorthand for self.design_matrix_collection.
Methods Documentation
correct
(self, design_matrix_collection, cadence_mask=None, sigma=5, niters=5, propagate_errors=False)¶Find the best fit correction for the light curve.
DesignMatrix
or DesignMatrixCollection
One or more design matrices. Each matrix must have a shape of (time, regressors). The columns contained in each matrix must be known to correlate with additive noise components we want to remove from the light curve.
Mask, where True indicates a cadence that should be used.
Standard deviation at which to remove outliers from fitting
Number of iterations to fit and remove outliers
Whether to propagate the uncertainties from the regression. Default is False. Setting to True will increase run time, but will sample from multivariate normal distribution of weights.
LightCurve
Corrected light curve, with noise removed.
diagnose
(self)¶Returns diagnostic plots to assess the most recent call to correct()
.
If correct()
has not yet been called, a ValueError
will be raised.
Axes
The matplotlib axes object.
diagnose_priors
(self)¶Returns a diagnostic plot visualizing how the bestfit coefficients compare against the priors.
The method will show the results obtained during the most recent call
to correct()
. If correct()
has not yet been called, a
ValueError
will be raised.
Axes
The matplotlib axes object.