Conversation
| # get metric and amplitude for the current kernel and channel | ||
| amp = np.exp(self.coeffs[c, k, 0]) | ||
| metric = np.exp(self.coeffs[c, k, 1]*2) | ||
| sigma = np.sqrt(np.exp(self.coeffs[c, k, 0])) |
There was a problem hiding this comment.
I'm pretty sure sigma shouldn't be square-rooted, right?
There was a problem hiding this comment.
Looking at the george API, the amplitude (sigma^2) that the kernel is multiplied by is just exp(A). In tinygp, we can also do this the same way, but the kernels.quasisep package supposedly speeds things up slightly by letting you pass in sigma on its own to the kernel function. So, sigma should be sqrt(exp(A)), but it may be clearer to just keep the amp = np.exp(self.coeffs[c, k, 0]) and then do sigma = np.sqrt(amp).
…o celerite_sho
Yeah, the george API specifies that the metric is squared, where celerite2 and tinygp don't. The typo was in the original placeholder code for the tinygp kernels, where it was copied as-is from the george implementation and as such also squared the metric, when it shouldn't have. That's been fixed in this PR. |
|
Thanks @jbrande! I've totally messed up the target repo (jaxoplanet) while trying to re-work things, so at present here are merge conflicts that are blocking me from accepting the PR. I'll take care of those myself though, so from you're end you're all good to go and this PR is conditionally accepted! |
|
Thanks for the heads up! Sounds good. |
Summary
This PR enables users to select SHO kernels for their GPs when using Celerite2. The SHO kernel takes in the same log-amplitude
Aand log-timescalem, as well as the quality factor of the oscillatorQ.Why
The existing Matern 3/2 kernel is useful and extensible, but does not necessarily give any physical intuition about the system being observed. A stochastically driven damped harmonic oscillator can reasonably model physical processes commonly seen in transit lightcurves, with the appropriate choice of quality factor. E.g.
Q = 1/sqrt(2)can describe stellar granulation in lightcurves.Key Changes
GPModel.pynow allows forSHOkernel choice forceleriteGPs. and automatically parses the EPF for all three parametersA, m, Q.docs/source/ecf.rstalso now describes the parameters and explains the motivation for the new GP kernel.demos/JWST/S5_template.ecfanddemos/JWST/S5_fit_par_template.epfalso give useful examples for the new GP kernel.Testing
I've run some tests using the SHO kernel on some very small datasets, but haven't yet exhaustively tried different
Qvalues, or tried to get equivalent results by settingQ=0.5(which should collapse to the Matern 3/2 kernel). I also haven't tested multi-channel datasets or shared GP parameters yet.