Elementwise ternary operator

I used the statement

phiReal = ( (C == 1)? m : (1 - m)) ;

where phiReal, C and m are all vector[N], and the compiler failed. Doesn’t the ternary operator recognize vector form?

Along the same line

for (k in 1:K){
  m[k] = expTerm[k] / (1 + expTerm[k]);
 } works

m = expTerm / (1 + expTerm); fails

No

The manual lists all the signatures available for all the functions, as do the error messages when you list the wrong ones.

For this, use the elementwise quotient ./
m = expTerm ./ (1 + expTerm);

Use inv_logit(u) rather than exp(u) / (1 + exp(u)).