You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:\ProgramData\Anaconda3\lib\site-packages\hilo_mpc\modules\estimator\pf.py in _evaluate_likelihood(self, n_samples)
156 R = ca.SX.sym('R', (n_y, n_y))
157
--> 158 q = self._normpdf(Y, y, ca.sqrt(R)) # Since R is usually a diagonal matrix, we can use ca.sqrt() here. We need
159 # to change this, if we have non-diagonal matrices, i.e. covariance entries.
160 q /= ca.sum2(q)
C:\ProgramData\Anaconda3\lib\site-packages\casadi\casadi.py in call(self, *args, **kwargs)
23379 if len(args)>0:
23380 # Ordered inputs -> return tuple
23381 ret = self.call(args)
23382 if len(ret)==0:
23383 return None
C:\ProgramData\Anaconda3\lib\site-packages\casadi\casadi.py in call(self, *args)
20037
20038 """
RuntimeError: Error in Function::call for 'normpdf' [SXFunction] at .../casadi/core/function.cpp:339:
.../casadi/core/function_internal.hpp:1644: Input 0 (i0) has mismatching shape. Got 3-by-15. Allowed dimensions, in general, are:
The input dimension N-by-M (here 1-by-1)
A scalar, i.e. 1-by-1
M-by-N if N=1 or M=1 (i.e. a transposed vector)
N-by-M1 if K*M1=M for some K (argument repeated horizontally)
N-by-P*M, indicating evaluation with multiple arguments (P must be a multiple of 1 for consistency with previous inputs)
Some problem with initialization of probability distribution. I don't understand casadi, so I can't fix it myself.
The code works perfectly with EKF, UKF and MHE filters.
Thanks for help in advance.
The text was updated successfully, but these errors were encountered:
I'm trying to initialize the particle filter in the following way:
my model is Lorenz attractor initialized in the following way:
my attempt to initialize the particle filter ends in the following error:
18 observer= PF(model, roughening=True, plot_backend='bokeh')
---> 19 observer.setup()
20
C:\ProgramData\Anaconda3\lib\site-packages\hilo_mpc\modules\estimator\pf.py in setup(self, **kwargs)
290
291 self._propagate_particles(n_s)
--> 292 self._evaluate_likelihood(n_s)
293
294 n_x = self._model.n_x
C:\ProgramData\Anaconda3\lib\site-packages\hilo_mpc\modules\estimator\pf.py in _evaluate_likelihood(self, n_samples)
156 R = ca.SX.sym('R', (n_y, n_y))
157
--> 158 q = self._normpdf(Y, y, ca.sqrt(R)) # Since R is usually a diagonal matrix, we can use ca.sqrt() here. We need
159 # to change this, if we have non-diagonal matrices, i.e. covariance entries.
160 q /= ca.sum2(q)
C:\ProgramData\Anaconda3\lib\site-packages\casadi\casadi.py in call(self, *args, **kwargs)
23379 if len(args)>0:
23380 # Ordered inputs -> return tuple
C:\ProgramData\Anaconda3\lib\site-packages\casadi\casadi.py in call(self, *args)
20037
20038 """
RuntimeError: Error in Function::call for 'normpdf' [SXFunction] at .../casadi/core/function.cpp:339:
.../casadi/core/function_internal.hpp:1644: Input 0 (i0) has mismatching shape. Got 3-by-15. Allowed dimensions, in general, are:
Some problem with initialization of probability distribution. I don't understand casadi, so I can't fix it myself.
The code works perfectly with EKF, UKF and MHE filters.
Thanks for help in advance.
The text was updated successfully, but these errors were encountered: