Here is a quickie (?!) but I’ve no luck from Google, this forum search, nor chatGPT.
In generated quantities
I need to find the first index of an array where an inequality is met. Why can’t I do
ordered[K-1] cH; // cut points
real etaS; // x beta plus logistic draw
int response; // prediction from K possible responses
...
response = sum( etaS> cH );
The above gives an error like
Ill-typed arguments supplied to infix operator >. Available signatures:
(int, int) => int
(int, real) => int
(real, int) => int
(real, real) => int
which maybe is fully self explanatory: there are no inequality operators defined between anything except scalars?
If the answer is stupidly simple, can you also mention how I should have found the answer in the docs? I looked in function reference manual (typing, cast, convert, etc, and looked through the real type functions for a real(), etc ) and Reference manual (inequality, <, etc) for anything on comparing scalars to a vector and on treating an ordered like a real.
Thank you!
c