Closed ff995 closed 3 years ago
This is a good point that I should add some documentation or a helpful error message about! So it is because the uncertainty (dy
) in this example code has 0 values, so when the kernel density approximation is performed to get a description of the data likelihood form it sees a delta-function and returns a singular matrix.
TLDR; your uncertainty has 0 values which uravu
considers physically unrealistic.
I am gonna leave the issue open so that I can add some documentation and an error message.
Thanks for using uravu
though!
Thank you for responding. I have changed the value of dy to that used in the working example, but I still get the same error. I think in the 0*y case, dy is an array of zeroes.
You still have a 0 value in the dy
value, because x[0] = 0
, y[0] = 4 * x[0] = 0
, and dy[0] = y[0] * 0.2 = 0
. Does that make sense?
If you are interested in contributing a page for the documentation, or adding an error message related to this issue please feel free to open a pull request 😄
Ah yes it works fine now, my apologies for misunderstanding you and thanks for your help.
Awesome! Thanks for using uravu
, if you have any other comments/issues please get in touch!
Added a nice error message in 450c6dc644687ebd6247fa27894a017b75984b53.
Hello
Sorry to bother you again. But when working with certain functions and arrays, the relationship object throws a LinAlgError citing a singular matrix. Do you know which factors may cause this? It seems to occur during line 59 of code within Relationship:
if ordinate_error is not None: potential_y.append(Distribution(stats.norm.rvs(loc=y, scale=ordinate_error[i], size=5000))) I have attached instances where the object works and when it throws an error.