31 upper_lcdf[i] = lognormal_lcdf(i | params[1], params[2]);
33 }
else if (dist == 1) {
35 upper_lcdf[i] = gamma_lcdf(i | params[1], params[2]);
38 reject(
"Unknown distribution function provided.");
42 lpmf[1] = upper_lcdf[1];
43 lpmf[2] = upper_lcdf[2];
45 lpmf[3:n] = log_diff_exp(upper_lcdf[3:n], upper_lcdf[1:(n - 2)]);
48 lpmf = lpmf - log_sum_exp(upper_lcdf[(n - 1):n]);