Bayesian probability with negative conditions

118 Views Asked by At

I'm trying to construct a probability model which analyzes signals if someone is in the neighbourhood. There are let's say 20 machines in the neighbourhood (of the wifi router) producing a wifi signal, and I wish create a MAP estimate which machine corresponds to my smartphone. (I know, it would be easier to just look up the MAC address, but this way is more fun)

To do this, I collect 1000 datapoints (the MAC addresses) during the day and I keep track when I'm at home so that my smartphone is in range of the router. This is a simple model, so I can only track whether the mac address is in range ($s_i$, binary) and whether I am home ($(h)$, binary).

A simple Bayesian model would lead to: $p(s_i | h) = \frac{p(h|s_i)p(s_i)}{p(h)}$. I implemented this in the computer and I found that the specificity of this model isn't that high, so if a device transmits a lot of signals (also when I'm not at home) the posterior probability will still be higher.

I wish to have a probability distribution which takes not only true positives into account but also true negatives (and perhaps even false positives/negatives). I tried to find a bayesian distribution but I couldn't find it. Is there a formula for this?

I tried: $$p(s_i|h) \propto p(h|s_i)p(s_i)p(\neg h|\neg s_i)p(\neg s_i)$$ This seems to work for me, but is it correct? Am I missing parts?

EDIT: what I'm looking for is a derivation from the regular Bayes' theorem to prove that my formula is correct/needs more tweaking.