Description Usage Arguments Details Value Author(s) Examples
Plot a Bayesian network and format its arcs according to the strength of the dependencies they represent. Requires the Rgraphviz package.
1 2 |
x |
an object of class |
strength |
an object of class |
threshold |
a numeric value. See below. |
cutpoints |
an array of numeric values. See below. |
highlight |
a list, see |
layout |
a character string, the layout parameter to
be passed to Rgraphviz. Possible values are |
shape |
a character string, the shape of the nodes. Can be
either |
main |
a character string, the main title of the graph. It's plotted at the top of the graph. |
sub |
a character string, a subtitle which is plotted at the bottom of the graph. |
debug |
a boolean value. If |
The threshold
parameter is used to determine which arcs are supported
strongly enough by the data to be deemed significant:
if arc strengths have been computed using conditional independence tests,
any strength coefficient (which is the p-value of the test) lesser
or equal than the threshold is considered significant. In this case
the default value of threshold
is equal to the value of the
alpha
parameter used in the call to arc.strength
,
which in turn defaults to the one used by the learning algorithm
(if any) or to 0.05
.
if arc strengths have been computed using network scores,
any strength coefficient (which is the increase/decrease of the network
score caused by the removal of the arc) lesser than the threshold is
considered significant. In this case the default value of
threshold
is 0
.
if arc strengths have been computed using bootstrap, any
strength coefficient (which is the relative frequency of the
arc in the networks learned from the bootstrap replicates) greater
or equal than the threshold is considered significant. In this case
the default value of threshold
is 0.5
.
Non-significant arcs are plotted as dashed lines.
The cutpoints
parameter is an array of numeric values used to
divide the range of the strength coefficients into intervals. The interval
each strength coefficient falls into determines the line width of the
corresponding arc in the plot. The default intervals are delimited by
unique(c(0, threshold/c(10, 5, 2, 1.5, 1), 1))
if the coefficients are computed from conditional independence tests, by
1 - unique(c(0, threshold/c(10, 5, 2, 1.5, 1), 1))
for bootstrap estimates or by the quantiles
quantile(-s[s < threshold], c(0.50, 0.75, 0.90, 0.95, 1))
of the significant coefficients if network scores are used.
The object of class graphAM
used to format and render the
plot. It can be further modified using the commands present in the
graph and Rgraphviz packages.
Marco Scutari
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
# plot the network learned by gs().
res = set.arc(gs(learning.test), "A", "B")
strength = arc.strength(res, learning.test, criterion = "x2")
strength.plot(res, strength)
# add another (non-significant) arc and plot the network again.
res = set.arc(res, "A", "C")
strength = arc.strength(res, learning.test, criterion = "x2")
strength.plot(res, strength)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.