Plot GMS Object

Description

Default function to plot the network of a GMS object.

Usage

1
2
## S3 method for class 'GMS'
plot(x, fn = "", th = 1e-06, i = NULL, mylayout = NULL, vars = NULL, ...)

Arguments

x

a GMS object.

fn

file name to save the network plot; default to be an empty string, so the network is plotted to the standard output (screen). NOTE: if a file name is specified, it should be file name for PDF file.

th

numeric value, default to 1e-06. To specify the threshold if the estimated coefficient between two variables is to be considered connected.

i

index of the network (along the regularization path) to be plotted. Default to NULL to plot the optimal network.

mylayout

graph layout to draw the network, default to NULL.

vars

vector of variable names, default to NULL.

...

other generic arguments for plot method.

Details

This is the default plotting function for GMS objects (Markov Networks inferred over a regularization path). Refer to GMS for details on GMS object. This function will plot the optimal network on the screen by default. However, given a file name, the plot will be saved to a PDF file. Also, given a specific index corresponding to the index of lambda.path, the associated network will be plotted. The network will be plotted in force-directed layout (layout.fruchterman.reingold with default parameters implemented in igraph package).

Value

Returns the layout object from igraph package - numeric matrix of two columns and the rows with the same number as the number of vertices.

See Also

GMS

Examples

1
2
3
library(XMRF)
data('ggm.fit')
plot(ggm.fit, fn="ggm.fit.net.pdf")