CmdStan fails reading .R data on Linux

Hi everyone,

I hope this is now my last question on making CmdStan run on a Linux high-performance cluster. First of all: I ran the same model with the same data file on a Windows computer with CmdStan and it worked, so the model and the data are stored correctly.

I dumped the data with the stan_rdump command to the file “data.R”. I comiled my Stan model using the make command to a file with the name “hurdle_mod”. Now I am running
hurdle_mod sample datafile=data.R on the Linux machine and it tells me:
datafile=data.R is either mistyped or misplaced.
Failed to parse arguments, terminating Stan

Any ideas what’s causing this issue?

You have to specify it as data file=data.R. there is a space between data and file.

3 Likes

Thanks. Still, there is an error message at the end of the sample call:

method = sample (Default)
sample
num_samples = 1000 (Default)
num_warmup = 1000 (Default)
save_warmup = 0 (Default)
thin = 1 (Default)
adapt
engaged = 1 (Default)
gamma = 0.050000000000000003 (Default)
delta = 0.80000000000000004 (Default)
kappa = 0.75 (Default)
t0 = 10 (Default)
init_buffer = 75 (Default)
term_buffer = 50 (Default)
window = 25 (Default)
algorithm = hmc (Default)
hmc
engine = nuts (Default)
nuts
max_depth = 10 (Default)
metric = diag_e (Default)
metric_file = (Default)
stepsize = 1 (Default)
stepsize_jitter = 0 (Default)
id = 0 (Default)
data
file = data.R
init = 2 (Default)
random
seed = 179192142 (Default)
output
file = output.csv (Default)
diagnostic_file = (Default)
refresh = 100 (Default)
sig_figs = -1 (Default)

Can’t open specified file, “data.R”

In that case, make sure that data.R is at the location where you start the executable. Maybe specify the full absolute path to make sure.

The other problem could be that the file is protected somehow (no read permission for the user starting the sampling process).

3 Likes

Indeed, I had to specify the full path again. Thanks so much!

1 Like