CosmoStat / autometacal

Metacalibration and shape measurement by automatic differentiation
MIT License
3 stars 1 forks source link

Impact of finite differences on metacalibration #38

Open EiffL opened 2 years ago

EiffL commented 2 years ago

The zeroth order thing we want to check is whether the fact that ngmix relies on finite differences to measure the gradients can have a measurable impact on the response matrix, on a galaxy per galaxy basis, and more importantly for a sample of galaxies.

Things to do for this:

EiffL commented 2 years ago

I'm gonna start by ctr+c/ctr+v a preliminary plot made by @andrevitorelli showing the relative error between responses as measured by finite diff vs auto diff on a galaxy per galaxy basis: snr_10_1000_log_steps (showing the results for various SNR from 10 to 1000)

This would seem to indicate that the relative gradient error would can be of order 1%, but that's on a galaxy per galaxy basis.

andrevitorelli commented 2 years ago

For the entire sample, estimate the impact of errors, do they average out?

R: No.

difference_of_medians_auto_finite

andrevitorelli commented 2 years ago

For the penultimate question, I will do the tf vs ngmix test on different levels of shear, and see the residual m between AD & FD respective to different step sizes.

andrevitorelli commented 2 years ago

On the question

Answer the question: Should we worry about using finite differences in practice?

It seems that no, when we're at m ~5e-2. Lower than that it might get different. ~Plots~ Numbers coming soon...