Non-positive-definite observation covariance matrix encountered at period 0
This happens in step 14 of the model from your page
mod.update_variances
File statsmodels/tsa/statespace/_cfa_simulation_smoother.pyx:616 in statsmodels.tsa.statespace._cfa_simulation_smoother.dCFASimulationSmoother.update_sparse_posterior_moments
LinAlgError: Non-positive-definite observation covariance matrix encountered at period 0
I suspect it has to do with the data itself or the parameters. I have no exogenous variables; however, I have gaps in the data.
--
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystatsmodel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/d13f40b8-90a2-4475-ace0-d4037236472dn%40googlegroups.com.
Hi Chad,
I thank you very much for the help and the code.
As a general comment, I think you should update the page at some point, with the knowledge and interaction of the various users.
As a preface to my code, I arrived at the last points 16 and 17 of the guide, to explore the credible intervals of each of the variance, covariance, and variance parameters. I was given the code by a colleague in a slightly different way, trying to overcome the resulting error of not producing a graph and handling variables with one or fewer data points and excluding them from the plots., as it turns out that to be the cause.
anaconda3/lib/python3.8/site-packages/arviz/stats/density_utils.py:606: UserWarning: Something failed: `x` is of length 1. Can't produce a KDE with only one data point.
warnings.warn("Something failed: " + str(e))
<Figure size 576x432 with 0 Axes>.
Traceback (most recent call last):
For both points 16 and 17, it is the same error, It produces only empty plots. The code I was given for the credible interval is the following. I would appreciate any ideas or help.
Best,
David