# Laser Beam based model probability in case of single particle

I am trying to calculate likelihood of laser scan($Z$) at give pose($x$) with known map ($m$) using beam based model

$P\left(z_t|x_t,m \right)=\prod_{i=1}^{n}P'\left(z_i|x_t,m \right)$

My scan has 360 rays i.e $n=360$, When i calculate $P\left(z_t|x_t,m \right)$ it becomes zero as multiplication all propabilities $<1.$

In ROS amcl they are using ad-hoc which works better like

$P\left(z_t|x_t,m \right)+=\sum_{i=1}^{n}P'\left(z_i|x_t,m \right)*P'\left(z_i|x_t,m \right)*P'\left(z_i|x_t,m \right)$

later they normalise it with number of particle to get weight of each particle.

My query is how to get probability normalised and not zero with single calculation (i.e image in case of single particle)

Thanks.

$\log p\left(z_t|x_t,m \right)=\sum_{i=1}^{n} \log p'\left(z_i|x_t,m \right)$
If you try to compute the probability $p\left(z_t|x_t,m \right)$ by exponentiating its logarithm above, you will most likely still get 0. But in a particle filter, you can arbitrarily scale the measurement model likelihoods (weights are later normalized anyway), which corresponds to adding the same constant to the logarithms above for each particle.