Trying to set max_depth in CmdStan; error messages no help


#1

Ok, so I’m trying to set max_depth at the command line with CmdStan. I first try the following:

../stan_models/rff-fb id=1 data file=curve_data.Rdump output file=output-1.csv max_depth=15

This gets me the following error messages:

max_depth=15 is either mistyped or misplaced.
Perhaps you meant one of the following valid configurations?
  method=sample sample algorithm=hmc hmc engine=nuts nuts max_depth=<int>
A method must be specified!
Failed to parse arguments, terminating Stan

Ok, that advice seems simple enough, so the command line is now as follows:

../stan_models/rff-fb id=1 data file=curve_data.Rdump output file=output-1.csv method=sample sample algorithm=hmc hmc engine=nuts nuts max_depth=15

Now I get these error messages:

sample is either mistyped or misplaced.
Perhaps you meant one of the following valid configurations?
  method=sample sample
Failed to parse arguments, terminating Stan

To say that this is less than helpful is putting it mildly. What am I missing here?

ETA: I figured out how the error messages were lying to me. This works:

../stan_models/rff-fb id=1 data file=curve_data.Rdump output file=output-1.csv method=sample algorithm=hmc engine=nuts max_depth=15

This also works:

../stan_models/rff-fb id=1 data file=curve_data.Rdump output file=output-1.csv sample algorithm=hmc engine=nuts max_depth=15

#2

Here’s a call I used a while ago with a bunch of arguments. Maybe it helps?

stan_prog sample algorithm=hmc engine=nuts max_depth=10 num_samples=200 num_warmup=200 adapt delta=.8 random seed=123456 id=1 data file=dat_!country!.Rdump init=2 output file=output_by_c_!country!_chain_1.csv refresh=1

Note: The order of the arguments matter…


#3

The problem wasn’t the order of the arguments. The problem is that the error messages suggested an invalid command line with extraneous arguments, e.g. “algorithm=hmc hmc” instead of just “algorithm=hmc”.


#4

Thanks for creating the issue on the CmdStan repo. Hopefully we’ll fix this soon or replace the whole command-line interface arrangement with something flatter.