Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got error in kalman gain calculation #21

Open
royaalto opened this issue Jun 5, 2022 · 0 comments
Open

Got error in kalman gain calculation #21

royaalto opened this issue Jun 5, 2022 · 0 comments

Comments

@royaalto
Copy link

royaalto commented Jun 5, 2022

different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
arr = N.array(data, dtype=dtype, copy=copy)

UFuncTypeError Traceback (most recent call last)
/home/roy/softwares/Kalman/Extended-Kalman-Filter-CHCV.ipynb Cell 39' in <cell line: 1>()
47 S = JH @ P @ JH.T + R
48 S.astype('float64')
---> 49 K = (P @ JH.T) @ np.linalg.inv(S)
50 # K=(PJH.T)inv(JHPJH.T + R)#Kalman Gain
51 # Update the estimate via
52 Z = measurements[:,filterstep].reshape(JH.shape[0],1)

File <array_function internals>:180, in inv(*args, **kwargs)

File ~/.local/lib/python3.10/site-packages/numpy/linalg/linalg.py:545, in inv(a)
543 signature = 'D->D' if isComplexType(t) else 'd->d'
544 extobj = get_linalg_error_extobj(_raise_linalgerror_singular)
--> 545 ainv = _umath_linalg.inv(a, signature=signature, extobj=extobj)
546 return wrap(ainv.astype(result_t, copy=False))

UFuncTypeError: Cannot cast ufunc 'inv' input from dtype('O') to dtype('float64') with casting rule 'same_kind'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant