Hello,
I want to estimate among individual (random intercepts) correlations between behaviours at different levels of experience within a multivariate modelling framework. Although the model indicates that the maximum treedepth has been reached, all the other diagnostics seem fine. Unfortunately, the model output is too large for me to share it here, and the data is private at the moment. I will thus do my best to describe my question.
My problem is that the model seems to estimate the means of each individual random intercept on a standardized scale, while all my response variables were not standardized. I will describe my findings below.
Here is the model that I fitted with brms 2.16.3 :
# =======================================================================
# 3. Build the multivariate model
# =======================================================================
# We first compute submodels for each level of experience
# These submodels will be added in a joint model that
# will estimate all the covariances
# Speed at three levels of experience -----------------------------------
speed_novice <- bf(
speed_novice | subset(sub1) ~
1 + Zgame_duration +
(1 |a| predator_id) +
(1 | environment_id) +
(1 | predator_avatar_id),
sigma ~
1 + Zgame_duration +
(1 |a| predator_id)
) + gaussian()
speed_intermediate <- bf(
speed_interm | subset(sub2) ~
1 + Zgame_duration +
(1 |a| predator_id) +
(1 | environment_id) +
(1 | predator_avatar_id),
sigma ~
1 + Zgame_duration +
(1 |a| predator_id)
) + gaussian()
speed_advanced <- bf(
speed_advanced | subset(sub3) ~
1 + Zgame_duration +
(1 |a| predator_id) +
(1 | environment_id) +
(1 | predator_avatar_id),
sigma ~
1 + Zgame_duration +
(1 |a| predator_id)
) + gaussian()
# Prey speed at three levels of experience ------------------------------
prey_speed_novice <- bf(
prey_speed_novice | subset(sub1) ~
1 + Zgame_duration +
(1 |a| predator_id),
sigma ~
1 + Zgame_duration +
(1 |a| predator_id)
) + gaussian()
prey_speed_intermediate <- bf(
prey_speed_interm | subset(sub2) ~
1 + Zgame_duration +
(1 |a| predator_id),
sigma ~
1 + Zgame_duration +
(1 |a| predator_id)
) + gaussian()
prey_speed_advanced <- bf(
prey_speed_advanced | subset(sub3) ~
1 + Zgame_duration +
(1 |a| predator_id),
sigma ~
1 + Zgame_duration +
(1 |a| predator_id)
) + gaussian()
# Hunting success at three levels of experience -------------------------
# Compute the custom family
beta_binomial2 <- custom_family(
"beta_binomial2", dpars = c("mu", "phi"),
links = c("logit", "log"), lb = c(NA, 0),
type = "int", vars = "vint1[n]"
)
# Function
stan_funs <- "
real beta_binomial2_lpmf(int y, real mu, real phi, int T) {
return beta_binomial_lpmf(y | T, mu * phi, (1 - mu) * phi);
}
int beta_binomial2_rng(real mu, real phi, int T) {
return beta_binomial_rng(T, mu * phi, (1 - mu) * phi);
}
"
# Variables
stanvars <- stanvar(scode = stan_funs, block = "functions")
# Sub models
success_novice <- bf(
success_novice | vint(4) + subset(sub1) ~
1 + Zgame_duration +
(1 |a| predator_id)
) + beta_binomial2
success_interm <- bf(
success_interm | vint(4) + subset(sub2) ~
1 + Zgame_duration +
(1 |a| predator_id)
) + beta_binomial2
success_advanced <- bf(
success_advanced | vint(4) + subset(sub3) ~
1 + Zgame_duration +
(1 |a| predator_id)
) + beta_binomial2
# priors ----------------------------------------------------------------
priors <- c(
# Prior on game duration
set_prior("normal(0, 2)",
class = "b",
coef = "Zgame_duration",
resp = c("speednovice",
"speedinterm",
"speedadvanced",
"preyspeednovice",
"preyspeedinterm",
"preyspeedadvanced",
"successnovice",
"successinterm",
"successadvanced")),
# priors on var. parameters (brms automatically detects half-normal)
set_prior("normal(0, 1)",
class = "sd", # applies to all variance parameters
resp = c("speednovice",
"speedinterm",
"speedadvanced",
"preyspeednovice",
"preyspeedinterm",
"preyspeedadvanced",
"successnovice",
"successinterm",
"successadvanced")),
# priors on phi
set_prior("normal(2, 1)",
class = "phi",
resp = c("successnovice",
"successinterm",
"successadvanced")),
set_prior("lkj(2)",
class = "cor",
group = "predator_id")
)
# =======================================================================
# =======================================================================
# =======================================================================
# 4. Run the multivariate model
# =======================================================================
# ( nitt - burnin ) / thin = 1000
fit <- brm(speed_novice +
speed_intermediate +
speed_advanced +
prey_speed_novice +
prey_speed_intermediate +
prey_speed_advanced +
success_novice +
success_interm +
success_advanced +
set_rescor(FALSE),
warmup = 500,
iter = 2500,
thin = 8,
chains = 4,
inits = "0",
threads = threading(12),
backend = "cmdstanr",
seed = 123,
prior = priors,
sample_prior = TRUE,
control = list(adapt_delta = 0.99),
stanvars = stanvars,
#save_pars = save_pars(all = TRUE),
data = data)
Here is the model summary :
r$> summary
Family: MV(gaussian, gaussian, gaussian, gaussian, gaussian, gaussian, beta_binomial2, beta_binomial2, beta_binomial2)
Links: mu = identity; sigma = log
mu = identity; sigma = log
mu = identity; sigma = log
mu = identity; sigma = log
mu = identity; sigma = log
mu = identity; sigma = log
mu = logit; phi = identity
mu = logit; phi = identity
mu = logit; phi = identity
Formula: speed_novice | subset(sub1) ~ 1 + Zgame_duration + (1 | a | predator_id) + (1 | environment_id) + (1 | predator_avatar_id)
sigma ~ 1 + Zgame_duration + (1 | a | predator_id)
speed_interm | subset(sub2) ~ 1 + Zgame_duration + (1 | a | predator_id) + (1 | environment_id) + (1 | predator_avatar_id)
sigma ~ 1 + Zgame_duration + (1 | a | predator_id)
speed_advanced | subset(sub3) ~ 1 + Zgame_duration + (1 | a | predator_id) + (1 | environment_id) + (1 | predator_avatar_id)
sigma ~ 1 + Zgame_duration + (1 | a | predator_id)
prey_speed_novice | subset(sub1) ~ 1 + Zgame_duration + (1 | a | predator_id)
sigma ~ 1 + Zgame_duration + (1 | a | predator_id)
prey_speed_interm | subset(sub2) ~ 1 + Zgame_duration + (1 | a | predator_id)
sigma ~ 1 + Zgame_duration + (1 | a | predator_id)
prey_speed_advanced | subset(sub3) ~ 1 + Zgame_duration + (1 | a | predator_id)
sigma ~ 1 + Zgame_duration + (1 | a | predator_id)
success_novice | vint(4) + subset(sub1) ~ 1 + Zgame_duration + (1 | a | predator_id)
success_interm | vint(4) + subset(sub2) ~ 1 + Zgame_duration + (1 | a | predator_id)
success_advanced | vint(4) + subset(sub3) ~ 1 + Zgame_duration + (1 | a | predator_id)
Data: data (Number of observations: 87900)
Draws: 4 chains, each with iter = 2500; warmup = 500; thin = 8;
total post-warmup draws = 1000
Group-Level Effects:
~environment_id (Number of levels: 35)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(speednovice_Intercept) 0.03 0.00 0.02 0.03 1.00 932 951
sd(speedinterm_Intercept) 0.03 0.00 0.02 0.03 1.00 1036 986
sd(speedadvanced_Intercept) 0.03 0.00 0.02 0.04 1.01 1070 990
~predator_avatar_id (Number of levels: 23)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(speednovice_Intercept) 0.30 0.05 0.22 0.41 1.00 903 884
sd(speedinterm_Intercept) 0.36 0.06 0.27 0.49 1.00 876 930
sd(speedadvanced_Intercept) 0.39 0.06 0.29 0.53 1.00 818 954
~predator_id (Number of levels: 341)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(speednovice_Intercept) 0.20 0.01 0.18 0.22 1.00 708 785
sd(sigma_speednovice_Intercept) 0.42 0.02 0.39 0.46 1.00 858 996
sd(speedinterm_Intercept) 0.30 0.01 0.28 0.33 1.00 856 1035
sd(sigma_speedinterm_Intercept) 0.44 0.02 0.40 0.47 1.00 782 992
sd(speedadvanced_Intercept) 0.26 0.01 0.23 0.29 1.00 944 927
sd(sigma_speedadvanced_Intercept) 0.47 0.02 0.42 0.52 1.00 857 950
sd(preyspeednovice_Intercept) 0.09 0.00 0.08 0.10 1.00 949 1033
sd(sigma_preyspeednovice_Intercept) 0.06 0.01 0.05 0.08 1.00 931 1006
sd(preyspeedinterm_Intercept) 0.10 0.00 0.09 0.11 1.00 962 953
sd(sigma_preyspeedinterm_Intercept) 0.06 0.01 0.05 0.07 1.01 1050 914
sd(preyspeedadvanced_Intercept) 0.12 0.01 0.10 0.13 1.00 859 861
sd(sigma_preyspeedadvanced_Intercept) 0.07 0.01 0.06 0.09 1.00 981 898
sd(successnovice_Intercept) 0.72 0.03 0.66 0.78 1.00 943 918
sd(successinterm_Intercept) 0.63 0.03 0.58 0.68 1.00 910 964
sd(successadvanced_Intercept) 0.61 0.04 0.55 0.69 1.00 903 785
cor(speednovice_Intercept,sigma_speednovice_Intercept) -0.73 0.03 -0.78 -0.67 1.00 831 953
cor(speednovice_Intercept,speedinterm_Intercept) 0.74 0.03 0.67 0.79 1.01 719 846
cor(sigma_speednovice_Intercept,speedinterm_Intercept) -0.51 0.05 -0.59 -0.42 1.00 582 877
cor(speednovice_Intercept,sigma_speedinterm_Intercept) -0.51 0.04 -0.59 -0.42 1.00 824 915
cor(sigma_speednovice_Intercept,sigma_speedinterm_Intercept) 0.67 0.04 0.60 0.73 1.00 764 865
cor(speedinterm_Intercept,sigma_speedinterm_Intercept) -0.56 0.04 -0.63 -0.47 1.00 825 984
cor(speednovice_Intercept,speedadvanced_Intercept) 0.56 0.05 0.45 0.64 1.00 867 949
cor(sigma_speednovice_Intercept,speedadvanced_Intercept) -0.38 0.06 -0.49 -0.26 1.00 757 960
cor(speedinterm_Intercept,speedadvanced_Intercept) 0.89 0.02 0.84 0.93 1.00 895 945
cor(sigma_speedinterm_Intercept,speedadvanced_Intercept) -0.54 0.05 -0.63 -0.43 1.00 720 966
cor(speednovice_Intercept,sigma_speedadvanced_Intercept) -0.40 0.07 -0.53 -0.27 1.00 833 881
cor(sigma_speednovice_Intercept,sigma_speedadvanced_Intercept) 0.42 0.06 0.29 0.54 1.01 765 868
cor(speedinterm_Intercept,sigma_speedadvanced_Intercept) -0.47 0.06 -0.57 -0.35 1.00 917 989
cor(sigma_speedinterm_Intercept,sigma_speedadvanced_Intercept) 0.69 0.04 0.59 0.77 1.00 773 861
cor(speedadvanced_Intercept,sigma_speedadvanced_Intercept) -0.62 0.05 -0.70 -0.52 1.00 889 1038
cor(speednovice_Intercept,preyspeednovice_Intercept) 0.29 0.05 0.18 0.39 1.00 902 955
cor(sigma_speednovice_Intercept,preyspeednovice_Intercept) -0.16 0.06 -0.27 -0.04 1.00 1018 882
cor(speedinterm_Intercept,preyspeednovice_Intercept) 0.17 0.05 0.06 0.27 1.00 950 993
cor(sigma_speedinterm_Intercept,preyspeednovice_Intercept) -0.08 0.06 -0.20 0.04 1.00 951 969
cor(speedadvanced_Intercept,preyspeednovice_Intercept) 0.12 0.06 -0.01 0.25 1.00 760 879
cor(sigma_speedadvanced_Intercept,preyspeednovice_Intercept) -0.12 0.07 -0.25 0.03 1.00 735 869
cor(speednovice_Intercept,sigma_preyspeednovice_Intercept) -0.27 0.08 -0.42 -0.12 1.00 959 914
cor(sigma_speednovice_Intercept,sigma_preyspeednovice_Intercept) 0.23 0.08 0.07 0.39 1.00 968 907
cor(speedinterm_Intercept,sigma_preyspeednovice_Intercept) -0.18 0.08 -0.32 -0.01 1.00 966 833
cor(sigma_speedinterm_Intercept,sigma_preyspeednovice_Intercept) 0.10 0.08 -0.07 0.26 1.00 1038 929
cor(speedadvanced_Intercept,sigma_preyspeednovice_Intercept) -0.21 0.09 -0.36 -0.04 1.00 937 835
cor(sigma_speedadvanced_Intercept,sigma_preyspeednovice_Intercept) 0.10 0.10 -0.08 0.28 1.00 1038 918
cor(preyspeednovice_Intercept,sigma_preyspeednovice_Intercept) -0.43 0.08 -0.58 -0.27 1.00 1072 1015
cor(speednovice_Intercept,preyspeedinterm_Intercept) 0.38 0.05 0.28 0.47 1.00 1013 1037
cor(sigma_speednovice_Intercept,preyspeedinterm_Intercept) -0.24 0.06 -0.36 -0.13 1.00 835 902
cor(speedinterm_Intercept,preyspeedinterm_Intercept) 0.36 0.05 0.26 0.45 1.00 971 988
cor(sigma_speedinterm_Intercept,preyspeedinterm_Intercept) -0.26 0.06 -0.36 -0.15 1.00 900 910
cor(speedadvanced_Intercept,preyspeedinterm_Intercept) 0.33 0.06 0.22 0.44 1.01 690 952
cor(sigma_speedadvanced_Intercept,preyspeedinterm_Intercept) -0.21 0.07 -0.35 -0.06 1.00 709 955
cor(preyspeednovice_Intercept,preyspeedinterm_Intercept) 0.72 0.04 0.64 0.78 1.00 1046 948
cor(sigma_preyspeednovice_Intercept,preyspeedinterm_Intercept) -0.23 0.09 -0.39 -0.06 1.00 895 917
cor(speednovice_Intercept,sigma_preyspeedinterm_Intercept) -0.19 0.08 -0.34 -0.03 1.00 1013 986
cor(sigma_speednovice_Intercept,sigma_preyspeedinterm_Intercept) 0.15 0.08 -0.00 0.31 1.00 928 1009
cor(speedinterm_Intercept,sigma_preyspeedinterm_Intercept) -0.26 0.08 -0.41 -0.11 1.00 1020 993
cor(sigma_speedinterm_Intercept,sigma_preyspeedinterm_Intercept) 0.35 0.07 0.20 0.49 1.00 1039 908
cor(speedadvanced_Intercept,sigma_preyspeedinterm_Intercept) -0.38 0.07 -0.53 -0.23 1.00 994 1037
cor(sigma_speedadvanced_Intercept,sigma_preyspeedinterm_Intercept) 0.35 0.08 0.19 0.50 1.00 965 842
cor(preyspeednovice_Intercept,sigma_preyspeedinterm_Intercept) -0.17 0.08 -0.32 -0.02 1.00 1020 849
cor(sigma_preyspeednovice_Intercept,sigma_preyspeedinterm_Intercept) 0.29 0.11 0.07 0.49 1.00 824 904
cor(preyspeedinterm_Intercept,sigma_preyspeedinterm_Intercept) -0.48 0.07 -0.61 -0.32 1.00 1075 989
cor(speednovice_Intercept,preyspeedadvanced_Intercept) 0.18 0.07 0.03 0.32 1.00 1038 1075
cor(sigma_speednovice_Intercept,preyspeedadvanced_Intercept) -0.20 0.07 -0.34 -0.05 1.00 931 1010
cor(speedinterm_Intercept,preyspeedadvanced_Intercept) 0.29 0.06 0.16 0.41 1.00 970 992
cor(sigma_speedinterm_Intercept,preyspeedadvanced_Intercept) -0.25 0.07 -0.38 -0.11 1.00 1008 992
cor(speedadvanced_Intercept,preyspeedadvanced_Intercept) 0.38 0.06 0.25 0.49 1.00 976 915
cor(sigma_speedadvanced_Intercept,preyspeedadvanced_Intercept) -0.26 0.07 -0.39 -0.11 1.00 877 994
cor(preyspeednovice_Intercept,preyspeedadvanced_Intercept) 0.45 0.07 0.32 0.57 1.00 1037 981
cor(sigma_preyspeednovice_Intercept,preyspeedadvanced_Intercept) -0.30 0.10 -0.49 -0.09 1.00 657 861
cor(preyspeedinterm_Intercept,preyspeedadvanced_Intercept) 0.69 0.05 0.59 0.78 1.00 966 1038
cor(sigma_preyspeedinterm_Intercept,preyspeedadvanced_Intercept) -0.44 0.08 -0.58 -0.27 1.00 910 915
cor(speednovice_Intercept,sigma_preyspeedadvanced_Intercept) -0.12 0.10 -0.30 0.07 1.00 1113 1062
cor(sigma_speednovice_Intercept,sigma_preyspeedadvanced_Intercept) 0.22 0.10 0.01 0.41 1.00 1009 917
cor(speedinterm_Intercept,sigma_preyspeedadvanced_Intercept) -0.14 0.10 -0.32 0.06 1.00 1035 954
cor(sigma_speedinterm_Intercept,sigma_preyspeedadvanced_Intercept) 0.22 0.10 0.03 0.41 1.00 1052 886
cor(speedadvanced_Intercept,sigma_preyspeedadvanced_Intercept) -0.18 0.10 -0.38 0.04 1.00 999 1061
cor(sigma_speedadvanced_Intercept,sigma_preyspeedadvanced_Intercept) 0.31 0.10 0.09 0.50 1.00 1003 1039
cor(preyspeednovice_Intercept,sigma_preyspeedadvanced_Intercept) -0.27 0.11 -0.48 -0.07 1.00 1036 978
cor(sigma_preyspeednovice_Intercept,sigma_preyspeedadvanced_Intercept) 0.23 0.14 -0.04 0.49 1.00 712 770
cor(preyspeedinterm_Intercept,sigma_preyspeedadvanced_Intercept) -0.28 0.10 -0.47 -0.07 1.00 1024 902
cor(sigma_preyspeedinterm_Intercept,sigma_preyspeedadvanced_Intercept) 0.42 0.11 0.18 0.63 1.00 1085 978
cor(preyspeedadvanced_Intercept,sigma_preyspeedadvanced_Intercept) -0.46 0.09 -0.64 -0.28 1.00 936 1033
cor(speednovice_Intercept,successnovice_Intercept) 0.11 0.05 0.01 0.21 1.00 945 780
cor(sigma_speednovice_Intercept,successnovice_Intercept) -0.22 0.05 -0.31 -0.12 1.00 871 890
cor(speedinterm_Intercept,successnovice_Intercept) 0.10 0.05 -0.01 0.20 1.00 729 835
cor(sigma_speedinterm_Intercept,successnovice_Intercept) -0.14 0.06 -0.24 -0.03 1.00 898 902
cor(speedadvanced_Intercept,successnovice_Intercept) 0.01 0.06 -0.12 0.13 1.01 700 820
cor(sigma_speedadvanced_Intercept,successnovice_Intercept) -0.07 0.07 -0.21 0.06 1.00 807 772
cor(preyspeednovice_Intercept,successnovice_Intercept) -0.01 0.06 -0.13 0.11 1.00 925 1033
cor(sigma_preyspeednovice_Intercept,successnovice_Intercept) 0.39 0.08 0.23 0.54 1.00 575 742
cor(preyspeedinterm_Intercept,successnovice_Intercept) 0.19 0.06 0.07 0.30 1.00 935 990
cor(sigma_preyspeedinterm_Intercept,successnovice_Intercept) -0.01 0.08 -0.16 0.15 1.00 680 993
cor(preyspeedadvanced_Intercept,successnovice_Intercept) 0.05 0.07 -0.08 0.19 1.00 908 916
cor(sigma_preyspeedadvanced_Intercept,successnovice_Intercept) 0.08 0.09 -0.10 0.26 1.00 877 916
cor(speednovice_Intercept,successinterm_Intercept) 0.11 0.06 -0.01 0.22 1.00 773 956
cor(sigma_speednovice_Intercept,successinterm_Intercept) -0.13 0.06 -0.24 -0.02 1.00 767 749
cor(speedinterm_Intercept,successinterm_Intercept) 0.31 0.05 0.21 0.41 1.01 739 982
cor(sigma_speedinterm_Intercept,successinterm_Intercept) -0.14 0.06 -0.25 -0.03 1.00 904 801
cor(speedadvanced_Intercept,successinterm_Intercept) 0.24 0.06 0.12 0.35 1.00 726 876
cor(sigma_speedadvanced_Intercept,successinterm_Intercept) -0.10 0.07 -0.24 0.04 1.00 803 946
cor(preyspeednovice_Intercept,successinterm_Intercept) 0.02 0.06 -0.09 0.14 1.00 953 992
cor(sigma_preyspeednovice_Intercept,successinterm_Intercept) 0.31 0.08 0.14 0.46 1.00 712 829
cor(preyspeedinterm_Intercept,successinterm_Intercept) 0.12 0.06 0.01 0.23 1.00 911 851
cor(sigma_preyspeedinterm_Intercept,successinterm_Intercept) 0.08 0.08 -0.08 0.23 1.00 683 918
cor(preyspeedadvanced_Intercept,successinterm_Intercept) 0.02 0.07 -0.11 0.16 1.00 948 916
cor(sigma_preyspeedadvanced_Intercept,successinterm_Intercept) 0.03 0.10 -0.16 0.22 1.00 713 813
cor(successnovice_Intercept,successinterm_Intercept) 0.80 0.02 0.75 0.85 1.00 1013 866
cor(speednovice_Intercept,successadvanced_Intercept) -0.06 0.07 -0.19 0.07 1.00 714 908
cor(sigma_speednovice_Intercept,successadvanced_Intercept) -0.03 0.06 -0.15 0.10 1.00 954 917
cor(speedinterm_Intercept,successadvanced_Intercept) 0.11 0.06 -0.03 0.22 1.00 781 904
cor(sigma_speedinterm_Intercept,successadvanced_Intercept) -0.14 0.07 -0.26 -0.01 1.00 1024 955
cor(speedadvanced_Intercept,successadvanced_Intercept) 0.19 0.06 0.06 0.31 1.00 877 909
cor(sigma_speedadvanced_Intercept,successadvanced_Intercept) -0.24 0.07 -0.37 -0.10 1.01 948 924
cor(preyspeednovice_Intercept,successadvanced_Intercept) 0.01 0.07 -0.13 0.15 1.00 953 929
cor(sigma_preyspeednovice_Intercept,successadvanced_Intercept) 0.30 0.09 0.11 0.47 1.00 696 815
cor(preyspeedinterm_Intercept,successadvanced_Intercept) 0.12 0.07 -0.00 0.25 1.00 879 953
cor(sigma_preyspeedinterm_Intercept,successadvanced_Intercept) -0.05 0.09 -0.22 0.11 1.00 634 953
cor(preyspeedadvanced_Intercept,successadvanced_Intercept) 0.06 0.07 -0.09 0.19 1.00 935 954
cor(sigma_preyspeedadvanced_Intercept,successadvanced_Intercept) 0.10 0.10 -0.09 0.29 1.00 819 915
cor(successnovice_Intercept,successadvanced_Intercept) 0.72 0.04 0.64 0.79 1.00 1114 995
cor(successinterm_Intercept,successadvanced_Intercept) 0.83 0.03 0.75 0.88 1.00 870 811
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
speednovice_Intercept 3.27 0.06 3.14 3.39 1.00 620 717
sigma_speednovice_Intercept -1.28 0.02 -1.33 -1.23 1.02 270 601
speedinterm_Intercept 3.25 0.07 3.10 3.39 1.00 542 662
sigma_speedinterm_Intercept -1.24 0.03 -1.29 -1.19 1.01 549 927
speedadvanced_Intercept 3.25 0.08 3.08 3.41 1.00 445 527
sigma_speedadvanced_Intercept -1.27 0.03 -1.34 -1.21 1.00 604 743
preyspeednovice_Intercept 2.33 0.01 2.32 2.34 1.00 902 967
sigma_preyspeednovice_Intercept -1.16 0.01 -1.17 -1.15 1.00 960 889
preyspeedinterm_Intercept 2.41 0.01 2.39 2.42 1.01 846 834
sigma_preyspeedinterm_Intercept -1.21 0.01 -1.22 -1.20 1.00 922 920
preyspeedadvanced_Intercept 2.39 0.01 2.37 2.41 1.00 892 948
sigma_preyspeedadvanced_Intercept -1.23 0.01 -1.25 -1.21 1.00 979 992
successnovice_Intercept -0.01 0.04 -0.08 0.07 1.01 844 1036
successinterm_Intercept 0.06 0.04 -0.01 0.13 1.00 784 962
successadvanced_Intercept 0.17 0.04 0.09 0.26 1.00 847 901
speednovice_Zgame_duration 0.03 0.00 0.02 0.03 1.01 1062 930
sigma_speednovice_Zgame_duration -0.12 0.00 -0.12 -0.11 1.00 764 819
speedinterm_Zgame_duration 0.03 0.00 0.02 0.03 1.01 908 808
sigma_speedinterm_Zgame_duration -0.11 0.00 -0.12 -0.10 1.00 915 900
speedadvanced_Zgame_duration 0.03 0.00 0.03 0.03 1.00 1039 954
sigma_speedadvanced_Zgame_duration -0.12 0.00 -0.13 -0.11 1.00 883 904
preyspeednovice_Zgame_duration -0.02 0.00 -0.03 -0.02 1.00 813 851
sigma_preyspeednovice_Zgame_duration -0.06 0.00 -0.07 -0.05 1.00 1047 985
preyspeedinterm_Zgame_duration -0.02 0.00 -0.02 -0.02 1.00 1143 803
sigma_preyspeedinterm_Zgame_duration -0.07 0.00 -0.08 -0.06 1.00 1059 877
preyspeedadvanced_Zgame_duration -0.01 0.00 -0.01 -0.01 1.00 990 955
sigma_preyspeedadvanced_Zgame_duration -0.05 0.00 -0.06 -0.04 1.00 1054 1013
successnovice_Zgame_duration 0.58 0.01 0.56 0.60 1.00 1018 1083
successinterm_Zgame_duration 0.60 0.01 0.59 0.62 1.00 1048 933
successadvanced_Zgame_duration 0.62 0.01 0.59 0.64 1.00 1002 883
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
phi_successnovice 2.32 0.04 2.25 2.40 1.00 967 947
phi_successinterm 2.06 0.03 2.01 2.12 1.00 961 998
phi_successadvanced 1.95 0.04 1.88 2.02 1.00 1071 994
Draws were sampled using sample(hmc). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
After extracting the draws and arranging them in a table, I observed that the intercepts estimated for each individual have negative values. However, this is not possible since speed is a behaviour that cannot have negative values.
# Print the draws
value xp_level predator_id variable sigma
1: -0.0962975 novice 64485 pred_speed 0
2: -0.0381041 novice 64485 pred_speed 0
3: -0.0489391 novice 64485 pred_speed 0
4: -0.0438618 novice 64485 pred_speed 0
5: -0.0720291 novice 64485 pred_speed 0
---
5114996: 0.2171220 advanced 7123830 success 0
5114997: -0.1234150 advanced 7123830 success 0
5114998: 0.0223782 advanced 7123830 success 0
5114999: 0.4907230 advanced 7123830 success 0
5115000: 0.3813070 advanced 7123830 success 0
# Extract vector of speed for novice individuals
vec <- draws[xp_level == "novice" &
variable == "pred_speed" &
sigma == 0, value]
# Print values
head(vec, 20)
r$> head(vec, 20)
[1] -0.0962975 -0.0381041 -0.0489391 -0.0438618 -0.0720291
[6] -0.0609441 -0.0576778 -0.0228005 -0.0564471 -0.0549230
[11] -0.0489100 -0.0375257 -0.0908298 -0.1012000 -0.1343250
[16] -0.0585265 -0.0694120 -0.0829085 -0.0447254 -0.0714716
If I extract the vector of mean values for novice individuals, and that I apply a back-transformation as if they were standardized, I obtain values that are representative of the speed of the population :
# Calculate mean and sd of speed for novice players
mean1 <- mean(data[xp_level == "novice", pred_speed]) # 3.275457
sd1 <- sd(data[xp_level == "novice", pred_speed]) # 0.4935365
# Apply back-transformation to original scale
vec_original <- (vec * sd1) + mean1
# Print results
head(vec_original, 20)
r$> head(vec_original, 20)
[1] 3.227931 3.256651 3.251304 3.253810 3.239908 3.245379 3.246991
[8] 3.264204 3.247598 3.248350 3.251318 3.256937 3.230629 3.225511
[15] 3.209163 3.246572 3.241200 3.234539 3.253383 3.240183
Am I missing something or a default feature of brms that I am not aware of? Is it possible that the intercepts are automatically scaled in order to estimate the correlations between variables of different units?
Thank you very much for your help.