Stan function for vector %*% matrix %*% vector

Not if a and b differ. If they were the same, you could use quad_form. Just do real foo = a * M * b;.

1 Like