autoFit: Find best ADMG model to data.

View source: R/autoFit.R

autoFitR Documentation

Find best ADMG model to data.

Description

Fit discrete data to the Markov structure implied by an acyclic directed mixed graph.

Usage

autoFit(
  dat,
  start = NULL,
  criterion = "AIC",
  quietly = FALSE,
  r = TRUE,
  search = "basic",
  tol = 0.01
)

Arguments

dat

Either an object of class freq.table, or a vector of counts in reverse lexicographical order.

start

Graph to start search procedure at; defaults to graph with no edges.

criterion

Criterion to minimize: either "AIC" or "BIC".

quietly

Logical indicating whether to suppress output.

r

Logical indicating whether recursive factorizations should be used.

search

"full" or "basic" search.

tol

tolerance used to assess convergence in fitADMG.

Details

Given the current graph, the algorithm fits all graphs obtained by removing, adding or (in the case of the full search) replacing a single edge, and picks the graph which is optimal with respect to the chosen criterion (AIC or BIC). The algorithm terminates when no move results in an improvement.

The default starting graph has no edges.

Value

An object of class mixed_fit.

Note

Note that this procedure is not guaranteed to find the best model fit for all ADMGs, but will find a 'local maximum' with respect to edge addition and removal.

Author(s)

Ilya Shpitser, Robin Evans

References

Evans and Richardson (2009) - Maximum likelihood fitting of acyclic directed mixed graphs to binary data.

See Also

fitADMG.

Examples


data(gss.small)
## Not run: out = autoFit(gss.small)

## Not run: summary(out$graph)


rje42/ADMGs2 documentation built on Sept. 3, 2024, 7:39 p.m.