Skip to content

Got error in kalman gain calculation #21

@royaalto

Description

@royaalto

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions