You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.. [Lomb1976] `Least-squares frequency analysis of unequally spaced data <http://adsabs.harvard.edu/abs/1976Ap%26SS..39..447L>`_
44
-
45
-
.. [Scargle1982] `Studies in astronomical time series analysis. II - Statistical aspects of spectral analysis of unevenly spaced data <http://adsabs.harvard.edu/abs/1982ApJ...263..835S>`_
46
-
47
-
.. [Barning1963] `The numerical analysis of the light-curve of 12 Lacertae <http://adsabs.harvard.edu/abs/1963BAN....17...22B>`_
48
-
49
-
.. [Vanicek1971] `Further Development and Properties of the Spectral Analysis by Least-Squares <http://adsabs.harvard.edu/abs/1971Ap%26SS..12...10V>`_
50
-
51
-
.. [VanderPlas2017] `'Understanding the Lomb-Scargle Periodogram <https://arxiv.org/abs/1703.09824>`_
52
-
53
-
54
41
55
42
Installing
56
43
----------
@@ -61,7 +48,7 @@ As long as you have ``scipy`` and ``numpy`` installed, you should be able to run
61
48
``pip install ftperiodogram`` and everything should work fine.
62
49
63
50
If this doesn't work, consult the instructions in ``CONDA_INSTALL.md`` for installing ``ftperiodogram`` and its dependencies with with
@@ -78,8 +65,7 @@ inside the ``notebooks/`` directory::
78
65
Updates
79
66
-------
80
67
81
-
* See the `issues <https://github.com/PrincetonUniversity/FastTemplatePeriodogram/issues>`_
82
-
section for known bugs! You can also submit bugs through this interface.
68
+
* See the `issues <https://github.com/PrincetonUniversity/FastTemplatePeriodogram/issues>`_section for known bugs! You can also submit bugs through this interface.
83
69
84
70
85
71
More information
@@ -101,8 +87,6 @@ multiband model that locked the phases, amplitudes and
101
87
offsets of all bands together. They found that template fitting was significantly more accurate for estimating periods of RR Lyrae stars, but the computational resources
102
88
needed for these fits were enormous (~30 minutes per object per CPU core).
103
89
104
-
.. [Sesar2017] https://arxiv.org/abs/1611.08596
105
-
106
90
How does the fast template periodogram improve things?
@@ -112,104 +96,76 @@ better way to perform these fits. Details will be presented in a paper
112
96
(Hoffman *et al.* 2017, *in prep*), but the important part is you can reduce
113
97
the non-linearity of the problem to the following:
114
98
115
-
* Finding the zeros of an order ``6H-1`` complex polynomial at each trial frequency
116
-
* This is done via the ``numpy.polynomial`` library, which performs singular-value decomposition on the polynomial "companion matrix", and scales as ``O(H^3)``.
117
-
* Computing the coefficients of these polynomials for all trial frequencies simultaneously by leveraging the non-equispaced fast Fourier transform, a process that scales as ``O(HN_f log(HN_f))``.
99
+
- Finding the zeros of an order ``6H-1`` complex polynomial at each trial frequency
100
+
- This is done via the ``numpy.polynomial`` library, which performs singular-value decomposition on the polynomial "companion matrix", and scales as ``O(H^3)``.
101
+
- Computing the coefficients of these polynomials for all trial frequencies simultaneously by leveraging the non-equispaced fast Fourier transform, a process that scales as ``O(HN_f log(HN_f))``.
118
102
119
103
This provides two advantages:
120
104
121
-
:Computational speed and scaling:
105
+
:Improved computational speed and scaling:
122
106
.. image:: plots/timing_vs_ndata_const_freq.png
107
+
Speed comparison for a test case using a constant
108
+
number of trial frequencies but varying the number
109
+
of observations.
123
110
111
+
:Numerically stable and accurate:
112
+
.. image:: plots/correlation_with_nonlinopt.png
113
+
Accuracy comparison between the fast template periodogram
114
+
and a ``gatspy``-like method that uses the ``scipy.optimize.minimize``
115
+
function to find the optimal phase shift parameter. The minimization
116
+
method is given 10 random starting values and the best result is kept.
117
+
Though in most cases the truly optimal solution is found, in many cases
118
+
a sub-optimal solution is chosen instead (i.e. only a locally optimal
119
+
solution was chosen).
124
120
125
-
* The non-equispaced fast Fourier transform (NFFT)
126
-
* Polynomial zero-finding
127
-
128
-
The FTP is a non-linear extension of the GLS. The nonlinearity
129
-
of the problem can be reduced to finding the zeros of
130
-
a complex, order `6H-1` polynomial at each trial frequency.
131
-
132
-
Templates are assumed to be well-approximated by a short truncated Fourier series
133
-
of length `H`. Using this representation, the optimal parameters
134
-
(amplitude, phase, offset) of the template fit at a given trial frequency
135
-
can then be found *exactly* after finding the roots of
136
-
a polynomial at each trial frequency.
137
-
138
-
The coefficients of these polynomials involve sums that can be efficiently
139
-
evaluated with non-equispaced fast Fourier transforms. These sums
140
-
can be computed in `O(HN_f log(HN_f))` time.
141
-
142
-
In its current state, the root-finding procedure is the rate limiting step.
143
-
This unfortunately means that for now the fast template periodogram scales as
144
-
`N_f*(H^3)`. We are working to reduce the computation time so that the entire
145
-
procedure scales as `HN_f log(HN_f)` for reasonable values of `H` (`< 10`).
146
121
147
-
However, even for small cases where `H=6` and `N_obs=10`, this procedure is
148
-
about an order of magnitude faster than the `gatspy` template modeler.
122
+
How is this different than the multi-harmonic periodogram?
### How is this different than the multi-harmonic periodogram?
152
-
153
-
The multi-harmonic periodogram ([Bretthorst 1988](https://link.springer.com/book/10.1007%2F978-1-4684-9399-3), [Schwarzenberg-Czerny (1996)](http://iopscience.iop.org/article/10.1086/309985/meta)) is another
125
+
The multi-harmonic periodogram ([Bretthorst1988]_,[SchwarzenbergCzerny1996]_) is another
154
126
extension of Lomb-Scargle that fits a truncated Fourier series to the data
155
-
at each trial frequency. This is nice if you have a strong non-sinusoidal signal
156
-
and a large dataset. This algorithm can also be made to scale as
The FTP scales sub-linearly to linearly with the number of harmonics `H`
187
-
for `H < 10`, and for larger number of harmonics scales as `H^3` (since
188
-
zeros are found via singular value decomposition of the polynomial companion matrix).
189
-
This limits the set of templates to those that are sufficiently approximated by a small
190
-
number of Fourier terms.
153
+
.. [Lomb1976] `Least-squares frequency analysis of unequally spaced data <http://adsabs.harvard.edu/abs/1976Ap%26SS..39..447L>`_
191
154
192
-
### Accuracy
155
+
.. [Scargle1982] `Studies in astronomical time series analysis. II - Statistical aspects of spectral analysis of unevenly spaced data <http://adsabs.harvard.edu/abs/1982ApJ...263..835S>`_
193
156
194
-
Compared with the Gatspy template modeler, the FTP provides improved accuracy as well as speed.
195
-
For many values of `p(freq)`, the FTP correlates strongly with results obtained from
196
-
non-linear optimization. However, since the problem is not convex, the solution recovered from
197
-
non-linear optimization techniques may only represent a *local* minima. FTP, on the other
198
-
hand, solves for all local minima simultaneously, from which the globally optimal solution can be
199
-
found easily.
157
+
.. [Barning1963] `The numerical analysis of the light-curve of 12 Lacertae <http://adsabs.harvard.edu/abs/1963BAN....17...22B>`_
200
158
201
-

159
+
.. [Vanicek1971] `Further Development and Properties of the Spectral Analysis by Least-Squares <http://adsabs.harvard.edu/abs/1971Ap%26SS..12...10V>`_
202
160
161
+
.. [VanderPlas2017] `Understanding the Lomb-Scargle Periodogram <https://arxiv.org/abs/1703.09824>`_
203
162
204
-
The FTP requires that templates be *approximated* by a truncated Fourier expansion. The figure
205
-
below compares the template periodograms for a single template approximated by different numbers
206
-
of harmonics:
163
+
.. [Sesar2017] https://arxiv.org/abs/1611.08596
207
164
208
-

0 commit comments