Helpful Stan Functions
Logical functions for arrays

Functions

int in_order (array[] real theta)
 

Detailed Description

int in_order(array[] real theta) {
int K = num_elements(theta);
if (theta[1] == negative_infinity())
reject("first element must be finite");
for (k in 2 : K)
if (theta[k] <= theta[k - 1])
reject("bounds and quantiles are not in the right order");
return 1;
}
int in_order(array[] real theta)
Definition: logical_array.stanfunctions:16

Function Documentation

◆ in_order()

int in_order ( array[]real  theta)

Checks whether real numbers are finite and ordered.

Parameters
thetareal array of numbers
Exceptions
ifreal numbers are not finite or not ordered
Returns
1 if real numbers are finite and ordered