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

Test avoiding InExactError by using TransformObservationModel #561

Closed
SamuelBrand1 opened this issue Dec 18, 2024 · 2 comments · Fixed by #562
Closed

Test avoiding InExactError by using TransformObservationModel #561

SamuelBrand1 opened this issue Dec 18, 2024 · 2 comments · Fixed by #562

Comments

@SamuelBrand1
Copy link
Collaborator

SamuelBrand1 commented Dec 18, 2024

As a reminder this is caused by the inference expecting Int valued returns but instead getting caught by a BigInt. This is possible with latent processes in the log domain which gets exp transformed and then linked with a neg binomial or Poisson distribution e.g.

julia> typemax(Int) |> log
# 43.66827237527655

We've tried a few approaches to stop this eg #492 .

This issue is about trying a TransformObservationModel composition with the usual obs processes to implement:

$$x \to - \log ( e^{-C} + e^{-x})$$

Where $C$ is a large float. In julia this is

using LogExpFunctions
const C = some_big_number
x -> -logaddexp(-C, -x)
@SamuelBrand1
Copy link
Collaborator Author

The point is that its smooth at the transition point but also effectively linear for most of the domain of relevance.

@SamuelBrand1
Copy link
Collaborator Author

Closed by #562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant