cmdstanr icon indicating copy to clipboard operation
cmdstanr copied to clipboard

Error with simple model

Open joscani opened this issue 10 months ago • 0 comments

Describe the bug Error compiling

To Reproduce


S <- rbinom(100,1, 0.3)

M <- 2 * S + rnorm(100, 0, 1)

D <-  5 + 5 * M + rnorm(100, 0, 1)
df <- data.frame(S = S , D = D, M = M)

library(cmdstanr)
library(brms)
library(ggdist) # pa pintar 
set_cmdstan_path(path = "~/.cmdstan/cmdstan-2.34.1/")
bf1 <- bf(M  ~  S)
bf2 <- bf(D  ~  M )
bf_full <- bf1 + bf2 + set_rescor(rescor = FALSE)

mod_full_luxury <- brm(
                       bf_full, 
                       chains = 4,
                       cores = 4, 
                       iter = 2000, 
                       data = df, 
                       backend = "cmdstanr")

! no se puede abrir la conexión
Backtrace:
  1. brms::brm(...)
  2. brms::do_call(compile_model, compile_args)
       at brms/R/brm.R:589:5
  3. brms:::eval2(call, envir = args, enclos = envir)
       at brms/R/misc.R:703:3
     ...
 17. cmdstanr (local) initialize(...)
       at R6/R/new.R:156:5
 18. self$compile(...)
 21. base::readLines(private$hpp_file_, warn = FALSE)
 22. base::file(con, "r")

using normal backend model run fine. Any idea? thanks

joscani avatar Mar 31 '24 16:03 joscani