Open
Description
I wish to execute the normal CDF on vector inputs to obtain a vector of cumulative probabilities. However, I am getting a dimension mismatch error. The error says the return on the right-hand side is of type “real”. The Stan documentation says that the cdf function accepts “reals” arguments and has “reals” returns. I thought this psuedotype “reals” included vectors yet it appears to be returning a scalar.
Example code:
vector[N] mu;
vector[N] sigma;
vector[N] x;
vector[N] phi;
phi = normal_cdf(x, mu, sigma);
Example error:
SYNTAX ERROR, MESSAGE(S) FROM PARSER:
Dimension mismatch in assignment; variable name = phi, type = vector; right-hand side type = real.
Illegal statement beginning with non-void expression parsed as
phi
Metadata
Metadata
Assignees
Labels
No labels