- Operating System: Ubuntu 16.04.4
- brms Version: 2.2.3
Hello!
I have trouble after fitting a distributional model with splines. Here is the code to specify the model :
formula_mu_phi_ymix <- brmsformula(h ~ s(years, by = divsp, k = 4, fx = F, bs = "ts") +
block + (1|mixture) + (1|divsp),
phi ~ s(years, by = divsp, k = 4, fx = F, bs = "ts") +
block + (1|mixture) + (1|divsp),
family = gamma2)
## Set new priors
prior_mu_phi_ymix <- c(prior(student_t(3,0,3), class = b),
prior(student_t(3,0,3), class = b, dpar = "phi"),
prior(student_t(3,0,1), class = sd),
prior(student_t(3,0,1), class = sd, dpar = "phi"),
prior(student_t(3,0,1), class = sds),
prior(student_t(3,0,1), class = sds, dpar = "phi"))
# Fit the model
gamm_mu_phi_ymix <- brm(formula_mu_phi_ymix, data = Dfact, prior = prior_mu_phi_ymix,
stan_funs = stan_funs, inits = 0,
iter = 2000, chains = 4, cores = 4,
algorithm = "sampling",
save_model = "Results/gamm_mu_phi_ymix.stan",
control = list(adapt_delta = 0.95, max_treedepth = 12))
The model has been well sampled, even if I think he might be overfitted. However, when I try to compute information criteria, or to compute any other operations using posterior distributions (such as marginal effects, fitted, etc.), I get the following error message :
Error in check_pars(allpars, pars) :
no parameter sds_syearsdivspHigh 1_1, sds_syearsdivspHigh 2_1, sds_syearsdivspHigh 3_1, sds_syearsdivspHigh 4_1, sds_syearsdivspHigh 5_1, sds_syearsdivspHigh 6_1, sds_syearsdivspHigh 7_1, sds_syearsdivspLow 1_1, sds_syearsdivspLow 2_1, sds_syearsdivspLow 3_1, sds_syearsdivspLow 4_1, sds_syearsdivspLow 5_1, sds_syearsdivspLow 6_1, sds_syearsdivspLow 7_1, sds_syearsdivspMed 1_1, sds_syearsdivspMed 2_1, sds_syearsdivspMed 3_1, sds_syearsdivspMed 4_1, sds_syearsdivspMed 5_1, sds_syearsdivspMed 6_1, sds_syearsdivspMed 7_1, sds_phi_syearsdivspHigh 1_1, sds_phi_syearsdivspHigh 2_1, sds_phi_syearsdivspHigh 3_1, sds_phi_syearsdivspHigh 4_1, sds_phi_syearsdivspHigh 5_1, sds_phi_syearsdivspHigh 6_1, sds_phi_syearsdivspHigh 7_1, sds_phi_syearsdivspLow 1_1, sds_phi_syearsdivspLow 2_1, sds_phi_syearsdivspLow 3_1, sds_phi_syearsdivspLow 4_1, sds_phi_syearsdivspLow 5_1, sds_phi_syearsdivspLow 6_1, sds_phi_syearsdivspLow 7_1, sds_phi_syearsdivspMed 1_1, sds_phi_syearsdivspMed 2_1, sds_phi_
It seems that the returned brmsfit object does not contain any standard-deviation of splines’ weights! However, I can see the summary of the posterior samples using summary
. My guess is that they can’t be accessed…
Any help? I guess it might be a linguistic environment problem : I already had trouble using the brms output of one computer on another one with different language settings (living in a bilingual country :D )
Sys.getenv()
...
LANG fr_CA.UTF-8
LANGUAGE fr_CA:fr
...
Sys.getlocale()
"LC_CTYPE=fr_CA.UTF-8;LC_NUMERIC=C;LC_TIME=fr_CA.UTF-8;LC_COLLATE=fr_CA.UTF-8;LC_MONETARY=fr_CA.UTF-8;LC_MESSAGES=fr_CA.UTF-8;LC_PAPER=fr_CA.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=fr_CA.UTF-8;LC_IDENTIFICATION=C"
Lucas