Re: [Bayes++] Observation model for SIR scheme
Brought to you by:
mistevens
From: Michael S. <ma...@mi...> - 2006-11-18 19:20:54
|
Nicola, On Saturday, 18. November 2006 15:47, Nicola Bellotto wrote: > Steven, > > I modified my model inheriting from Likelihood_observe_model and copying > the likelihood function code, but I had continuosly exceptions like > "Roughening X not PSD" or "zero cumulative weight sum". > So I went back to the simplest example, the PV_SIR.cpp, and modified just a > little the observation model multiplying z_pred[0] and Hx(0,0) by 2 (see > attached file). This caused again a "zero cumulative weight sum" exception. > I looked through the library's code but I could not really understand the > reason of the problem. What am I doing wrong? I took a quick look at this because I was fearing a bug. Lucky for me the problem is with you small but significant change! Both the exceptions occur when the the SIR cannot solve the problem. As you found this is quite easy to achive. "zero cumulative weight sum" occurs when the Likelihoods computed for all the samples are zero. When you doubled z_pred and Hx you omited to double the true observation at line 199 in PV_SIR.cpp. Because the position is 1000 this meant that the observation was 2*1000-1000 away from the true. With an position variance of just 1, something 1000 away is very very unlikely. In fact the likeilhood computed is 0! You should also note that the SIR_scheme is only constructed with 10 samples. This is very few and can also very quickly lead to on 1 sample being chosen in many situations. This can lead to the "Roughening X not PSD" exception. In practice you will usualy need more particles. Even then, the standard SIR is very poor at solving problem if the prediction is far away from the observation. Michael -- ___________________________________ Michael Stevens Systems Engineering 34128 Kassel, Germany Phone/Fax: +49 561 5218038 Navigation Systems, Estimation and Bayesian Filtering http://bayesclasses.sf.net ___________________________________ |