# Gamma distribution quantile and inverse quantile function

**URL:** <https://discourse.mc-stan.org/t/gamma-distribution-quantile-and-inverse-quantile-function/22882>\
**Category:** General\
**Tags:** math, rstan, fitting-issues, specification, techniques\
**Created:** [June 7, 2021, 9:00am UTC](https://discourse.mc-stan.org/t/gamma-distribution-quantile-and-inverse-quantile-function/22882 "2021-06-07T09:00:17Z")\
**Posts on this page:** 1\
**Showing post:** 37

<div class="post-metadata">

**Author:** ![andrjohns](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/andrjohns/32/15297_2.png) [@andrjohns](https://discourse.mc-stan.org/u/andrjohns)\
**Post date:** [June 14, 2021, 8:30am UTC](https://discourse.mc-stan.org/t/gamma-distribution-quantile-and-inverse-quantile-function/22882/37 "2021-06-14T08:30:58Z")

</div>

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`:

```r
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"))

```

---

_[View the full topic](https://discourse.mc-stan.org/t/gamma-distribution-quantile-and-inverse-quantile-function/22882)._
