clean_parameters and smooth terms or other special cases #108
Replies: 14 comments
|
🙉 that's a good question. Mmh I think I would tend to see the smooth term as neither fixed nor random (i.e., as a third category)... but maybe I am miconceptualising things here. |
|
It seems to complicated.. (possibly related to #42) |
library(insight)
library(mgcv)
dat <- gamSim(1, n = 400, dist = "normal", scale = 2)
m1 <- mgcv::gam(y ~ s(x0) + s(x1) + s(x2) + s(x3), data = dat)
m2 <- download_model("brms_smooth_1")
m3 <- download_model("stanreg_gamm4_3")
clean_parameters(m1)
#> parameter effects component fun
#> 1 (Intercept) fixed conditional
#> 2 s(x0) fixed conditional smooth
#> 3 s(x1) fixed conditional smooth
#> 4 s(x2) fixed conditional smooth
#> 5 s(x3) fixed conditional smooth
clean_parameters(m2)
#> parameter effects component fun cleaned_parameter
#> 1 b_Intercept fixed conditional (Intercept)
#> 2 bs_sx0_1 fixed conditional smooth sx0_1
#> 3 bs_sx1_1 fixed conditional smooth sx1_1
#> 4 bs_sx2_1 fixed conditional smooth sx2_1
#> 5 bs_sx3_1 fixed conditional smooth sx3_1
#> 6 sds_sx0_1 fixed smooth_sd smooth sx0_1
#> 7 sds_sx1_1 fixed smooth_sd smooth sx1_1
#> 8 sds_sx2_1 fixed smooth_sd smooth sx2_1
#> 9 sds_sx3_1 fixed smooth_sd smooth sx3_1
clean_parameters(m3)
#> parameter effects component group fun cleaned_parameter
#> 1 (Intercept) fixed conditional (Intercept)
#> 2 Speciesversicolor fixed conditional Speciesversicolor
#> 3 Speciesvirginica fixed conditional Speciesvirginica
#> 4 b[(Intercept) Cat1:X] random conditional Cat1:X (Intercept)
#> 5 b[(Intercept) Cat1:Y] random conditional Cat1:Y (Intercept)
#> 6 smooth_sd[s(Petal.Length)1] fixed smooth_sd smooth s(Petal.Length)1
#> 7 smooth_sd[s(Petal.Length)2] fixed smooth_sd smooth s(Petal.Length)2Created on 2019-05-21 by the reprex package (v0.3.0) |
|
maybe a |
|
good idea, and maybe call it |
|
That's a reserved word, which is turned into |
|
or right! hum maybe "special" in that case? a bit vague though |
Indeed. Let us stick to |
|
type? group? subtype? subcomponent? link ? transformation ? |
|
Ok, and now I would through a dart and let it decide... |
Not sure if a function that is applied to parameters is a "type"...
We already have "group" (random effects).
See type
See type :-D
Is it a link? I think this connotation is reserved for link-functions, somehow...
This sounds quite good, but then we would have to do this for other transformations ( |
|
🙉 class? category? form? maybe a composite word, type_function? |
|
To keep this link in mind: Maybe, in bette understanding the nature of smooth-terms, we find an appropriate name ;-) I'll get back to the above link the next days... |
library(insight)
m <- download_model("brms_smooth_2")
clean_parameters(m)
#> Parameter Effects Component Function Cleaned_Parameter
#> 1 b_Intercept fixed conditional (Intercept)
#> 2 bs_t2x0x1_1 fixed conditional smooth t2x0x1_1
#> 3 bs_t2x0x1_2 fixed conditional smooth t2x0x1_2
#> 4 bs_t2x0x1_3 fixed conditional smooth t2x0x1_3
#> 5 bs_sx2.x3_1 fixed conditional smooth sx2.x3_1
#> 6 bs_sx2.x3_2 fixed conditional smooth sx2.x3_2
#> 7 sds_t2x0x1_1 fixed smooth_sd smooth t2x0x1_1
#> 8 sds_t2x0x1_2 fixed smooth_sd smooth t2x0x1_2
#> 9 sds_t2x0x1_3 fixed smooth_sd smooth t2x0x1_3
#> 10 sds_sx2x3_1 fixed smooth_sd smooth sx2x3_1Created on 2019-06-26 by the reprex package (v0.3.0) I leave this issue open, because we might revise the handling of smooth-terms in the future. |
Uh oh!
There was an error while loading. Please reload this page.
What would you suggest, how to deal with "special" terms like smooth terms? I have indicated the SD in the component-column. But should we also mark the smooth-terms themselves, because not always are these of interest, so we might want to filter them out easily...
But how to indicate? They are fixed (or maybe even random?) effects, they can belong to count or zero-inflated part...
Created on 2019-05-21 by the reprex package (v0.2.1)
All reactions