Questions tagged [brms]
97 questions
0
votes
1 answer
brms - understanding chains, iter and warmup
I am trying to use the brms package's brm function to fit bayesian mixed effect models. The documentation isnt very clear on what exactly is achieved by increasing the number of chains, number of iterations and warmup. It would be helpful if someone…

rAmAnA
- 1,909
- 1
- 11
- 11
0
votes
0 answers
bayes_factor in brms causes R and Rstudio session abort
bayes_factor in brms causes R and Rstudio session abort. I deleted and reinstalled both R and Rstudio. At first it wouldn’t fit brm() models but after I tried
remove.packages(c("StanHeaders", "rstan"))
install.packages("StanHeaders", repos =…

Bommby
- 35
- 4
0
votes
0 answers
Fixing parameters through prior selection in RStan
I often see analysts "fixing a parameter" to some value when using Stan by setting a prior on the parameter. For example, the Stan user's guide section on Item Response Models notes that in including alpha ~ std_normal() in the model{} block in a…

socialscientist
- 3,759
- 5
- 23
- 58
0
votes
0 answers
Can I allow for two-level variance in brms
I'm considering a linear multilevel model. It seems that such a model with two-level coefficient can be estimated by brms. However, I'm wondering if it is possible to allow for a two-level structure in the variance of error term such as $\sigma_i^2…

user0131
- 125
- 4
0
votes
0 answers
Data table issue while rendering the shiny page
these are my shiny codes for bayesian regression coefficient datatable output.
ıt was used to work on my old computer but now with new computer I m gettting this error says Datatables warning table id=Datatables Table 6 pillar_num not supported
ui…

Ozgur Alptekın
- 505
- 6
- 19
0
votes
0 answers
Problems with brms package in R Studio
I ran the following model in R studio with brms:
model <- brm(bf(formula),
data = df_region,
prior = bpriors,
warmup = 1000,
iter = 5000,
chains = 2,
cores =…

Ozgur Alptekın
- 505
- 6
- 19
0
votes
1 answer
modelsummary display output from lm and brms concurrently with statistics
models <- list(
"Linear" = lm(outcome ~ week * food data = df ),
"Bayesian" = brm(outcome ~ s(week, k = 4, fx = TRUE, by = food) + food, data = df, family = "zero_one_inflated_beta")
)
The following code works when I run it
modelsummary(models,
…

nerd
- 473
- 5
- 15
0
votes
1 answer
hi all . i am trying to run the bym2 model . at this stage, i have a problem.are you help me?
library(“rstan”)
library(“rstudioapi”)
library(“parallel”)
library(“brms”)
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectgores())
library(pkgbuild) # load packAge
find_rtools() # should be TRUE, assuming you have Rtools…

shal
- 1
- 1
0
votes
1 answer
Error when compiling R packages : Eigen/Core : new: no file or directory
This is my first question on stack ! Hope I follow correctly the guidelines...
Device
Thinkpad series
Manjaro KDE (kernel 5.13)
Fresh R install (4.2)
Fresh Rstudio install
Several packages installed yesterday evening, following approximately this…

user21048379
- 1
- 1
0
votes
0 answers
Using savage dickey null point hypotheses for arms models
Lets say I have a brms model of y ~ a*b + (1|group) and I'd really like to compare it against an alternative model y ~ a + b + (1|group) (in my example a is time and b is experimental condition).
Using hypothesis I could write:
hypothesis(m1, c("a:b…

bjw
- 2,046
- 18
- 33
0
votes
0 answers
Stan model not compiling with brms (only) in combination with Renv: 'omp.h' file not found
I have code to specify a stan model using the brms package. This code works well when using RStudio without a project open. However, when I open an RStudio project, I receive an error when trying to compile the stan model:
Error in compileCode(f,…

Jasper
- 555
- 2
- 12
0
votes
0 answers
modelsummary not reading columns from custom tidy and glance functions
Apologies for not having a full reproducible example here, but the models take a fairly long time to run and the model objects are fairly large.
I have a chunk of code that to generate a table from three multilevel multinomial logit models run using…

Michael Flynn
- 13
- 4
0
votes
0 answers
Bug in derivative calculation GI type GAM
I have many hierarchical GAMs fitted with the brm() function of the brms package. Some of my GAMs have a 'I type' structure :
y ~ 1 + s(year, by = site, bs = "tp", m = 2) + s(level, bs = "tp") + (1|r|transect),
zi ~ 1 + s(year, by = site, bs…

Julien Beaulieu
- 29
- 7
0
votes
0 answers
Rendering a Quarto blog post trips an error when reading in a brms file object
First, I'll apologize for not having a fuller reproducable example, but I'm not entirely sure how to go about that given the various layers to the question/problem.
I'm moving a blog over from Blogdown to a new Quarto-based website and blog. I have…

Michael Flynn
- 13
- 4
0
votes
0 answers
Both bayes_R2 and loo_R2 get weird estimate 1
I ran a brms model on a dataset containing almost 11000 species using the following command.
fit <- brm(formula =brl ~ LH + (1|species),
data = data_,
cov_ranef = list(species=phyloMat),
family =…

Dong Zhang
- 31
- 2