Comments (6)
Thanks for reporting! It is hard to tell why this happens without more information.
How large is your new data? Does this happen for every (subset of) new data. You may try only one or two rows of new data and see if the error still occurs.
Can you also show me the traceback of the error (write traceback() after the error ocurred)?
EDIT: Can you also show me the model as passed to brm that produces the error? In addition, does this happen for all of your models or only for some?
from brms.
The new data is pretty small, ~ 100. For now I have reverted to the old version, but I'll check again, and let you know.
This is the model:
data {
int<lower=1> N; # number of observations
real Y[N]; # response variable
int<lower=1> K; # number of fixed effects
matrix[N,K] X; # FE design matrix
data for random effects of subcat
int<lower=1> J_1[N]; # RE levels
int<lower=1> N_1; # number of levels
int<lower=1> K_1; # number of REs
real Z_1[N]; # RE design matrix
}
transformed data {
}
parameters {
vector[K] b; # fixed effects
vector[N_1] pre_1; # unscaled REs
real<lower=0> sd_1; # RE standard deviation
real<lower=0> sigma; # residual SD
}
transformed parameters {
vector[N] eta; # linear predictor
vector[N_1] r_1; # REs
compute linear predictor
eta <- X_b;
r_1 <- sd_1 * (pre_1); # scale REs
if available add REs to linear predictor
for (n in 1:N) {
eta[n] <- eta[n] + Z_1[n]_r_1[J_1[n]];
}
}
model {
prior specifications
sigma ~ cauchy(0,5);
sd_1 ~ cauchy(0,5);
pre_1 ~ normal(0,1);
likelihood contribution
Y ~ normal(eta,sigma);
}
from brms.
Thanks for the model code, but I rather ment the function call brm(formula, data, etc.) so that I can replicate your model with dummy data and see if the same error occurs (sorry that my formulation was misleading).
from brms.
Sure, here it is:
brm(formula = y ~ x1 + x2 + x3 + (1 | subcat),
data = df,
family = "gaussian",
n.chains = 4,
n.cluster = 4)
from brms.
I solved it, but I'm not sure how. It had something to do with my factor levels. When I refactored them again, it worked. Factors in R are much like wildcards... you never know what's gonna happen with them...
from brms.
I am glad to hear that, although it would have been interesting to understand what was really causing this issue. ;-)
from brms.
Related Issues (20)
- The centred intercept `Intercept` is exported HOT 4
- Savage-Dickey density ratios aren't computed with QR decomposition HOT 1
- Add loo_epred HOT 2
- Use of weights with cox() family
- Bug when y ~ 0 + Intercept & family = 'poisson' & sample_prior = 'yes'
- thoughts about a set_inits() or gen_inits() function? HOT 3
- Dynamic Panel Ordered Probit Model
- Error: Internal renaming led to duplicated names HOT 7
- autoselect type for pp_check with group argument HOT 1
- Error thrown with variational algorithms HOT 6
- Random effects on thresholds in cumulative models are added to the model twice HOT 3
- Incomplete info in documentation regarding the combinations for `<group>=NA` and `re_formula=NULL` HOT 3
- Possible bug in brms/emmeans integration HOT 20
- R2D2 does not account for scale of the data HOT 3
- car example uses deprecated formula
- feature request: alternative approach for censored data HOT 2
- brms::log_lik creating zombies if cmdstanr is loaded HOT 13
- feature request: mixtures over groups / participants
- Potential breaking change for brms 3.0: no special treatment for mu
- Use draws from pathfinder posterior as inits HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brms.