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

Make log_lik methods correct by obtaining latent parameter draws #267

Closed
athowes opened this issue Aug 29, 2024 · 2 comments · Fixed by #474
Closed

Make log_lik methods correct by obtaining latent parameter draws #267

athowes opened this issue Aug 29, 2024 · 2 comments · Fixed by #474
Labels
medium Nice to have for next release public release

Comments

@athowes
Copy link
Collaborator

athowes commented Aug 29, 2024

In PR #259 we added a slightly incorrect version of the log_lik_latent_lognormal function. This allowed progress on model comparison in the Ebola vignette (#48).

It would be good to make this correct however.

For background see:

In short I see the two most promissing routes as:

  1. Try to put the required pwindow_raw and swindow_raw draws into some part of the prep object
  2. Use ... to pass in the fit object then extract the draws

Future investigation required to figure out how to do this!

@athowes athowes changed the title Make log_lik methods correct Make log_lik methods correct by obtaining latent parameter draws Aug 29, 2024
@athowes athowes added the medium Nice to have for next release label Aug 29, 2024
@seabbs
Copy link
Contributor

seabbs commented Nov 20, 2024

An easy way to do this is to refactor the approach to latent variables so that pwindow and window are defined via non-linear formulas as in the original vignette - that will in turn mean they are available as part of the prep object

@athowes
Copy link
Collaborator Author

athowes commented Nov 20, 2024

Fixed effect by case_id requires having case in the data (which it isn't right now).

seabbs added a commit that referenced this issue Nov 28, 2024
… latent likelihood (#474)

* first pass at refactoring latent model to use window formulas

* add docs to stan function

* check getting started -drive by fix plotting

* update approach to handling formulas

* get reparameterisation from brms itself vs enforcing manual declaration

* work on regexing:

* test manually setting new priors

* fix .replace_prior

* reset for pause

* add back in lower bounds

* revert pass in via formula

* add custom priors pass in

* write priors down more neatly

* add manual prior mode and optout

* clean up easy test failures

* use marginalised log likelihood

* debug marginalised likelihood

* workaround for liklihood vectorisation

* further increase prior complexity options

* update prior ordering

* catch printing issue for .replace_prior

* add news iteem

* add PR links

* speeed up test

* code read through

* clean up precommit

* turn off priorsense to check theory its numerical instability for extreme log lik values

* review comments
seabbs added a commit that referenced this issue Jan 10, 2025
… latent likelihood (#474)

* first pass at refactoring latent model to use window formulas

* add docs to stan function

* check getting started -drive by fix plotting

* update approach to handling formulas

* get reparameterisation from brms itself vs enforcing manual declaration

* work on regexing:

* test manually setting new priors

* fix .replace_prior

* reset for pause

* add back in lower bounds

* revert pass in via formula

* add custom priors pass in

* write priors down more neatly

* add manual prior mode and optout

* clean up easy test failures

* use marginalised log likelihood

* debug marginalised likelihood

* workaround for liklihood vectorisation

* further increase prior complexity options

* update prior ordering

* catch printing issue for .replace_prior

* add news iteem

* add PR links

* speeed up test

* code read through

* clean up precommit

* turn off priorsense to check theory its numerical instability for extreme log lik values

* review comments

Former-commit-id: 5f6baaa183c156a9d981a669f3717daed3806468 [formerly 9869c9563464c7752c57123f718bd66b3b08d5a3]
Former-commit-id: b1b61cbc1600a76b14924cf86eacf66c5acefbcb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium Nice to have for next release public release
Projects
None yet
2 participants