I don’t know for certain that this will fix the problem (I suspect it will), but you could check if tcrossprod
is more stable. See here: 5.5 Dot Products and Specialized Products | Stan Functions Reference
2 Likes