0

I would like to use the quantile of a vector in stan but the function quantile doesn't seem to work. See the ** ** in the following example.

data{
    vector[10] y;
    vector[10] x;
}

parameters{
    real a;
    real b;
}


model{
    vector[10] mu;
    real Q;
    mu = a*x+b;
    **Q = quantile(y-mu, 0.66);**
}
PerrySun
  • 187
  • 1
  • 1
  • 8
  • Why would you want to generate a quantile at every step of the MCMC process? Just take the quantile from the posterior distribution. – mfidino Feb 10 '16 at 15:05

1 Answers1

1

The quantile function does not exist in the Stan language.

Stan's language focuses on expressing differentiable statistical models. The quantile function is not differentiable.

syclik
  • 203
  • 1
  • 5