Skip to content

Speedup likelihood calc#16

Open
amn3142 wants to merge 5 commits intodangilman:mainfrom
amn3142:speedup_likelihood_calc
Open

Speedup likelihood calc#16
amn3142 wants to merge 5 commits intodangilman:mainfrom
amn3142:speedup_likelihood_calc

Conversation

@amn3142
Copy link
Copy Markdown
Contributor

@amn3142 amn3142 commented Jul 22, 2025

2 main changes:

  1. This speeds up the calculation: first if we don't have imaging data it doesn't do the densitysamples estimate for the array of ones, second, it only calculates the imaging data likelihood one time and not n-bootstraps times.

  2. Now can take a covariance matrix. Sending an email for how to estimate the covariance matrix. Haven't tested that this works properly TBH.

@dangilman
Copy link
Copy Markdown
Owner

@amn3142 I just push some changes to the main branch that implement the features in the pull request, let me know what you think. The compute_likelihoods function now returns the imaging likelihood, flux ratio likelihood, and then (parameters, weights), meaning it returns one fewer argument than before

@amn3142
Copy link
Copy Markdown
Contributor Author

amn3142 commented Jul 24, 2025 via email

@dangilman
Copy link
Copy Markdown
Owner

@amn3142 I think it's ok to keep the if statement there for backwards compatibility. And the imaging data stuff is inside the if boostrap_index == 0: statement, so it will only get computed once on the first pass through the for loop

@amn3142
Copy link
Copy Markdown
Contributor Author

amn3142 commented Jul 24, 2025 via email

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.

2 participants