Learn R Programming

gRim (version 0.1.2)

ggmfit: Iterative proportional fitting of graphical Gaussian model

Description

Fit graphical Gaussian model by iterative proportional fitting.

Usage

ggmfit( S, n.obs, glist, start=NULL, eps=1e-12, iter=1000, details=0, ...)
ggmfitr(S, n.obs, glist, start=NULL, eps=1e-12, iter=1000, details=0, ...)

Arguments

S
Empirical covariance matrix
n.obs
Number of observations
glist
Generating class for model (a list)
start
Initial value for concentration matrix
eps
Convergence criterion
iter
Maximum number of iterations
details
Controlling the amount of output.
...
Optional arguments; currently not used

Value

  • A list with
  • lrtLikelihood ratio statistic (-2logL)
  • dfDegrees of freedom
  • logLlog likelihood
  • KEstimated concentration matrix (inverse covariance matrix)

Details

ggmfit is based on a C implementation. ggmfitr is implemented purely in R (and is provided mainly as a benchmark for the C-version).

See Also

cmod, loglin

Examples

Run this code
## Fitting "butterfly model" to mathmark data
## Notice that the output from the two fitting functions is not
## entirely identical.
data(math)
ddd <- cov.wt(math, method="ML")
glist <- list(c("al","st","an"), c("me","ve","al"))
ggmfit (ddd$cov, ddd$n.obs, glist)
ggmfitr(ddd$cov, ddd$n.obs, glist)

Run the code above in your browser using DataLab