Singular Matrix Error
See original GitHub issueI’m trying to carry out one dimensional kriging using the python module ‘pykrige’ but I’m getting a few errors.
I tried to pass a zero vector as argument for the second variable.
My code is as below
hs = np.array(np.arange(0,1,bw))
hs0 = np.zeros(len(hs))
OK = OrdinaryKriging(P[:, 0], P[:, 1], P[:, 2], variogram_model='linear',
verbose=False, enable_plotting=False)
z, ss = OK.execute('grid', hs, hs0)
It gives me a linear algebra error when I run the execute
command.
File "/home/home_shihab/miniconda3/lib/python3.6/site-packages/pykrige/ok.py", line 396, in _exec_vector
a_inv = scipy.linalg.inv(a)
File "/home/home_shihab/miniconda3/lib/python3.6/site-packages/scipy/linalg/basic.py", line 976, in inv
raise LinAlgError("singular matrix")
LinAlgError: singular matrix
Can anyone please help me with this?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Causes of a Singular Matrix Error on the TI-83 Plus and TI-84 ...
The message "ERROR:SINGULAR MATRIX" may be the result of one of two possible things. The first reason is an attempt to take the...
Read more >Error: Singular Matrix - python - Stack Overflow
A singular matrix is a matrix that cannot be inverted, or, equivalently, that has determinant zero. For this reason, you cannot solve a ......
Read more >Error: Singular Matrix - Knowledge Base - COMSOL
Your problem (equation system combined with the boundary conditions) is over- or underspecified. Check the equations and boundary conditions. You will often see ......
Read more >How to Fix: numpy.linalg.LinAlgError: Singular matrix - Statology
This error occurs when you attempt to invert a singular matrix, which by definition is a matrix that has a determinant of zero...
Read more >Understanding LinAlgError Singular Matrix - Python Pool
It means that the error occurred because of some linear algebra operation that is computationally incorrect. Talking more descriptively, we can ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This should be fixed with
v1.5.1
that will be released tomorrow. Closing for now. Feel free to re-open, if you have further questions.We could implement the pseudo-inverse for the case where we have a singular matrix, that can occur frequently when the number of points is to low, or the variogram-model is ill-choosen.