Hello Stan gurus,
Is there any efficientent way of writting in Stan e.g.:
M <- matrix(1:9,3,3)
I <- ifelse(M < 5, 1, 0)
Or I need a double loop?
Thanks in advance
Hello Stan gurus,
Is there any efficientent way of writting in Stan e.g.:
M <- matrix(1:9,3,3)
I <- ifelse(M < 5, 1, 0)
Or I need a double loop?
Thanks in advance
There’s no builtin method for that but (unlike R) Stan is a complied language and loops are quite efficient.