Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Non-standard definition of density function for Gaussian distribution #67

Open
matt-graham opened this issue Mar 23, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@matt-graham
Copy link

In the documentation the expression given for the density of the Gaussian distribution assumed for the observation model

p \left (d_{i} | \Theta \right ) = \exp - \left [ (I_{i} - I_{pred, i}(\Theta ))^{2} / \sigma_{i}^{2} \right ]

omits a factor of 2 in the denominator of the term inside the exponential compared to the usual definition of the probability density function for a Gaussian distribution - that is I think the more usual definition would be

$$ p \left (d_{i} | \Theta \right ) = \exp - \left [ (I_{i} - I_{pred, i}(\Theta ))^{2} / (2 \sigma_{i}^{2}) \right ] $$

This is also reflected in the implementation of the log probability density passed to emcee

ret = -float(
((line.intensity_obs - intensity_pred) / line.sigma_intensity_obs) ** 2
)

While this will still give a proper (normalizable) probability density function and so shouldn't cause problems when running MCMC, it does mean the $\sigma_i$ parameters no longer can be interpreted as the standard deviation of the observation noise (but are instead $\sqrt{2}$ times the standard deviation), which could be confusing. It might be this is just a different notational convention which is standard for this application, but if so it might be worth adding an explanatory note to the documentation to avoid possibility of confusing people like me who are more used to the $\sigma_i$ being the standard deviation!

@matt-graham matt-graham changed the title Non-standard definition of density function for Gaussian function Non-standard definition of density function for Gaussian distribution Mar 23, 2023
@dstansby dstansby added the bug Something isn't working label Mar 23, 2023
@dstansby
Copy link
Owner

Thanks for pointing this out, and thanks for the clear explanation! Omitting the factor of two was not intentional, I shall label this as a bug that needs fixing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants