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

Add support for analytical solutions #32

Closed
2 of 3 tasks
seabbs opened this issue Sep 4, 2024 · 5 comments · Fixed by #90
Closed
2 of 3 tasks

Add support for analytical solutions #32

seabbs opened this issue Sep 4, 2024 · 5 comments · Fixed by #90
Labels
enhancement New feature or request

Comments

@seabbs
Copy link
Contributor

seabbs commented Sep 4, 2024

Quite a few of the distributions we are using have analytical solutions which could be used instead of the numerically solved integral. Examples include the exponential and gamma for the uniform primary event distribution case.

Performance wise it likely makes sense to use these analytical solutions where available and have a framework for adding new ones as they come available.

I think this would look like:

  • A new @family for analytical solutions
  • A argument to pass in R to use the analytical solutions if available (and default to true)
  • To avoid to much user facing args I am tempted to say we should just use the analytical solutions in stan directly but doing this would need some experimentation to make sure the auto-diff is okay.
@seabbs seabbs added the enhancement New feature or request label Sep 4, 2024
@seabbs
Copy link
Contributor Author

seabbs commented Sep 6, 2024

I think that this might prove difficult for most distribution combinations unfortunately even in the simple case with no truncation. I do think that we should be able to make some approximations and then get approximate analytical solutions for some special cases.

@seabbs
Copy link
Contributor Author

seabbs commented Sep 6, 2024

@jbracher suggests thinking about this using moment generating functions -> a couple of moments -> finding a distribution that matches with that.

@seabbs
Copy link
Contributor Author

seabbs commented Sep 6, 2024

I'm not sure how we could really go about doing this in stan though as we would need to match moments unless we can find a general approach/adapter?

@SamuelBrand1
Copy link
Collaborator

@seabbs Is this approach being superceded in #90 ?

@seabbs
Copy link
Contributor Author

seabbs commented Sep 20, 2024

It is essentially the same approach and so #85 is really a superset. I think #90 can close this

@seabbs seabbs linked a pull request Sep 20, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants