Skip to content

Error: Can't find the following sampler diagnostic(s) in the output: treedepth__, divergent__ #364

Closed
@wlandau-lilly

Description

@wlandau-lilly

Describe the bug

$fit() errors out when I try to run it in the Mac OS terminal. Oddly enough, the same example runs without errors in the RStudio IDE.

To Reproduce

library(cmdstanr)
#> This is cmdstanr version 0.2.0
#> - Online documentation and vignettes at mc-stan.org/cmdstanr
#> - CmdStan path set to: /Users/c240390/.cmdstanr/cmdstan-2.25.0
#> - Use set_cmdstan_path() to change the path
data <- list(
  n = 100,
  x = rnorm(100),
  y = rnorm(100)
)
writeLines(
  c(
    "data {",
    "  int <lower = 1> n;",
    "  vector[n] x;",
    "  vector[n] y;",
    "}",
    "parameters {",
    "  real alpha;",
    "  real beta;",
    "  real <lower = 0> sigma;",
    "}",
    "model {",
    "  y ~ normal(alpha + x * beta, sigma);",
    "  alpha ~ normal(0, 1);",
    "  beta ~ normal(0, 1);",
    "  sigma ~ cauchy(0, 1);",
    "}"
  ),
  "example.stan"
)
model <- cmdstan_model("example.stan")
#> Compiling Stan program...
fit <- model$sample(data = data, refresh = 0)
#> Running MCMC with 4 sequential chains...
#> 
#> Chain 1 finished in 0.0 seconds.
#> Chain 2 finished in 0.1 seconds.
#> Chain 3 finished in 0.1 seconds.
#> Chain 4 finished in 0.0 seconds.
#> 
#> All 4 chains finished successfully.
#> Mean chain execution time: 0.1 seconds.
#> Total execution time: 0.7 seconds.
#> Error: Can't find the following sampler diagnostic(s) in the output: treedepth__, divergent__

Created on 2020-11-22 by the reprex package (v0.3.0)

Session info
devtools::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.0.3 (2020-10-10)
#>  os       macOS Catalina 10.15.7      
#>  system   x86_64, darwin17.0          
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       America/New_York            
#>  date     2020-11-22                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date       lib source                            
#>  assertthat    0.2.1   2019-03-21 [1] CRAN (R 4.0.0)                    
#>  backports     1.2.0   2020-11-02 [1] CRAN (R 4.0.2)                    
#>  callr         3.5.1   2020-10-13 [1] CRAN (R 4.0.2)                    
#>  checkmate     2.0.0   2020-02-06 [1] CRAN (R 4.0.0)                    
#>  cli           2.2.0   2020-11-20 [1] CRAN (R 4.0.2)                    
#>  cmdstanr    * 0.2.0   2020-11-22 [1] Github (stan-dev/cmdstanr@3b7fbe5)
#>  crayon        1.3.4   2017-09-16 [1] CRAN (R 4.0.0)                    
#>  data.table    1.13.2  2020-10-19 [1] CRAN (R 4.0.2)                    
#>  desc          1.2.0   2018-05-01 [1] CRAN (R 4.0.0)                    
#>  devtools      2.3.2   2020-09-18 [1] CRAN (R 4.0.2)                    
#>  digest        0.6.27  2020-10-24 [1] CRAN (R 4.0.2)                    
#>  ellipsis      0.3.1   2020-05-15 [1] CRAN (R 4.0.0)                    
#>  evaluate      0.14    2019-05-28 [1] CRAN (R 4.0.0)                    
#>  fansi         0.4.1   2020-01-08 [1] CRAN (R 4.0.0)                    
#>  fs            1.5.0   2020-07-31 [1] CRAN (R 4.0.2)                    
#>  glue          1.4.2   2020-08-27 [1] CRAN (R 4.0.2)                    
#>  highr         0.8     2019-03-20 [1] CRAN (R 4.0.0)                    
#>  htmltools     0.5.0   2020-06-16 [1] CRAN (R 4.0.2)                    
#>  jsonlite      1.7.1   2020-09-07 [1] CRAN (R 4.0.2)                    
#>  knitr         1.30    2020-09-22 [1] CRAN (R 4.0.2)                    
#>  magrittr      2.0.1   2020-11-17 [1] CRAN (R 4.0.2)                    
#>  memoise       1.1.0   2017-04-21 [1] CRAN (R 4.0.0)                    
#>  pkgbuild      1.1.0   2020-07-13 [1] CRAN (R 4.0.2)                    
#>  pkgload       1.1.0   2020-05-29 [1] CRAN (R 4.0.0)                    
#>  prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.0.0)                    
#>  processx      3.4.4   2020-09-03 [1] CRAN (R 4.0.2)                    
#>  ps            1.4.0   2020-10-07 [1] CRAN (R 4.0.2)                    
#>  R6            2.5.0   2020-10-28 [1] CRAN (R 4.0.2)                    
#>  remotes       2.2.0   2020-07-21 [1] CRAN (R 4.0.2)                    
#>  rlang         0.4.8   2020-10-08 [1] CRAN (R 4.0.2)                    
#>  rmarkdown     2.5     2020-10-21 [1] CRAN (R 4.0.2)                    
#>  rprojroot     2.0.2   2020-11-15 [1] CRAN (R 4.0.2)                    
#>  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 4.0.0)                    
#>  stringi       1.5.3   2020-09-09 [1] CRAN (R 4.0.2)                    
#>  stringr       1.4.0   2019-02-10 [1] CRAN (R 4.0.0)                    
#>  testthat      3.0.0   2020-10-31 [1] CRAN (R 4.0.2)                    
#>  usethis       1.6.3   2020-09-17 [1] CRAN (R 4.0.2)                    
#>  withr         2.3.0   2020-09-22 [1] CRAN (R 4.0.2)                    
#>  xfun          0.19    2020-10-30 [1] CRAN (R 4.0.2)                    
#>  yaml          2.2.1   2020-02-01 [1] CRAN (R 4.0.0)                    
#> 
#> [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

Expected behavior

No error.

Operating system

Mac OS 10.15.7

CmdStanR version number

0.2.0

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions