exoplanet-dev / exoplanet-dev/celerite2

Combining SHO and Rotation terms derivative issue

Open
#161 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
85
Forks
19
PR merge metrics
No merged PRs in 30d

Description

I've been having an issue combining SHO and Rotation terms for describing stellar light curves. I've tried on many light curves, in many environments, devices, and with the PyMC3 and PyMCv5 versions of exoplanet. Troubleshooting has led me to believe the issue is in the the derivative of the log probability when both terms are combined; the derivate is very "spiky", leading to the scipy optimization step (pmx.optimize) either failing to improve log p due to precision loss or jumping the GP parameters into unreasonable values given their priors. Any NUTS sampling also fails, as the step size is too small and max tree depth is reached with every step.

To further try to troubleshoot the issue, I just ran the tutorial workbook Gaussian Process Models for Stellar Variability (https://gallery.exoplanet.codes/tutorials/stellar-variability/) which incorporates a kernel that is the sum of an SHO and Rotation term. Running that notebook after in an environment with exoplanet==0.5.3 and celerite2==0.3.2 yields the following outputs.

From defining the model, and running pmx.optimize():

Image

From attempting to sample:

Image

The convergence checks and posterior:

Image

Image

I noticed that the published version of the notebook uses exoplanet version 0.5.4.dev27+g75d7fcc, so I created a cloned environment, upgraded exoplanet to that version, and found a commit of celerite2 pushed on the same day (celerite2-0.3.2.dev1+g50193ff)...and it worked!

Result from pmx.optimize():

Image

Result of sampling:

Image

Convergence check and posterior:

Image

Image

So it seems something since that version of celerite2 has broken the ability to add those two terms. Using either term alone seems to work fine, but not in combination.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.