Inverse normalized lower incomplete gamma function

Hello everyone, I hope you are well.

Could you help me by showing how I can have the inverse function of the incomplete regularized range here in Stan. I believe it is not implemented because I already checked at 3.13 Combinatorial Functions | Stan Functions Reference

Would the following code be correct ?


data {
  real a;  // Shape parameter
  real x;  // Probability value
}

parameters {
  real<lower=0> lambda;  // Inverse normalized lower incomplete gamma function result
}

model {
  lambda ~ inv_gamma_p(a, x);
}

generated quantities {
  real result = lambda;  // Store the result in a variable
}

Edit: @maxbiostat edited this post for syntax highlighting