stan-dev / stan-dev/rstan

sampling error; sampling not done (other similar issue solutions not working)

Open
#709 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Hi,

I am running into sampling errors when trying to run a brms model. Based on other issues (from which the solutions have unfortunately not worked for me) and the error message, it seems to be going wrong with calling the sampler.

I am quite new to rstan (and I am not really familiar with Stan code), so any help would be much appreciated! Thanks a lot in advance.

I get the following error with each of the chains of the brms model:
[1] "Error in sampler$call_sampler(args_list[[i]]) : "
[2] " c++ exception (unknown reason)"
error occurred during calling the sampler; sampling not done

This is the model I am trying to run:
cor_mod <- brm(Correct_emo ~ f_group + f_percentage + f_emotion + f_groupf_percentagef_emotion + (1 + f_emotion | f_ppn) + (1 + f_emotion | f_group), data = comb2, family = 'bernoulli', warmup = 1000, iter = 6000, chains = 4, cores = 6, control = list(adapt_delta = 0.95))

The model compiles very quickly, but then this error comes up right after. The model does run without the random slopes.

output of rstan:::get_CXX(): clang++

I have multiple MakeVars files so I am not quite sure which one is relevant (also one file that is named old_makevars.rd).

sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.15

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] foreign_0.8-72 brms_2.10.3 Rcpp_1.0.2 rstan_2.19.2 ggplot2_3.2.1 StanHeaders_2.19.0

loaded via a namespace (and not attached):
[1] Brobdingnag_1.2-6 pkgload_1.0.2 gtools_3.8.1 threejs_0.3.1 shiny_1.4.0
[6] assertthat_0.2.1 stats4_3.6.0 remotes_2.1.0 sessioninfo_1.1.1 pillar_1.4.2
[11] backports_1.1.5 lattice_0.20-38 glue_1.3.1 digest_0.6.22 promises_1.1.0
[16] colorspace_1.4-1 htmltools_0.4.0 httpuv_1.5.2 Matrix_1.2-17 plyr_1.8.4
[21] dygraphs_1.1.1.6 pkgconfig_2.0.3 devtools_2.2.1 purrr_0.3.3 xtable_1.8-4
[26] scales_1.0.0 processx_3.4.1 later_1.0.0 tibble_2.1.3 bayesplot_1.7.0
[31] usethis_1.5.1 ellipsis_0.3.0 DT_0.9 shinyjs_1.0 withr_2.1.2
[36] lazyeval_0.2.2 cli_1.1.0 magrittr_1.5 crayon_1.3.4 mime_0.7
[41] memoise_1.1.0 ps_1.3.0 fs_1.3.1 nlme_3.1-139 xts_0.11-2
[46] pkgbuild_1.0.6 colourpicker_1.0 rsconnect_0.8.15 tools_3.6.0 loo_2.1.0
[51] prettyunits_1.0.2 matrixStats_0.55.0 stringr_1.4.0 munsell_0.5.0 callr_3.3.2
[56] compiler_3.6.0 rlang_0.4.1 grid_3.6.0 ggridges_0.5.1 htmlwidgets_1.5.1
[61] miniUI_0.1.1.1 crosstalk_1.0.0 igraph_1.2.4.1 base64enc_0.1-3 testthat_2.2.1
[66] codetools_0.2-16 gtable_0.3.0 inline_0.3.15 abind_1.4-5 curl_4.2
[71] reshape2_1.4.3 markdown_1.1 R6_2.4.0 gridExtra_2.3 rstantools_2.0.0
[76] zoo_1.8-6 bridgesampling_0.7-2 dplyr_0.8.3 fastmap_1.0.1 shinythemes_1.1.2
[81] shinystan_2.5.0 rprojroot_1.3-2 desc_1.2.0 stringi_1.4.3 parallel_3.6.0
[86] tidyselect_0.2.5 coda_0.19-3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the brm model with and without the random slopes, using the reported RStan, brms, R, and macOS versions. Inspect the sampler call and compare rstan:::get_CXX() and the relevant MakeVars configuration. Done means identifying whether the failure is caused by the model or the local compilation/runtime setup and documenting a reproducible resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
22/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.