I would like to propagate uncertainties from calculations involving linear algebra. I found this package called "uncertainties", however it seems to not be working with the "np.linalg" package. Does anyone know a way to do this?
Asked
Active
Viewed 428 times
1
-
uncertainties has its own linalg facility for basic operations (inverse and pseudo inverse) – talonmies May 18 '21 at 04:57
-
@talonmies yes, but I think these 2 are the only operations. I am not sure how to do anything else, for example determinants. – JohnDoe122 May 18 '21 at 05:11
-
Does this package use `numpy` or otherwise explain how to use it with `numpy`? Don't count on `numpy` to do anything meaningful with unrelated packages. The fast compiled code works with numeric dtype arrays. Some math works with object dtype arrays, provided the objects have enough math methods, but the operations will be slower. `dot` can work with objects, `det` cannot. Example: https://stackoverflow.com/questions/67575209/numpy-linalg-det-of-square-array-of-mpmath-mpfs – hpaulj May 18 '21 at 06:01
-
They are the only two. But you haven't explained anything about what you actually want to do, so it is pretty hard to suggest anything concrete. A lot of numpy native linalg routines use compiled C or Fortran from libraries like BLAS and only support numpy built-in dtypes. Those can't use the ufloat. But others which are python implementations can – talonmies May 18 '21 at 06:17
-
@talonmies determinants would be a good example of what I want to do. I don't have to use numpy anything that allows me to calculate the uncertainties propagation when calculating a determinant is ok – JohnDoe122 May 18 '21 at 13:16
-
@hpaulj I don't have to use numpy. Anything that allows me to compute error propagation on determinants is fine – JohnDoe122 May 18 '21 at 13:17
-
1What size is the matrix? – hpaulj May 18 '21 at 13:48
-
@hpaulj It has different sizes, depending on the problem. Usually it is below 10x10. – JohnDoe122 May 19 '21 at 14:12