Main Page | Report this Page
 
   
Science Forum Index  »  Statistics - Math Forum  »  WinBugs Conditional Formulation
Page 1 of 1    
Author Message
Jean
Posted: Fri Mar 16, 2007 9:27 am
Guest
I realize that this should be probably be an easy question, but I'm
drawing a mental block. Any suggestions on the following problem
would be appreciated.

Problem: I have a large simulation program that, given a set of fixed
input conditions, provides a random response D.

The general problem is structured: P(D|a,g,h) P(g) P(h) P(a | b) P(b|
c) P( c) . G, H, C are random variables with random statistical
charateristics, e.g. mean and variance are random variables. Once C is
sampled, I know P(b|c) and P(a|b) [fixed probabilities]. One goal of
the analysis is to characterize the CDF of P(D| c) .

It seems to me that this should be relatively easy to setup in
Winbugs, but I seem to be making it more complicated than it should
be. Can I treat the parameters P(a | b) and P(b|c) as just weights?
Any suggestions on a WinBugs formulation would be very welcome.


Jean
Anon.
Posted: Fri Mar 16, 2007 2:51 pm
Guest
Jean wrote:
Quote:
I realize that this should be probably be an easy question, but I'm
drawing a mental block. Any suggestions on the following problem
would be appreciated.

Problem: I have a large simulation program that, given a set of fixed
input conditions, provides a random response D.

The general problem is structured: P(D|a,g,h) P(g) P(h) P(a | b) P(b|
c) P( c) . G, H, C are random variables with random statistical
charateristics, e.g. mean and variance are random variables. Once C is
sampled, I know P(b|c) and P(a|b) [fixed probabilities]. One goal of
the analysis is to characterize the CDF of P(D| c) .

It seems to me that this should be relatively easy to setup in
Winbugs, but I seem to be making it more complicated than it should
be. Can I treat the parameters P(a | b) and P(b|c) as just weights?
Any suggestions on a WinBugs formulation would be very welcome.

No, they're stochastic nodes: draw the DAG and it should become clear.

Of course, your proability densities have to be ones that BUGS supports
(unless you want to start playing with the ones trick).

It's difficult to give more precise advice, without knowing the details
of the model.

Bob

--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland

Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB: www.jnr-eeb.org
Jean
Posted: Tue Mar 20, 2007 10:09 am
Guest
On Mar 16, 1:51 pm, "Anon." <bob.oh...@helsinki.fi> wrote:
Quote:
Jeanwrote:
I realize that this should be probably be an easy question, but I'm
drawing a mental block. Any suggestions on the following problem
would be appreciated.

Problem: I have a large simulation program that, given a set of fixed
input conditions, provides a random response D.

The general problem is structured: P(D|a,g,h) P(g) P(h) P(a | b) P(b|
c) P( c) . G, H, C are random variables with random statistical
charateristics, e.g. mean and variance are random variables. Once C is
sampled, I know P(b|c) and P(a|b) [fixed probabilities]. One goal of
the analysis is to characterize the CDF of P(D| c) .

It seems to me that this should be relatively easy to setup in
Winbugs, but I seem to be making it more complicated than it should
be. Can I treat the parameters P(a | b) and P(b|c) as just weights?
Any suggestions on a WinBugs formulation would be very welcome.

No, they're stochastic nodes: draw the DAG and it should become clear.
Of course, your proability densities have to be ones that BUGS supports
(unless you want to start playing with the ones trick).

It's difficult to give more precise advice, without knowing the details
of the model.

Bob

--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland

Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB:www.jnr-eeb.org
Thanks Prof O'Hara. After thinking about this a bit more, I think what

I have is a situation involving stratified sampling, probably with
clusters of two different variables. The probabilities are actually
the probability of a sample being from one of the clusters for
variable 1 and again for variable 2. The 5 clusters for variable 1 are
broken down into 10 clusters for variable 2 and a random sample is
taken from each of the 50 resulting cells. Are you aware of any simple
examples of stratified sampling with MCMC? I've gone through the
examples that come with Winbugs.

In any case, thanks again. Jean
Anon.
Posted: Tue Mar 20, 2007 1:26 pm
Guest
Jean wrote:
Quote:
On Mar 16, 1:51 pm, "Anon." <bob.oh...@helsinki.fi> wrote:
Jeanwrote:
I realize that this should be probably be an easy question, but I'm
drawing a mental block. Any suggestions on the following problem
would be appreciated.
Problem: I have a large simulation program that, given a set of fixed
input conditions, provides a random response D.
The general problem is structured: P(D|a,g,h) P(g) P(h) P(a | b) P(b|
c) P( c) . G, H, C are random variables with random statistical
charateristics, e.g. mean and variance are random variables. Once C is
sampled, I know P(b|c) and P(a|b) [fixed probabilities]. One goal of
the analysis is to characterize the CDF of P(D| c) .
It seems to me that this should be relatively easy to setup in
Winbugs, but I seem to be making it more complicated than it should
be. Can I treat the parameters P(a | b) and P(b|c) as just weights?
Any suggestions on a WinBugs formulation would be very welcome.
No, they're stochastic nodes: draw the DAG and it should become clear.
Of course, your proability densities have to be ones that BUGS supports
(unless you want to start playing with the ones trick).

It's difficult to give more precise advice, without knowing the details
of the model.

Bob

--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland

Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB:www.jnr-eeb.org
Thanks Prof O'Hara. After thinking about this a bit more, I think what
I have is a situation involving stratified sampling, probably with
clusters of two different variables. The probabilities are actually
the probability of a sample being from one of the clusters for
variable 1 and again for variable 2. The 5 clusters for variable 1 are
broken down into 10 clusters for variable 2 and a random sample is
taken from each of the 50 resulting cells. Are you aware of any simple
examples of stratified sampling with MCMC? I've gone through the
examples that come with Winbugs.

No I'm not, and it's not too clear to me what the full model is (I don't

work with these sorts of problems!). However, some thoughts, in the
hope that they're useful:

You have a 5x10 grid, and each individual can be in one cell. So if
p_ij is the probability that an individual is in cell ij, you can model
the group membership (for a single individual) as such:

model {
for(i in 1:5) {
# which category in group 1 the individual belongs to
var1[i] ~ dcat(p1[])
for(j in 1:10) {
# which category in group 2 the individual belongs to
# Probability depends on var1
var2[i,j] ~ dcat(p2[j,])
}
}

# Priors: could also set alpha in the data.
p1[1:5] ~ ddirch(alpha[1:5])
for(i in 1:5) {
p2[i, 1:10] ~ ddirch(alpha[])
}
for(i in 1:10) { alpha[i] <- 1 }
}

Of course, if you know p1 and p2, you can set them directly.

I hope this helps!

Bob
P.S. I'm not a professor, although any reasonable offers accepted...
--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland

Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB: www.jnr-eeb.org
Jean
Posted: Fri Mar 23, 2007 11:00 am
Guest
On Mar 16, 1:51 pm, "Anon." <bob.oh...@helsinki.fi> wrote:
Quote:
Jean wrote:
I realize that this should be probably be an easy question, but I'm
drawing a mental block. Any suggestions on the following problem
would be appreciated.

Problem: I have a large simulation program that, given a set of fixed
input conditions, provides a random response D.

The general problem is structured: P(D|a,g,h) P(g) P(h) P(a | b) P(b|
c) P( c) . G, H, C are random variables with random statistical
charateristics, e.g. mean and variance are random variables. Once C is
sampled, I know P(b|c) and P(a|b) [fixed probabilities]. One goal of
the analysis is to characterize the CDF of P(D| c) .

It seems to me that this should be relatively easy to setup in
Winbugs, but I seem to be making it more complicated than it should
be. Can I treat the parameters P(a | b) and P(b|c) as just weights?
Any suggestions on aWinBugsformulation would be very welcome.

No, they're stochastic nodes: draw the DAG and it should become clear.
Of course, your proability densities have to be ones that BUGS supports
(unless you want to start playing with the ones trick).

It's difficult to give more precise advice, without knowing the details
of the model.

Bob

--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland

Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB:www.jnr-eeb.org

Your suggestion that the nodes were stochastic was interesting and,
regardless of my change in formulation of the original problem, I am
curious about your comment.

Simplifying a bit (and hopefully explaining a bit better), define the
problem as:
P(response|action A occurs)P(action A occurs|action B occurs) P(action
B occurs)

The response variable is continuous, and actions A, B either happen or
don't happen. The probabilities of happening are known, e.g. 0.8 and
0.9 . (I'm working on characterizing the P(response|action A occurs)
but that's another part of the problem.)

I'm new at this Winbugs stuff and I guess I don't see how this would
be modeled using WinBugs. I would really appreciate some insight.


Thanks, Jean
Anon.
Posted: Fri Mar 23, 2007 3:34 pm
Guest
Jean wrote:
Quote:
On Mar 16, 1:51 pm, "Anon." <bob.oh...@helsinki.fi> wrote:
Jean wrote:
I realize that this should be probably be an easy question, but I'm
drawing a mental block. Any suggestions on the following problem
would be appreciated.
Problem: I have a large simulation program that, given a set of fixed
input conditions, provides a random response D.
The general problem is structured: P(D|a,g,h) P(g) P(h) P(a | b) P(b|
c) P( c) . G, H, C are random variables with random statistical
charateristics, e.g. mean and variance are random variables. Once C is
sampled, I know P(b|c) and P(a|b) [fixed probabilities]. One goal of
the analysis is to characterize the CDF of P(D| c) .
It seems to me that this should be relatively easy to setup in
Winbugs, but I seem to be making it more complicated than it should
be. Can I treat the parameters P(a | b) and P(b|c) as just weights?
Any suggestions on aWinBugsformulation would be very welcome.
No, they're stochastic nodes: draw the DAG and it should become clear.
Of course, your proability densities have to be ones that BUGS supports
(unless you want to start playing with the ones trick).

It's difficult to give more precise advice, without knowing the details
of the model.

Bob

--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland

Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB:www.jnr-eeb.org

Your suggestion that the nodes were stochastic was interesting and,
regardless of my change in formulation of the original problem, I am
curious about your comment.

Simplifying a bit (and hopefully explaining a bit better), define the
problem as:
P(response|action A occurs)P(action A occurs|action B occurs) P(action
B occurs)

The response variable is continuous, and actions A, B either happen or
don't happen. The probabilities of happening are known, e.g. 0.8 and
0.9 . (I'm working on characterizing the P(response|action A occurs)
but that's another part of the problem.)

I'm new at this Winbugs stuff and I guess I don't see how this would
be modeled using WinBugs. I would really appreciate some insight.

I don't get the model: what if actions A or B don't occur?


Bob

--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland

Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB: www.jnr-eeb.org
Jean
Posted: Fri Mar 23, 2007 3:39 pm
Guest
On Mar 23, 2:34 pm, "Anon." <bob.oh...@helsinki.fi> wrote:
Quote:
Jean wrote:
On Mar 16, 1:51 pm, "Anon." <bob.oh...@helsinki.fi> wrote:
Jean wrote:
I realize that this should be probably be an easy question, but I'm
drawing a mental block. Any suggestions on the following problem
would be appreciated.
Problem: I have a large simulation program that, given a set of fixed
input conditions, provides a random response D.
The general problem is structured: P(D|a,g,h) P(g) P(h) P(a | b) P(b|
c) P( c) . G, H, C are random variables with random statistical
charateristics, e.g. mean and variance are random variables. Once C is
sampled, I know P(b|c) and P(a|b) [fixed probabilities]. One goal of
the analysis is to characterize the CDF of P(D| c) .
It seems to me that this should be relatively easy to setup in
Winbugs, but I seem to be making it more complicated than it should
be. Can I treat the parameters P(a | b) and P(b|c) as just weights?
Any suggestions on aWinBugsformulation would be very welcome.
No, they're stochastic nodes: draw the DAG and it should become clear.
Of course, your proability densities have to be ones that BUGS supports
(unless you want to start playing with the ones trick).

It's difficult to give more precise advice, without knowing the details
of the model.

Bob

--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland

Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB:www.jnr-eeb.org

Your suggestion that the nodes were stochastic was interesting and,
regardless of my change in formulation of the original problem, I am
curious about your comment.

Simplifying a bit (and hopefully explaining a bit better), define the
problem as:
P(response|action A occurs)P(action A occurs|action B occurs) P(action
B occurs)

The response variable is continuous, and actions A, B either happen or
don't happen. The probabilities of happening are known, e.g. 0.8 and
0.9 . (I'm working on characterizing the P(response|action A occurs)
but that's another part of the problem.)

I'm new at thisWinbugsstuff and I guess I don't see how this would
be modeled usingWinBugs. I would really appreciate some insight.

I don't get the model: what if actions A or B don't occur?

Bob

--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland

Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB:www.jnr-eeb.org

Then there is no response.

Jean
Anon.
Posted: Sat Mar 24, 2007 2:03 am
Guest
Jean wrote:
Quote:
On Mar 23, 2:34 pm, "Anon." <bob.oh...@helsinki.fi> wrote:
Jean wrote:
On Mar 16, 1:51 pm, "Anon." <bob.oh...@helsinki.fi> wrote:
Jean wrote:
I realize that this should be probably be an easy question, but I'm
drawing a mental block. Any suggestions on the following problem
would be appreciated.
Problem: I have a large simulation program that, given a set of fixed
input conditions, provides a random response D.
The general problem is structured: P(D|a,g,h) P(g) P(h) P(a | b) P(b|
c) P( c) . G, H, C are random variables with random statistical
charateristics, e.g. mean and variance are random variables. Once C is
sampled, I know P(b|c) and P(a|b) [fixed probabilities]. One goal of
the analysis is to characterize the CDF of P(D| c) .
It seems to me that this should be relatively easy to setup in
Winbugs, but I seem to be making it more complicated than it should
be. Can I treat the parameters P(a | b) and P(b|c) as just weights?
Any suggestions on aWinBugsformulation would be very welcome.
No, they're stochastic nodes: draw the DAG and it should become clear.
Of course, your proability densities have to be ones that BUGS supports
(unless you want to start playing with the ones trick).
It's difficult to give more precise advice, without knowing the details
of the model.
Bob
--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland
Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB:www.jnr-eeb.org
Your suggestion that the nodes were stochastic was interesting and,
regardless of my change in formulation of the original problem, I am
curious about your comment.
Simplifying a bit (and hopefully explaining a bit better), define the
problem as:
P(response|action A occurs)P(action A occurs|action B occurs) P(action
B occurs)
The response variable is continuous, and actions A, B either happen or
don't happen. The probabilities of happening are known, e.g. 0.8 and
0.9 . (I'm working on characterizing the P(response|action A occurs)
but that's another part of the problem.)
I'm new at thisWinbugsstuff and I guess I don't see how this would
be modeled usingWinBugs. I would really appreciate some insight.
I don't get the model: what if actions A or B don't occur?

snip

Then there is no response.

In which case, there is no information from that part of the data, so

why include it? Why not condition on the response (you know the
probabilities of getting a response, and no imputation of events A and B
is required)?

I think I'm missing something here.

Bob

--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland

Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax: +358-9-191 51400
WWW: http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB: www.jnr-eeb.org
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Thu Dec 04, 2008 2:23 am