Skip to content

Preserve real-kernel variance for short exposures - #199

Open
antonsoo wants to merge 1 commit into
exoplanet-dev:mainfrom
antonsoo:fix/short-real-exposure-convolution
Open

antonsoo wants to merge 1 commit into
exoplanet-dev:mainfrom
antonsoo:fix/short-real-exposure-convolution

Conversation

@antonsoo

Copy link
Copy Markdown

A short positive exposure can erase the covariance of a real exponential term:

from celerite2 import terms

kernel = terms.TermConvolution(terms.RealTerm(a=1.2, c=0.08), delta=1e-7)
print(kernel.get_value(0.0))
# Before: [0.]; after: approximately [1.2]

The boxcar-averaged variance should approach 1.2 as the exposure tends to zero. Direct cosh(x) - 1 and sinh(x) - x evaluations lose their small results, affecting both the explicit kernel and the native factorization coefficients.

For small arguments, use the identity cosh(x) - 1 = 2 sinh(x/2)**2 and the series for sinh(x) - x through order nine. Keep the existing expressions for larger arguments and apply the stable evaluations consistently to real convolution coefficients, the diagonal correction and direct kernel values.

Regression tests compare single/summed real terms and native solves with independent boxcar quadrature and SciPy dense Cholesky solves. The core suite and configured pre-commit hooks pass; optional backends remain skipped. Separate recorded-signal runs also verify native covariance reconstruction, predictive mean/variance and likelihood. This change addresses real components with positive widths; complex-component cancellation and zero-width handling are outside its scope.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant