OS: Ubuntu 20.04 64bit
Environment: Miniconda3 with R-4.0.3 in a conda environment using Conda built-in compilers
I’ve set up brms and rstan in an environment under conda to work with R-4.0.3
I could run the first iteration of the model (see the code below) using the default adapt_delta at 0.8. It gave me warnings about divergences (I expected this but wanted a baselines). I modified the adapt_delta to 0.95 and when I attempted to rerun the model the compilation stopped and I got the following error, which i cannot understand.
If anyone here can shed some light on the problem source that would be great. Here is the code and outut in its’ entirety for the first and second runs.
Why did the first model succeed in its’ compilation but the second one failed?
First run (Compilation Successful)
library(brms)
Loading required package: Rcpp
Loading ‘brms’ package (version 2.13.5). Useful instructions
can be found by typing help(‘brms’). A more detailed introduction
to the package is available through vignette(‘brms_overview’).
Attaching package: ‘brms’
The following object is masked from ‘package:stats’:
ar
mod1 ← brm(ln_fatalities ~ ln_beer+ln_population+ln_totalvmt +
-
(1|state) + (1|primary) + (1|year), data=trafsaf,
-
cores=2, chains=2, control = list(adapt_delta = 0.80))
Compiling Stan program…
Start sampling
SAMPLING FOR MODEL ‘ded8ea9a2b8d5f29ec0f3be9157f5983’ NOW (CHAIN 1).
Chain 1:
Chain 1: Gradient evaluation took 0.000568 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 5.68 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1:
Chain 1:
SAMPLING FOR MODEL ‘ded8ea9a2b8d5f29ec0f3be9157f5983’ NOW (CHAIN 2).
Chain 1: Iteration: 1 / 2000 [ 0%] (Warmup)
Chain 2:
Chain 2: Gradient evaluation took 0.000543 seconds
Chain 2: 1000 transitions using 10 leapfrog steps per transition would take 5.43 seconds.
Chain 2: Adjust your expectations accordingly!
Chain 2:
Chain 2:
Chain 2: Iteration: 1 / 2000 [ 0%] (Warmup)
Chain 1: Iteration: 200 / 2000 [ 10%] (Warmup)
Chain 2: Iteration: 200 / 2000 [ 10%] (Warmup)
Chain 1: Iteration: 400 / 2000 [ 20%] (Warmup)
Chain 1: Iteration: 600 / 2000 [ 30%] (Warmup)
Chain 2: Iteration: 400 / 2000 [ 20%] (Warmup)
Chain 1: Iteration: 800 / 2000 [ 40%] (Warmup)
Chain 1: Iteration: 1000 / 2000 [ 50%] (Warmup)
Chain 1: Iteration: 1001 / 2000 [ 50%] (Sampling)
Chain 2: Iteration: 600 / 2000 [ 30%] (Warmup)
Chain 1: Iteration: 1200 / 2000 [ 60%] (Sampling)
Chain 1: Iteration: 1400 / 2000 [ 70%] (Sampling)
Chain 2: Iteration: 800 / 2000 [ 40%] (Warmup)
Chain 1: Iteration: 1600 / 2000 [ 80%] (Sampling)
Chain 2: Iteration: 1000 / 2000 [ 50%] (Warmup)
Chain 2: Iteration: 1001 / 2000 [ 50%] (Sampling)
Chain 1: Iteration: 1800 / 2000 [ 90%] (Sampling)
Chain 2: Iteration: 1200 / 2000 [ 60%] (Sampling)
Chain 1: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 1:
Chain 1: Elapsed Time: 93.8875 seconds (Warm-up)
Chain 1: 77.7345 seconds (Sampling)
Chain 1: 171.622 seconds (Total)
Chain 1:
Chain 2: Iteration: 1400 / 2000 [ 70%] (Sampling)
Chain 2: Iteration: 1600 / 2000 [ 80%] (Sampling)
Chain 2: Iteration: 1800 / 2000 [ 90%] (Sampling)
Chain 2: Iteration: 2000 / 2000 [100%] (Sampling)
Chain 2:
Chain 2: Elapsed Time: 151.723 seconds (Warm-up)
Chain 2: 82.9083 seconds (Sampling)
Chain 2: 234.631 seconds (Total)
Chain 2:
Warning messages:
1: There were 242 divergent transitions after warmup. See
http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
to find out why this is a problem and how to eliminate them.
2: There were 161 transitions after warmup that exceeded the maximum treedepth. Increase max_treedepth above 10. Se
e
http://mc-stan.org/misc/warnings.html#maximum-treedepth-exceeded
3: Examine the pairs() plot to diagnose sampling problems
4: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
Running the chains for more iterations may help. See
http://mc-stan.org/misc/warnings.html#bulk-ess
5: Tail Effective Samples Size (ESS) is too low, indicating posterior variances and tail quantiles may be unreliabl
e.
Running the chains for more iterations may help. See
http://mc-stan.org/misc/warnings.html#tail-ess
Second Run (Compilation Fails,ONly Change is adapt_delta)
mod1 ← brm(ln_fatalities ~ ln_beer+ln_population+ln_totalvmt +
-
(1|state) + (1|primary) + (1|year), data=trafsaf,
-
cores=2, chains=2, control = list(adapt_delta = 0.95))
Compiling Stan program…
make cmd is
make -f ‘/home/sreezach/miniconda3/envs/asd/lib/R/etc/Makeconf’ -f ‘/home/sreezach/miniconda3/envs/asd/lib/R/shar
e/make/shlib.mk’ CXX=‘(CXX14) (CXX14STD)’ CXXFLAGS=‘(CXX14FLAGS)' CXXPICFLAGS='(CXX14PICFLAGS)’ SHLIB_LDFLAGS=’
(SHLIB_CXX14LDFLAGS)' SHLIB_LD='(SHLIB_CXX14LD)’ SHLIB=‘file17c1267cfeb5.so’ OBJECTS=‘file17c1267cfeb5.o’
make would use
x86_64-conda-linux-gnu-c++ -std=gnu++14 -I"/home/sreezach/miniconda3/envs/asd/lib/R/include" -DNDEBUG -I"/home/sr
eezach/miniconda3/envs/asd/lib/R/library/Rcpp/include/" -I"/home/sreezach/miniconda3/envs/asd/lib/R/library/RcppEi
gen/include/" -I"/home/sreezach/miniconda3/envs/asd/lib/R/library/RcppEigen/include/unsupported" -I"/home/sreezac
h/miniconda3/envs/asd/lib/R/library/BH/include" -I"/home/sreezach/miniconda3/envs/asd/lib/R/library/StanHeaders/inc
lude/src/" -I"/home/sreezach/miniconda3/envs/asd/lib/R/library/StanHeaders/include/" -I"/home/sreezach/miniconda3
/envs/asd/lib/R/library/RcppParallel/include/" -I"/home/sreezach/miniconda3/envs/asd/lib/R/library/rstan/include"
-DEIGEN_NO_DEBUG -DBOOST_DISABLE_ASSERTS -DBOOST_PENDING_INTEGER_LOG2_HPP -DSTAN_THREADS -DBOOST_NO_AUTO_PTR -
include ‘/home/sreezach/miniconda3/envs/asd/lib/R/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp’ -D
_REENTRANT -DRCPP_PARALLEL_USE_TBB=1 -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /home/sreezach/miniconda3/envs/asd
/include -I/home/sreezach/miniconda3/envs/asd/include -Wl,-rpath-link,/home/sreezach/miniconda3/envs/asd/lib -fpi
c -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-prot
ector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /home/sreezach/miniconda3/envs/asd/include -fdebug-pre
fix-map=/home/conda/feedstock_root/build_artifacts/r-base_1603051729662/work=/usr/local/src/conda/r-base-4.0.3 -fde
bug-prefix-map=/home/sreezach/miniconda3/envs/asd=/usr/local/src/conda-prefix -c file17c1267cfeb5.cpp -o file17c12
67cfeb5.o
if test “zfile17c1267cfeb5.o” != “z”; then
echo x86_64-conda-linux-gnu-c++ -std=gnu++14 -shared -L"/home/sreezach/miniconda3/envs/asd/lib/R/lib" -Wl,-O2 -Wl
,–sort-common -Wl,–as-needed -Wl,-z,relro -Wl,-z,now -Wl,–disable-new-dtags -Wl,–gc-sections -Wl,-rpath,/home/s
reezach/miniconda3/envs/asd/lib -Wl,-rpath-link,/home/sreezach/miniconda3/envs/asd/lib -L/home/sreezach/miniconda3/
envs/asd/lib -Wl,-rpath-link,/home/sreezach/miniconda3/envs/asd/lib -o file17c1267cfeb5.so file17c1267cfeb5.o ‘/ho
me/sreezach/miniconda3/envs/asd/lib/R/library/rstan/lib//libStanServices.a’ -L’/home/sreezach/miniconda3/envs/asd/l
ib/R/library/StanHeaders/lib/’ -lStanHeaders -L’/home/sreezach/miniconda3/envs/asd/lib/R/library/RcppParallel/lib/’
-ltbb -L"/home/sreezach/miniconda3/envs/asd/lib/R/lib" -lR;
x86_64-conda-linux-gnu-c++ -std=gnu++14 -shared -L"/home/sreezach/miniconda3/envs/asd/lib/R/lib" -Wl,-O2 -Wl,–so
rt-common -Wl,–as-needed -Wl,-z,relro -Wl,-z,now -Wl,–disable-new-dtags -Wl,–gc-sections -Wl,-rpath,/home/sreeza
ch/miniconda3/envs/asd/lib -Wl,-rpath-link,/home/sreezach/miniconda3/envs/asd/lib -L/home/sreezach/miniconda3/envs/
asd/lib -Wl,-rpath-link,/home/sreezach/miniconda3/envs/asd/lib -o file17c1267cfeb5.so file17c1267cfeb5.o ‘/home/sr
eezach/miniconda3/envs/asd/lib/R/library/rstan/lib//libStanServices.a’ -L’/home/sreezach/miniconda3/envs/asd/lib/R/
library/StanHeaders/lib/’ -lStanHeaders -L’/home/sreezach/miniconda3/envs/asd/lib/R/library/RcppParallel/lib/’ -ltb
b -L"/home/sreezach/miniconda3/envs/asd/lib/R/lib" -lR;
fi