docs.javahelp.manual.boxes.im.bayes_im.html Maven / Gradle / Ivy
IM
Bayes Instantiated Model
??? ?? ?? ?? ?? ??
?? ?? ?? ?? ?? ??
?? ?? ?? ?? ?? ??
?? ?? ?? ?? ?? ??
?? ?? ?? ?? ?? ??
?? ?? ?? ?? ?? ??
??
Description of the Model
A Bayes Instantiated Model (Bayes IM) extends a Bayes Parameterized Model,
specifying values for all of the parameters in the Bayes net. The parameters for a Bayes net (in the form that
they're used in Tetrad) are conditional probabilities stored in conditional probability tables, one for
each variable in the Bayes net. A variable X has a (possibly empty) list of parents P1, ..., Pn--i.e., variables Pi
such that Pi-->X in the Bayes PM. The variable itself and each of its parents has a list of categories. A
conditional probability table for X is a specification of the probability P(X=x' | P1=p1', ..., Pn=pn') for each
category x' of X and each combination of categories <p1', ..., pn'> for parents P1, ..., Pn of X. For any
particular combination of parent values <p1', ..., pn'>, the sum of the conditional probabilities P(X=xj |
P1=p1',...,Pn=pn') for all categories xj of X is equal to 1.0.
How to Construct a Bayes IM
To construct a Bayes IM, first construct a DAG, then a Bayes PM, and add an IM box to the workspace, with an arrow
from the Bayes PM to the IM.
Fill in the Graph box and the PM box, as explained in Bayes Parameterized Model.
For instance, you might end up with a graph that looks like this (the categories for X1 are shown).
Now, double click the IM box. You get a choice of models; choose Bayes Instantiated Model:
What you click OK, you are offered a choice. You may either initialize the parameters of your Bayes net manually
(i.e., fill them in one by one, by hand), or fill them in randomly.
We choose "Manually." We now get a dialog that looks like the following:
X1 here has two parents, X2 and X5. Each combination of parent values for X2 and X5 is listed as a row in the
conditional probability table for X1. Each category for X1 is listed as a column in the conditional probability
table. We can now fill in these probability values however we like, provided we choose non-negative real numbers
that sum to 1.0 in each row. The interface helps out a little by filling in table cells whose values are implied. If
you fill in the 0.2000 and 0.5000 in the table below, the table will fill in the 0.3000 for you. Also, if you simply
want to fill in table cells randomly, right click on any nonselected table cell. You get a popup menu like
the one below.
If you select "Randomize this row," the row is filled in with random values. For example:
Similarly for the other popup menu functions shown.
Once all of the table cells have been filled in, the Bayes IM is ready to be used as input to other boxes. You may,
for example, simulate data using the Bayes IM, or you may perform updating operations on it. See Simulating Data (Bayes) for more information on how to
simulate data and Update Box for more information on updating.
Potential Parents for a Bayes IM
A Bayes IM can be constructed as indicated above (as a child of a Bayes PM). Bayes IM's are also, however, output by
other processes. In particular, a Bayes IM can be made a child of the following:
- ML Bayes Estimator. Bayes estimations take Bayes PM's and discrete data sets and produce new Bayes IM's.
- Dirichlet Estimator. Dirichlet estimators also take Bayes PM's and
discrete data sets (with possibly Dirichlet priors in the form of Dirichlet
Bayes IM's) and output Dirichlet Bayes IM's. They may alternatively output Bayes IM's.
- Any Bayes updater. All of the Bayes updaters (Row Summing
Updater, CPT Invariant Updater, and Approximate Updater) output new, updated Bayes IM's.
Old text:
If you choose an ML Instantiated Bayes Model, the program will either randomly specify the conditional probability
of each value of each variable given the values of its parents, or you can specify them manually through the dialog
box:
Choose a variable either using the "Next" button on the right side of the window or by clicking on the variable in
the graph on the left
side of the window. In either case, you will see one or more rows of entry spaces, with each entry space labeled by
the name of the value of the selected variables. Each row corresponds to an allowed assignment of variables to the
variables that are parents of the selected variable. For each row--each assignment of allowed values to the
variables that are parents of the variable you have selected--you must enter a numerical value between 0 and 1 for
each value of the variable you have selected. These are the respective probabilities of the values of your selected
variable, condiitonal on the values in that row of its parents variables. The numbers you put into any
row must add up exactly to 1. If they don't the program will simply erase the values you have entered in that row.
If you start entering numbers in a row from the left, which is highly recommended, the program will automatically
fill in the next to last entry space with the number (if one exists) needed to make the row numbers sum to 1.
Entering all of these conditional probabilities in even a medium sized model is very tedious, but there is no help
for it other than to estimate the condiitonal probabilities from a data set, or to randomize. If you
choose "Random" instead of "Manual" you will get a window very much like the one above, except that randomly chosen
values will be entered in each row. You can edit these values by clicking on a row and typing. As in other windows
showing graphs, you can select a variable by clicking on it.
Potential Parents for Bayes Instantiated Model
The Bayes IM can accept the following potential parents.
- Bayes Parametric Model. To build a Bayes IM from scratch, one should first
build a Bayes PM and then construct a Bayes IM as a child of the Bayes PM.
- ML Bayes Estimator. An ML Bayes Estimator estimates a Bayes
IM using a given Bayes PM and discrete data set.
- Dirichlet Bayes Estimator. The normal output of a Dirichlet
Bayes Estimator is a Dirichlet Bayes IM, but a Bayes Instantiated Model
may be substituted. This Bayes IM will contains as parameter values the maximum likelihood probability values
from the estimated Dirichlet Bayes IM.
Potential Children for Bayes Instantiated Model
- Data Box--This is the way to simulate data from a
discrete Bayes model. See Simulating Data (Bayes) for more
details.
- Any graph--Directed Acyclic Graph, SEM
Graph, General Graph--simply copies the graph from the Bayes IM
into a new graph box.
- Bayes PM--copies the Bayes PM from the Bayes IM into a new PM box.
- Bayes IM--copies the Bayes IM itself into a new IM box.
- Any of the updating algorithms--Row Summing Exact Updater, CPT Invariant Updater, Approximate Updater.
- ML Bayes Estimator (together with a discrete Data Set)--estimates the associated Bayes PM, producing a new
Bayes IM.