-
-
Notifications
You must be signed in to change notification settings - Fork 40
"all"
should not include group levels
#1064
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Suggested change in this PR: library(insight)
model <- insight::download_model("brms_chocomini_1")
find_parameters(model, effects = "fixed")
#> Loading required namespace: rstan
#> $conditional
#> [1] "b_Intercept"
#>
#> $delta
#> [1] "b_delta_Intercept"
#>
#> $k
#> [1] "b_k_Intercept"
#>
#> $phi
#> [1] "b_phi_Intercept"
find_parameters(model, effects = "all")
#> $conditional
#> [1] "b_Intercept"
#>
#> $random
#> [1] "sd_Participant__Intercept"
#>
#> $delta
#> [1] "b_delta_Intercept"
#>
#> $k
#> [1] "b_k_Intercept"
#>
#> $phi
#> [1] "b_phi_Intercept"
#>
#> $delta_random
#> [1] "sd_Participant__delta_Intercept"
#>
#> $k_random
#> [1] "sd_Participant__k_Intercept"
find_parameters(model, effects = "random_variance")
#> $random
#> [1] "sd_Participant__Intercept"
#>
#> $delta_random
#> [1] "sd_Participant__delta_Intercept"
#>
#> $k_random
#> [1] "sd_Participant__k_Intercept"
find_parameters(model, effects = "grouplevel")
#> $random
#> [1] "r_Participant[S001,Intercept]" "r_Participant[S002,Intercept]"
#> [3] "r_Participant[S003,Intercept]" "r_Participant[S004,Intercept]"
#> [5] "r_Participant[S005,Intercept]" "r_Participant[S006,Intercept]"
#> [7] "r_Participant[S007,Intercept]" "r_Participant[S008,Intercept]"
#> [9] "r_Participant[S009,Intercept]" "r_Participant[S010,Intercept]"
#> [11] "r_Participant[S011,Intercept]" "r_Participant[S012,Intercept]"
#> [13] "r_Participant[S013,Intercept]" "r_Participant[S014,Intercept]"
#> [15] "r_Participant[S015,Intercept]" "r_Participant[S016,Intercept]"
#> [17] "r_Participant[S017,Intercept]" "r_Participant[S018,Intercept]"
#> [19] "r_Participant[S019,Intercept]" "r_Participant[S020,Intercept]"
#>
#> $delta_random
#> [1] "r_Participant__delta[S001,Intercept]"
#> [2] "r_Participant__delta[S002,Intercept]"
#> [3] "r_Participant__delta[S003,Intercept]"
#> [4] "r_Participant__delta[S004,Intercept]"
#> [5] "r_Participant__delta[S005,Intercept]"
#> [6] "r_Participant__delta[S006,Intercept]"
#> [7] "r_Participant__delta[S007,Intercept]"
#> [8] "r_Participant__delta[S008,Intercept]"
#> [9] "r_Participant__delta[S009,Intercept]"
#> [10] "r_Participant__delta[S010,Intercept]"
#> [11] "r_Participant__delta[S011,Intercept]"
#> [12] "r_Participant__delta[S012,Intercept]"
#> [13] "r_Participant__delta[S013,Intercept]"
#> [14] "r_Participant__delta[S014,Intercept]"
#> [15] "r_Participant__delta[S015,Intercept]"
#> [16] "r_Participant__delta[S016,Intercept]"
#> [17] "r_Participant__delta[S017,Intercept]"
#> [18] "r_Participant__delta[S018,Intercept]"
#> [19] "r_Participant__delta[S019,Intercept]"
#> [20] "r_Participant__delta[S020,Intercept]"
#>
#> $k_random
#> [1] "r_Participant__k[S001,Intercept]" "r_Participant__k[S002,Intercept]"
#> [3] "r_Participant__k[S003,Intercept]" "r_Participant__k[S004,Intercept]"
#> [5] "r_Participant__k[S005,Intercept]" "r_Participant__k[S006,Intercept]"
#> [7] "r_Participant__k[S007,Intercept]" "r_Participant__k[S008,Intercept]"
#> [9] "r_Participant__k[S009,Intercept]" "r_Participant__k[S010,Intercept]"
#> [11] "r_Participant__k[S011,Intercept]" "r_Participant__k[S012,Intercept]"
#> [13] "r_Participant__k[S013,Intercept]" "r_Participant__k[S014,Intercept]"
#> [15] "r_Participant__k[S015,Intercept]" "r_Participant__k[S016,Intercept]"
#> [17] "r_Participant__k[S017,Intercept]" "r_Participant__k[S018,Intercept]"
#> [19] "r_Participant__k[S019,Intercept]" "r_Participant__k[S020,Intercept]"
find_parameters(model, effects = "random")
#> $random
#> [1] "r_Participant[S001,Intercept]" "r_Participant[S002,Intercept]"
#> [3] "r_Participant[S003,Intercept]" "r_Participant[S004,Intercept]"
#> [5] "r_Participant[S005,Intercept]" "r_Participant[S006,Intercept]"
#> [7] "r_Participant[S007,Intercept]" "r_Participant[S008,Intercept]"
#> [9] "r_Participant[S009,Intercept]" "r_Participant[S010,Intercept]"
#> [11] "r_Participant[S011,Intercept]" "r_Participant[S012,Intercept]"
#> [13] "r_Participant[S013,Intercept]" "r_Participant[S014,Intercept]"
#> [15] "r_Participant[S015,Intercept]" "r_Participant[S016,Intercept]"
#> [17] "r_Participant[S017,Intercept]" "r_Participant[S018,Intercept]"
#> [19] "r_Participant[S019,Intercept]" "r_Participant[S020,Intercept]"
#> [21] "sd_Participant__Intercept"
#>
#> $delta_random
#> [1] "r_Participant__delta[S001,Intercept]"
#> [2] "r_Participant__delta[S002,Intercept]"
#> [3] "r_Participant__delta[S003,Intercept]"
#> [4] "r_Participant__delta[S004,Intercept]"
#> [5] "r_Participant__delta[S005,Intercept]"
#> [6] "r_Participant__delta[S006,Intercept]"
#> [7] "r_Participant__delta[S007,Intercept]"
#> [8] "r_Participant__delta[S008,Intercept]"
#> [9] "r_Participant__delta[S009,Intercept]"
#> [10] "r_Participant__delta[S010,Intercept]"
#> [11] "r_Participant__delta[S011,Intercept]"
#> [12] "r_Participant__delta[S012,Intercept]"
#> [13] "r_Participant__delta[S013,Intercept]"
#> [14] "r_Participant__delta[S014,Intercept]"
#> [15] "r_Participant__delta[S015,Intercept]"
#> [16] "r_Participant__delta[S016,Intercept]"
#> [17] "r_Participant__delta[S017,Intercept]"
#> [18] "r_Participant__delta[S018,Intercept]"
#> [19] "r_Participant__delta[S019,Intercept]"
#> [20] "r_Participant__delta[S020,Intercept]"
#> [21] "sd_Participant__delta_Intercept"
#>
#> $k_random
#> [1] "r_Participant__k[S001,Intercept]" "r_Participant__k[S002,Intercept]"
#> [3] "r_Participant__k[S003,Intercept]" "r_Participant__k[S004,Intercept]"
#> [5] "r_Participant__k[S005,Intercept]" "r_Participant__k[S006,Intercept]"
#> [7] "r_Participant__k[S007,Intercept]" "r_Participant__k[S008,Intercept]"
#> [9] "r_Participant__k[S009,Intercept]" "r_Participant__k[S010,Intercept]"
#> [11] "r_Participant__k[S011,Intercept]" "r_Participant__k[S012,Intercept]"
#> [13] "r_Participant__k[S013,Intercept]" "r_Participant__k[S014,Intercept]"
#> [15] "r_Participant__k[S015,Intercept]" "r_Participant__k[S016,Intercept]"
#> [17] "r_Participant__k[S017,Intercept]" "r_Participant__k[S018,Intercept]"
#> [19] "r_Participant__k[S019,Intercept]" "r_Participant__k[S020,Intercept]"
#> [21] "sd_Participant__k_Intercept" Created on 2025-04-27 with reprex v2.1.1 |
See also new docs: For models of class
|
Fine by me yes |
I think we can do the same optimization for stanreg/rstanarm, too. The |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@DominiqueMakowski What would you say how
"all"
should behave? Return fixed effects, random variances and group level estimates? (as it is now)Or only return fixed effects and random variances, as for non-bayesian models, and return group level estimates only when requested?
At the moment, we have no option for brms for return fixed effects and random variances only. In parameters, we return both random effects variances and group level effects, and simply filter out group level estimates when
group_level = FALSE
. This is inefficient for large models.Thus, I suggest that
"all"
returns fixed and ran vars only.