Deep Copy Issue

I went to re-run a model (it had successful run before, but had 2 divergent transitions), I am suddenly getting this output:

“DIAGNOSTIC(S) FROM PARSER:
Info: left-hand side variable (name=theta1) occurs on right-hand side of assignment, causing inefficient deep copy to avoid aliasing.”

This Info message is copied 4 times with different variable names, and this chunk of notes prints once before, and once after the “Compiling the C++ model” line.

Ultimately, it’s also failing to compile:

Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created!

and then a list of paths.

Any thoughts about what is going wrong?
What does the Info message mean?

The model I am running is:

fit1_v4 <- brm(brmsformula(
intervals ~ 1 + phase +(1|male|male_id),
theta2 ~ 1 + phase + (1|male|male_id)),
data=filtered_data,
family=mixture(Gamma(“log”), Gamma(“log”), order=TRUE),
prior = prior1,
control = list(adept_delta = 0.99),
warmup = 1000,
iter = 4000,
chains = 2,
cores = 2)

Please also provide the following information in addition to your question:

  • Operating System: Windows 8.1
  • brms Version: 2.5.0

Those deep copy things should not cause a compiler error. What is the rest of the compiler error message?

The full compilation errors are:

Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from C:/Users/Ryane/Documents/R/win-library/3.5/BH/include/boost/config.hpp:39:0,
from C:/Users/Ryane/Documents/R/win-library/3.5/BH/include/boost/math/tools/config.hpp:13,
from C:/Users/Ryane/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/core/var.hpp:7,
from C:/Users/Ryane/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5,
from C:/Users/Ryane/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/core.hpp:12,
from C:/Users/Ryane/Documents/R/win-library/3.5/StanHeaders/include/stan/math/rev/mat.hpp:4,
from C:/Users/Ryane/Documents/R/win-library/3.5/StanHeaders/include/stan/math.hpp:4,
from C:/Users/Ryane/Documents/R/win-library/3.5/StanHeaders/include/src/stan/model/model_header.hpp:4,
from file142cd6e38e9.cpp:8:
In addition: Warning messages:
1: In rstan::stan_model(model_code = x$model, save_dso = save_dso) :
StanHeaders version is ahead of rstan version; update to latest rstan
2: In system(cmd, intern = !verbose) :
running command ‘C:/PROGRA~1/R/R-35~1.0/bin/x64/R CMD SHLIB file142cd6e38e9.cpp 2> file142cd6e38e9.cpp.err.txt’ had status 1

Most likely this

Ok, I’m working on the rstan issue (unsurprisingly, this issue started after I updated my packages).

Do you have further information a bout the deep copy information? It’s not a warning, but I’m not sure what it means?

Thanks for the help on the compilation problem!

It is just that brms is generating some Stan code that does extra copying but the posterior distribution is unaffected. As a user, you can’t do anything about it unless you edit the generated code.

Ok that’s reassuring - doesn’t sound like something I need to worry about!
Thanks again for your help.