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

Update intercept detection and prior plotting #298

Merged
merged 3 commits into from
Jul 16, 2023
Merged

Conversation

bwiernik
Copy link
Contributor

@bwiernik bwiernik commented Jul 7, 2023

Fixes #297

I changed the regex from "starts with 'intercept'" to just "contains 'intercept'" so that it captures things like "b_intercept" and "b_zi_intercept".

I don't think it's a problem to not require intercept to be at the beginning--examples that I can think of where this would be a problem would be false positive captured just the same with the "starts with" restriction (e.g., "interception" in football modeling)

The x %in% .intercepts() part isn't really necessary at this point, but I left it in in the event that we come across a model class that uses a term other than intercept, such as "constant".

Edit: Also fixed the prior ridgeline plotting, which was ignoring the parameter argument from parameters table if supplied. This was also reported in #297.

Fixes #297

I changed the regex from "starts with 'intercept'" to just "contains 'intercept'" so that it captures things like `"b_intercept"` and `"b_zi_intercept"`.

I don't think it's a problem to not require intercept to be at the beginning--examples that I can think of where this would be a problem would be false positive captured just the same with the "starts with" restriction (e.g., "interception" in football modeling)
@bwiernik bwiernik changed the title Update intercept detection Update intercept detection and prior plotting Jul 7, 2023
@strengejacke
Copy link
Member

I changed the regex from "starts with 'intercept'" to just "contains 'intercept'" so that it captures things like "b_intercept" and "b_zi_intercept".

Shouldn't that already work, see this helper function:

see/R/utils.R

Line 116 in 3c7ad13

.intercepts <- function() {

@bwiernik
Copy link
Contributor Author

bwiernik commented Jul 10, 2023

No, that set matches words exactly --the regex I proposed matches things like "intercept[2]" that appear for models like ordinal or multinomial in brms and other packages. Currently those models the intercept filtering fails. See the linked issue

@strengejacke
Copy link
Member

examples that I can think of where this would be a problem would be false positive captured just the same with the "starts with" restriction (e.g., "interception" in football modeling)

What if we modify the regex like suggested in our discussion:
(?i)intercept[^a-zA-Z]
?

@bwiernik
Copy link
Contributor Author

That's a good call. Will do that

@strengejacke
Copy link
Member

No, that set matches words exactly

Yes, I know. I was just referring to your examples so that it captures things like "b_intercept" and "b_zi_intercept", which should be covered by the exact matches. The remaining cases should be covered by the regex.

@bwiernik bwiernik merged commit 04acb0a into main Jul 16, 2023
@bwiernik bwiernik deleted the show_intercept branch July 16, 2023 16:33
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.

show_intercept = FALSE doesn't work for brms ordinal models
2 participants