Comments (6)
Interesting – thanks for putting this together.
Given how complex the various routines are that lead to this, I think the most fruitful way to track down the bug will be to make sure each component is well tested. My suspicion from playing around with the nfft is that there may be corner cases where the fast summations do not accuratly approximate the true summations – if we could add an option to build the periodogram using direct summations, that could help.
It might also be some kind of interaction between errors in root finding and errors in summation approximation. But I wouldn't dive into those kind of second order effects until each component is understood and validated by comprehensive unit tests.
from fasttemplateperiodogram.
Hi Jake,
Thanks for the feedback -- the computations above (which use the new fit_template
function) only use direct_summations
, so this is independent of the NFFT. I suspect there may be some numerical instabilities somewhere that cause the problem at certain phase shifts. Root finding from computed coefficients is known to be unstable with certain algorithms and with certain classes of polynomials (closely spaced roots, large variations in coefficient amplitudes, etc), so that may explain some of the problem.
However, I'm still currently baffled by why the reported fit parameters should be inconsistent with the reported periodogram value, since they both are computed from the same set of variables, and the periodogram computation depends explicitly on the phase shift.
I'll keep adding tests and digging deeper. I'm working on reviewing a JOSS article at the moment, so I'll get back to this a bit later tonight, but feel free to poke around if you have any ideas.
John
from fasttemplateperiodogram.
Another note -- this branch implements unit tests that compare direct_summations
against fast_summations
, and everything passes. Doesn't have any bearing on this problem (I don't think), but that should give some additional peace of mind about the NFFT operations. And, since they're unit tested, you can run amok with any speedup ideas for the fast_summations
function if you feel like it.
from fasttemplateperiodogram.
Ah, I missed that part. Good to know.
from fasttemplateperiodogram.
Long story short, I tracked this down to a couple of issues.
-
One was a mistake in the
PseudoPolynomial.root_finding_poly()
method. Originally, the method would return(1 - x^2)p^2(x) - q^2(x)
, however, this should bep^2(x) - (1 - x^2)q^2(x)
. -
The phase shift parameter, which has caused much grief, was also incorrect, and this was a result of the affine transformation of the observation times to the
(-1/2, 1/2)
range that was required by NFFT. I had hacked together what I thought was a fix, but this should really be taken care of by thefast_summations
function. Now, the results of the NFFT are multiplied by a set oftwiddle
factors, which correct for the transformation.
Everything should now be fixed as of commit b30e775ef1684c64d3e5574dce30bd7ad8d6241a
.
from fasttemplateperiodogram.
Great! Glad to hear you were able to track-down these problems.
from fasttemplateperiodogram.
Related Issues (15)
- py.test --pyargs pyftp fails HOT 1
- Need a new package name HOT 4
- Speed up computed_summations HOT 5
- Speed up tests HOT 3
- Code Organization HOT 1
- Use Polynomial API in PseudoPolynomial? HOT 1
- Concern: ``remove_zeros`` in ``pseudo_poly`` HOT 1
- Rename FastTemplateModeler HOT 2
- Some code questions... HOT 6
- Multiplication of `PseudoPolynomial` with `Polynomial` is not commutative HOT 2
- Use ``nfft`` rather than ``pynfft``? HOT 3
- make test HOT 4
- get_best_model() does not return the optimal parameters... HOT 2
- Cannot Instantiate RRLyrae Modeler HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fasttemplateperiodogram.