Hi,

I have written a small function below and have a questions: can Stan do the following computation,“z = ((1 + pos).^p -1)/p”? I could not find any information in the manual on this. I read about this in 2014 and 2016 but it is not clear if this is possible yet.

```
functions {
vector g(vector y, real p) {
int N;
N = rows(y);
vector[N] pos;
vector[N] neg;
vector[N] z;
vector[N] w;
real eps;
pos = y.*(y >= 0);
neg = y.*(y < 0);
eps = 0.005;
if (p >= -eps & p <= eps) z = log(1 + pos);
else z = ((1 + pos).^p -1)/p;
if (p >= 2-eps & p <= 2+eps) w = -log(1 - neg);
else w = -((1 - neg).^(2-p) - 1)/(2-p);
return w+z;
}
}
```

Operating System: Windows 7

Interface Version: RStan

Thanks,

Raphael

[edit: escape code]