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

Beta >0 in Tables #54

Open
amarkelkar opened this issue Sep 17, 2021 · 4 comments
Open

Beta >0 in Tables #54

amarkelkar opened this issue Sep 17, 2021 · 4 comments

Comments

@amarkelkar
Copy link

I'm working on a CEA and running into the issue of Amua telling me that the analysis won't run because the b-value in a Beta distribution must >0 [Beta(a,b,~)]. However, I've double-checked my tables and none of the listed values are 0. I also ran individual tables and identified 2 tables that were the issue, but I can't figure out why those two are having issues while the others are not. I've double-checked my code and there's nothing different about how I'm referencing those two tables: if (n_Tx_line==3, Beta(p_Progression_3rd_line_CAR_Table[n_CAR_months,6], p_Progression_3rd_line_CAR_Table[n_CAR_months,5], ~),0)

I'm not sure if this is an issue with interpolation creating some "0" values or something else ... has anyone else experienced this or have any advice?

@zward
Copy link
Owner

zward commented Sep 18, 2021

It sounds like it could be an interpolation issue. What type of interpolation are you using for the tables? If cubic splines, there may be some oscillations that dip below 0 (usually near the bounds). You could try calling/plotting different values returned from the table to see if this is the case.
Another approach (more of a hack) could be to use abs() or max(), or add a small constant to ensure the values are positive, or interpolate in log-space and exponentiate to ensure b>0.

@amarkelkar
Copy link
Author

Thanks for the suggestions. I've tried switching to Linear interpolation without any improvement. I also tried putting max() and abs() limits both inside and outside my Beta() statements without resolution either.
Screenshot 2021-09-19 205437

@zward
Copy link
Owner

zward commented Sep 21, 2021

If you send me a copy of the model (zward@hsph.harvard.edu) - or another reproducible example - I can try to debug to see what is going on.

@amarkelkar
Copy link
Author

Thanks so much Zach! I just sent it to you.

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

2 participants