The supersmoother is a non-parametric adaptive smoother which has been used within the astronomical literature as an estimator of periodic content. For each candidate frequency, the supersmoother algorithm is applied to the phased data and the model scatter is computed. The period for which the model error is minimized is reported as the best period.
The standard, single-band supersmoother is implemented in the
SuperSmoother algorithm. The main parts of the API discussion from
Lomb-Scargle Periodogram apply here as well. Here is an example of using
the supersmoother to find the best period of an RR Lyrae star. Note that the
supersmoother algorithm is much slower than even the slow version of Lomb
Scargle; for this reason we’ll narrow the period search range for the sake
of this example:
In : from gatspy import datasets, periodic In : rrlyrae = datasets.fetch_rrlyrae() In : lcid = rrlyrae.ids In : t, mag, dmag, filts = rrlyrae.get_lightcurve(lcid) In : mask = (filts == 'r') In : t_r, mag_r, dmag_r = t[mask], mag[mask], dmag[mask] In : model = periodic.SuperSmoother(fit_period=True) In : model.optimizer.period_range = (0.61, 0.62) In : model.fit(t_r, mag_r, dmag_r);
Now the best period is stored in a class attribute:
In : model.best_period Out: 0.61432002634119753
Let’s take a look at the best-fit supersmoother model at this period:
As you can see, the supersmoother method is very flexible and essentially creates a smooth nonparametric model at each frequency. We can construct the analog of the Lomb-Scargle periodogram using the supersmoother as well:
The supersmoother periodogram shows a clear spike at a period of around 0.62 days.
gatspy.periodic module also contains a multiband version of the
supersmoother. Unlike the multiband lomb-scargle, there is no attempt here to
make the smoothing on each band consistent: the multiband model consists of
separate smooths on each band, with the weighted added to produce
the final score. Here is an example of this periodogram computed on some test
By combining the five models, we find a “periodogram” which isolates the unknown peak.