Main Page | Report this Page
 
   
Science Forum Index  »  Statistics - Math Forum  »  Bayesian inference
Page 1 of 1    
Author Message
Affan
Posted: Wed Apr 23, 2008 5:43 pm
Guest
I am asking a question that might be very very stupid but after nearly
2 weeks of searching for an answer I am still not clear what to do.

here is the deal: I am a CS grad, with very topological understanding
of the bayesian framework. In one of my robotics classes I was
introduced to the recursive bayesian update about a paritcular
hypothesis i.e. p(door open|z) where z is a sensor reading whose p(z|
open) and p(z| not open) are known as probabilities (not as
distributions, If you can explain that case, I would love to talk
about it but lets keep it simple first). Multiple readings of this
sensor will allow us to increase the probability of p(door open) if it
really is open using the posterior of one update as the prior for the
next.

My issue is how to make a decision? In case my only hypothesis is that
H_0: door is open, how can I make a decision.

Reading several books/articles/ papers on bayesian stats, one thing
that I am sorts of inclined to do is the following: define a negative
hypothesis say H_1:door is not open, and update both P(door open) and
P(door not open) for every measurement z received from the sensor.
Then after say 10 readings when I have to make a decision whether the
door is open (and I can go through it) or that the door is not open, I
compare P(H_1) and P(H_0). Whomever has higher probability is the
hypothesis i accept. Is that a correct or accepted way of doing this
decision? Is it equivalent to simply setting a threshold for P(door
open) > 0.5? If not what would be the correct way in this case.

Thank you.
Paul Rubin
Posted: Thu Apr 24, 2008 9:25 am
Guest
Affan wrote:

Quote:

My issue is how to make a decision? In case my only hypothesis is that
H_0: door is open, how can I make a decision.

Reading several books/articles/ papers on bayesian stats, one thing
that I am sorts of inclined to do is the following: define a negative
hypothesis say H_1:door is not open, and update both P(door open) and
P(door not open) for every measurement z received from the sensor.
Then after say 10 readings when I have to make a decision whether the
door is open (and I can go through it) or that the door is not open, I
compare P(H_1) and P(H_0). Whomever has higher probability is the
hypothesis i accept. Is that a correct or accepted way of doing this
decision?

I think that's appropriate if the number of readings (e.g., 10) before
you have to decide is fixed.

Quote:
Is it equivalent to simply setting a threshold for P(door
open) > 0.5?

Yes.

Quote:
If not what would be the correct way in this case.

If you're not locked into the prior/posterior update thing, and you
don't have a fixed sample size, you might want to consider the
sequential probability ratio test (see, for instance,
http://en.wikipedia.org/wiki/Sequential_probability_ratio_test). The
essence of the SPRT is that you keep sampling and updating the
likelihood of the sample you've got so far under each hypothesis. If
the ratio of the likelihood under H0: door is open to the likelihood
under H1: door is not open exceeds some limit you set, you stop sampling
and decide the door is open. If it falls below some other limit you
set, you stop sampling and decide the door is closed. If it stays
between the limits, you keep sampling.

Incidentally, whether you use SPRT or the Bayesian update scheme, you're
going to need to pay attention to whether the sensor readings are
independent of each other.

/Paul
Robert Dodier
Posted: Fri Apr 25, 2008 6:29 am
Guest
On Apr 24, 8:25 am, Paul Rubin <ru...@msu.edu> wrote:

Quote:
Is it equivalent to simply setting a threshold for P(door
open) > 0.5?

Yes.

That's true only if the payoffs for the different
outcomes are symmetric. In practical problems, that's
quite often not the case.

FWIW

Robert Dodier
Robert Dodier
Posted: Fri Apr 25, 2008 6:42 am
Guest
On Apr 23, 9:43 pm, Affan <int...@gmail.com> wrote:

Quote:
Multiple readings of this sensor will allow us to increase
the probability of p(door open) if it really is open using
the posterior of one update as the prior for the next.

Hmm, temporal dependence is always a lot of fun ....

Quote:
one thing that I am sorts of inclined to do is the following:
define a negative hypothesis say H_1:door is not open,

(1) Your vocabulary here suggests that you have not yet
successfully forgotten the useless significance testing
stuff you were taught in undergrad stats classes.
You'll need to try harder.

(2) A complication you might not want to handle yet:
If the sensor reading is an analog signal (e.g. sonar)
you might want to model the door state as a continuous
variable (i.e. degree of opening) instead of open/closed.

Quote:
Is that a correct or accepted way of doing this
decision? Is it equivalent to simply setting a threshold for P(door
open) > 0.5? If not what would be the correct way in this case.

The right way to make the decision is to assess the
payoffs for different outcomes (rewards for correct
statements, penalties for incorrect statements) and
then choose the action which minimizes expected penalty,
taking the expectation with respect to the computed
posterior distributions.

A useful reference for you is "Making Hard Decisions"
by Robert Clemen.

You can also take a look at Chapter 6 of my dissertation
which is linked from: http://riso.sourceforge.net

HTH

Robert Dodier
Affan
Posted: Fri Apr 25, 2008 12:47 pm
Guest
On Apr 25, 9:42 am, Robert Dodier <robert.dod...@gmail.com> wrote:
Quote:
On Apr 23, 9:43 pm, Affan <int...@gmail.com> wrote:

Multiple readings of this sensor will allow us to increase
the probability of p(door open) if it really is open using
the posterior of one update as the prior for the next.

Hmm, temporal dependence is always a lot of fun ....

one thing that I am sorts of inclined to do is the following:
define a negative hypothesis say H_1:door is not open,

(1) Your vocabulary here suggests that you have not yet
successfully forgotten the useless significance testing
stuff you were taught in undergrad stats classes.
You'll need to try harder.

(2) A complication you might not want to handle yet:
If the sensor reading is an analog signal (e.g. sonar)
you might want to model the door state as a continuous
variable (i.e. degree of opening) instead of open/closed.

Is that a correct or accepted way of doing this
decision? Is it equivalent to simply setting a threshold for P(door
open) > 0.5? If not what would be the correct way in this case.

The right way to make the decision is to assess the
payoffs for different outcomes (rewards for correct
statements, penalties for incorrect statements) and
then choose the action which minimizes expected penalty,
taking the expectation with respect to the computed
posterior distributions.

A useful reference for you is "Making Hard Decisions"
by Robert Clemen.

You can also take a look at Chapter 6 of my dissertation
which is linked from:http://riso.sourceforge.net

HTH

Robert Dodier

Thank you so much for that input... I will try to make my exact
algorithm and its scenario more clear now..

I am using a single frequency acoustic tone detection circuit (whose
threshold is set in hardware and is beyond my algorithm's control). I
can also send that acoustic tone for a fixed duration (say 5ms) and
then have to listen to the channel for echoes. The issue is that not
only can noise in the medium (underwater for my case) cause incorrect
detections, but also there might exists other nodes that
asynchronously send out similar tones for their own calibration. So my
sensor in some since is this binary tone detection circuit which might
be triggered by my own echoes, noise and other nodes calibration
tones. The key idea I want to use is that over multiple updates, only
the echoes will appear at the regular intervals (if the environment is
fixed) and all others will be irregular. So if I can bin my listen
time appropriately, I will be able to identify times when I get my own
echoes vs not.

On one hand SPRT might be a good choice, but I am also thinking about
what Robert suggested (thank you so much for the link to you
dissertation) and I think assigning payoffs to my decision an then
looking at the estimated payoff based on my decision would be a much
nicer approach given that I have the bayesian framework in place.

One last question, given my above description... the independence of
my sensor readings is correct? I am always confused about this
independence requirement as in real world everything would be related
in some sense but many bayesian algorithm thats I have looked at use
the readings nevertheless.

Thank you both, and I would love to hear both your in put on it.

Affan
Paul Rubin
Posted: Fri Apr 25, 2008 7:27 pm
Guest
Affan wrote:

Quote:

I am using a single frequency acoustic tone detection circuit (whose
threshold is set in hardware and is beyond my algorithm's control). I
can also send that acoustic tone for a fixed duration (say 5ms) and
then have to listen to the channel for echoes. The issue is that not
only can noise in the medium (underwater for my case) cause incorrect
detections, but also there might exists other nodes that
asynchronously send out similar tones for their own calibration. So my
sensor in some since is this binary tone detection circuit which might
be triggered by my own echoes, noise and other nodes calibration
tones...

One last question, given my above description... the independence of
my sensor readings is correct?

Could a passing marine animal emit sounds that would confuse the sensor?
If so, it seems you could lose sequential independence; the animal
might interfere with two or three consecutive pings but not with those
before or after. Similarly, if water conditions (something like a
thermocline) could interfere, and the interference were transient
(either because conditions changed or because the sensor was moving),
that could again induce sequential dependence.

/Paul
Affan
Posted: Sun Apr 27, 2008 11:25 am
Guest
On Apr 25, 5:27 pm, Paul Rubin <ru...@msu.edu> wrote:
Quote:
Affan wrote:

I am using a single frequency acoustic tone detection circuit (whose
threshold is set in hardware and is beyond my algorithm's control). I
can also send that acoustic tone for a fixed duration (say 5ms) and
then have to listen to the channel for echoes. The issue is that not
only can noise in the medium (underwater for my case) cause incorrect
detections, but also there might exists other nodes that
asynchronously send out similar tones for their own calibration. So my
sensor in some since is this binary tone detection circuit which might
be triggered by my own echoes, noise and other nodes calibration
tones...

One last question, given my above description... the independence of
my sensor readings is correct?

Could a passing marine animal emit sounds that would confuse the sensor?
If so, it seems you could lose sequential independence; the animal
might interfere with two or three consecutive pings but not with those
before or after. Similarly, if water conditions (something like a
thermocline) could interfere, and the interference were transient
(either because conditions changed or because the sensor was moving),
that could again induce sequential dependence.

/Paul

I agree, but if we decide based on a large window of inputs, or the
inputs are continuously repeated returning wouldn't these transients
get filtered out? if not, what is the way of handling it.. remember
that I am not trying provide a closed form solution; this is meant to
be a working implementation and if such sequential dependence can be
dismissed based on some heuristic e.g. taking a window of samples to
make decision, or something else that can be suggested, i would still
be content.

Thank yuo.
Paul Rubin
Posted: Sun Apr 27, 2008 5:23 pm
Guest
Affan wrote:

Quote:
One last question, given my above description... the independence of
my sensor readings is correct?

Could a passing marine animal emit sounds that would confuse the sensor?
If so, it seems you could lose sequential independence; the animal
might interfere with two or three consecutive pings but not with those
before or after. Similarly, if water conditions (something like a
thermocline) could interfere, and the interference were transient
(either because conditions changed or because the sensor was moving),
that could again induce sequential dependence.


I agree, but if we decide based on a large window of inputs, or the
inputs are continuously repeated returning wouldn't these transients
get filtered out?

Not exactly. I'm thinking in terms of the SPRT here, but I think serial
correlation will bite you pretty much no matter what you try.

The SPRT is based on likelihood functions that in turn assume
independent observations. If the observations had a consistent serially
dependence, and if you knew (or at least could estimate) the parameters
of their dependence structure, you could (I think) modify the likelihood
function to take the dependence into account. You don't have a way of
modeling the dependence on the fly, though, and in any case transients
like a passing critter would not create a consistent dependence, so
that's a non-starter. The result is that you do the SPRT assuming
independence and, if autocorrelation crops up along the way, the test
potentially goes awry.

As an example, let's assume you're pinging the door and no echo/weak
echo/delayed echo is interpreted as door open. Rather than deciding
based on one ping, you'll ping intermittently and use SPRT to decide
when the evidence is strong enough. Charlie the Tuna decides to park in
front of the open door long enough for several consecutive pings to
bounce off him. The sensor sees n consecutive returns. Now n
consecutive _independent_ returns might be fairly conclusive that the
door is closed (the alternative being a bunch of fish taking turns
blocking the pings), but in this case the pings are not independent. So
SPRT incurs a Type I risk (assuming H0 is door open) greater than what
the user had in mind when he set the threshold for how many returns is
too many.

If Charlie moves on before the SPRT yields a decision, the effects of
the serial correlation will diminish asymptotically.

Quote:
if not, what is the way of handling it.. remember
that I am not trying provide a closed form solution; this is meant to
be a working implementation and if such sequential dependence can be
dismissed based on some heuristic e.g. taking a window of samples to
make decision, or something else that can be suggested, i would still
be content.

I'm not sure there is a fix for this. Maybe you pays your money and you
takes your chances. The best preventative measure I can think of is to
space the readings far apart in time, but my guess is that the
application you have in mind lacks infinite patience. Depending on what
you're doing, and what all attributes you measure with each reading, it
might be possible to argue that too much consistency in consecutive
readings (readings that basically look identical) is a sign of possible
autocorrelation, in which case you could drop the identical readings or
give them a reduced weight. Then again, maybe pinging a closed door
_should_ give nearly identical readings.

Personally, I'd probably do one of the following: either (a) ignore
autocorrelation, use the SPRT, and try to present an argument that tuna
don't block the door often enough to worry; or (b) ignore
autocorrelation, use the SPRT, and suggest that whoever is in charge
loosen the thresholds of the SPRT a bit (making it harder to reach
either decision) as a fudge to protect against the unmeasurable (but
hopefully small) possibility of sequential dependence. It's imperfect,
but it at least lets you reach some kind of closure. (There was a short
discussion in another group about the tendency of academics -- that
would be me -- to look for perfect solutions while practitioners --
possibly including you -- settle for good solutions because the latter
actually have finite project horizons.)

/Paul
Robert Dodier
Posted: Tue Apr 29, 2008 5:12 am
Guest
Affan wrote:

Quote:
So my sensor in some since is this binary tone detection circuit which
might be triggered by my own echoes, noise and other nodes calibration
tones.

I would be inclined to model this as some variety of so-called
hidden Markov model. The states of things in the world are
Markov chains, which you cannot observe directly. Instead you
see the effects of things (i.e. sensor readings). The game is to
infer the unobserved state of the world from observed sensor
readings.

Googling for hidden Markov model should bring up a lot of hits.
There are many variations on the basic idea.

Quote:
One last question, given my above description... the independence of
my sensor readings is correct?

When the state of the world is unknown (which is generally the case)
then what you know about one sensor reading tells you something
about other sensor readings, i.e., they are dependent.

Hope this helps, & good luck.

Robert Dodier
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Thu Jul 24, 2008 10:33 pm