gm.boot.coco {gmvalid}R Documentation

Graphical model validation using the bootstrap (CoCo).

Description

Validates a discrete undirected graphical model using the bootstrap. Relative frequencies of the bootstrapped models, cliques or edges are counted. To achieve that the CoCo package is used.

Usage

gm.boot.coco(N, data, strategy = c("backwards", "forwards", "combined"),
            calculations = c("diff", "edge", "clique"),
            model = FALSE, criterion = c("lr","aic","bic"), ...)

Arguments

N Number of bootstrap replications.
data Data frame or array. Variables need to be discrete and should have names.
strategy Type of model selection. "backwards" eliminates not significant edges, starting from the saturated model as default (backward). "forwards" adds significant edges, starting from the main effects model (forward). The "combined" strategy is a 3 step procedure: gm.screening, "backwards" and then "forwards". The default strategy is "backwards". Selections may be abbreviated.
calculations String vector specifying the analysis methods; "clique" and "edge" show the frequency of occurence in all selected models of the bootstrap samples, while "diff" counts the edge differences of the bootstrap replications compared to the edges selected from the original data set. The frequency of the selected models of all bootstrap samples are always calculated. By default all calculations are done. Selections may be abbreviated.
model Character string specifying a start model for "backwards" or "forwards". The model formula has to start with the first lowercase letters of the alphabet, e.g. "abc,cde". Variable names cannot be given. For "combined" the model cannot be given, a start model will be specified by gm.screening.
criterion Defines the strategy for edge selection: Likelihood-Ratio (default), AIC or BIC. Selection may be abbreviated.
... Additional options for the selection procedure. See backward (forward).

Details

This function uses a nonparametric bootstrap.
For your information about the advancements of the bootstrap, some run numbers are displayed.

Value

A list containing:

"bootstrapped models" Matrix with the selected models in first column and their selection frequency in the second.
"bootstrapped cliques" Relative frequenciy vector of selected cliques. Returned if calculation "clique" is selected.
"edge frequencies" Matrix of relative edge frequencies. Returned if calculation "edge" is selected.
"original model" Character string of selected model using the original unsampled data. Returned if calculation "diff" is selected.
"edge differences" List of frequencies of more, less and by absolute value different edges (See argument calculations. Sorted by occurence. Returned if calculation "diff" is selected.
"replications" Number of bootstrap replications.
"variable names" Matrix that assigns a letter to each variable that is used in the model formulae.

Note

CoCo may crash R occasionally. The R version of CoCo can only handle one CoCoObject. You may run "endCoCo()" if you use CoCo also outside this package or the function aborts.
Criterion equalling "bic" will work from CoCo version 0.1.7.5 on.

Author(s)

Ronja Foraita, Fabian Sobotka
Bremen Institute for Prevention Research and Social Medicine
(BIPS) http://www.bips.uni-bremen.de

References

Efron B, Tibshirani RJ (1993) An Introduction to the Bootstrap. Chapman & Hall

Badsberg JH (2001) A guide to CoCo. Journal of Statistical Software, 6(4).

See Also

gm.screening

Examples

  ### should provide good results because of simulated data
  gm <- gm.modelsim(2000,"ABC,CDE")
  gm.boot.coco(50,gm,recursive=TRUE)
  
  ### on real data sets a forward bootstrap seems to have better results
  data(wynder)
  gm.boot.coco(100,wynder,strategy="f",calculations=c("s","e"),decomposable.mode=TRUE)
  
  ### with a given model
  data(wam)
  gm.boot.coco(10,wam,model="ab,bcde,cdef")
  ### by AIC
  gm.boot.coco(300,wam,strategy="f",criterion="a",recursive=TRUE,follow=TRUE,all.significant=FALSE)

[Package gmvalid version 1.2 Index]