loglin-effloglin: Fitting Log-Linear Models by Message Passing

loglin-effloglinR Documentation

Fitting Log-Linear Models by Message Passing

Description

Fit log-linear models to multidimensional contingency tables by Iterative Proportional Fitting.

Usage

effloglin(table, margin, fit = FALSE, eps = 0.01, iter = 20, print = TRUE)

Arguments

table

A contingency table

margin

A generating class for a hierarchical log–linear model

fit

If TRUE, the fitted values are returned.

eps

Convergence limit; see 'details' below.

iter

Maximum number of iterations allowed

print

If TRUE, iteration details are printed.

Details

The function differs from loglin in that 1) data can be given in the form of a list of sufficient marginals and 2) the model is fitted only on the cliques of the triangulated interaction graph of the model. This means that the full table is not fitted, which means that effloglin is efficient (in terms of storage requirements). However effloglin is implemented entirely in R and is therefore slower than loglin. Argument names are chosen so as to match those of loglin()

Value

A list.

Author(s)

Søren Højsgaard, sorenh@math.aau.dk

References

Radim Jirousek and Stanislav Preucil (1995). On the effective implementation of the iterative proportional fitting procedure. Computational Statistics & Data Analysis Volume 19, Issue 2, February 1995, Pages 177-189

See Also

loglin

Examples


data(reinis)
glist <-list(c("smoke", "mental"), c("mental", "phys"),
             c("phys", "systol"), c("systol", "smoke"))

stab <- lapply(glist, function(gg) tabMarg(reinis, gg))
fv3 <- effloglin(stab, glist, print=FALSE)



gRim documentation built on Sept. 11, 2024, 7:02 p.m.