Closed dunajevas closed 10 years ago
Are you running RStan 2.4?
If you're running into the problem mostly during warmup, you should be fine. Stan has to figure out the right scale to make jumps and before it does that, the arithmetic instability causes these errors in poorly conditioned models (and that's just about anything in high dimensions [and 50 counts as high here] trying to factor a covariance matrix [which multi_normal and multi_normal_prec do]). I wouldn't expect so many errors in 2 dimensions, though I don't see anything wrong with your model.
From a user point of view, it seriously reduces the usability of Stan. The problem is that using covariance matrices and factoring them (as required for the covariance matrix parameterization of multinormal) is very imprecise arithmetically.
I thought we'd relaxed the error checking in 2.4, but apparently not enough. Ben may have some suggestions on how to rewrite your models.
I'm closing this issue and referring you to #256.
For a 2x2 covariance matrix, it less likely to run into numerical errors if you specify two standard deviations and a correlation in the parameters block and construct the matrix in the model block. But then in order to use an inverse Wishart prior, you would have to do some stuff with the Jacobian. There is an example of this for the Wishart (not inverse Wishart at)
But that is probably overkill; just ignore the informational message.
i'm trying to fit basic Bayesian mixture model for bivariate normal and uniform distributions. Basically when I increase degrees of freedom parameter (
wishart_df
) I get this warning (mostly during warm up stage, but if I increase degrees of freedom it becomes quite frequent):I saw this error in https://github.com/stan-dev/stan/issues/662, but my variance matrix is correcly specified as
cov_matrix
type. Is there anything that might be wrong with my model? Here is my code