Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jacobian term shouldn't be included when transforming loglikelihoods #1705

Open
frankiepe opened this issue Feb 20, 2025 · 7 comments
Open

Comments

@frankiepe
Copy link

When working in a transformed parameter space to perform maximum likelihood estimation, we don't need to include the Jacobian term provided we are not also transforming the data.

This follows from the "invariance property of the ML estimator": https://en.wikipedia.org/wiki/Maximum_likelihood_estimation

@MichaelClerx
Copy link
Member

MichaelClerx commented Feb 20, 2025

I think this means we need to update the Transformation class to have a transform_logpdf and a transform_loglikelihood.
To do that, we'll need to start distinguishing between unnormalised log pdfs (which take a random variable as input) and loglikelihoods (which take a non-random variable as input, plus data sampled from some distribution (but fixed)). Might have some far-reaching consequences software wise...

See #457

The use case for this is performing MLP using the Transform class and an optimiser: at the moment that uses the transform_logpdf method even if you pass it a likelihood

@MichaelClerx
Copy link
Member

Thoughts @ben18785 , @martinjrobins , @chonlei ?

@martinjrobins
Copy link
Member

is this just for MLP? How about if the likelihood is part of a log posterior, do you transform its output then?

@MichaelClerx
Copy link
Member

No but you'd have [changed prior] * [unchanged likelihood] = [changed pdf]. So the likelihood itself would be treated the same as in MLE, but the posterior would still change due to the prior changing.

@MichaelClerx
Copy link
Member

@martinjrobins
Copy link
Member

No but you'd have [changed prior] * [unchanged likelihood] = [changed pdf]. So the likelihood itself would be treated the same as in MLE, but the posterior would still change due to the prior changing.

so the likelihood is multiplied by a factor (lets say A where A = dp(sigma)/dsigma is the jacobian of the pdf) due to the change of variables, but MLE is unaffected by this since A is constant wrt the parameters sigma. The prior has an A that might be dependent on the parameters, so this needs to be transformed. More broadly, any logpdf that has a jacobian that is constant wrt the parameters sigma does not need to be transformed. So perhaps a pints logpdf can have a function that returns a bool indicating if its jacobian is constant wrt the parameters? Then the Transformation class can just check this?

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

No branches or pull requests

3 participants