Gamma distribution quantile and inverse quantile function

Good timing! I was just looking into this. It looks like the error has something to do with how cmdstanr handles Windows paths. I can replicate your error, and then fix it if I use the Windows short path name.

Can you try the cmdstan_model call again, but this time wrap the getwd() calls in a call to utils::shortPathName:

mod = cmdstan_model("model_gamma.stan", include_paths = utils::shortPathName(getwd()),
                    cpp_options = list(USER_HEADER = file.path(utils::shortPathName(getwd()), "gamma_icdf.hpp")),
                    stanc_options = list("allow-undefined"))
1 Like