fitConGraph: Fitting a Gaussian concentration graph model

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Fits a concentration graph (a covariance selection model).

Usage

1
fitConGraph(amat, S, n, cli = NULL, alg = 3, pri = FALSE, tol = 1e-06)  

Arguments

amat

a square Boolean matrix representing the adjacency matrix of an UG

S

the sample covariance matrix

n

an integer denoting the sample size

cli

a list containing the cliques of the graph. The components of the list are character vectors containing the names of the nodes in the cliques. The names must match the names of the vertices. The knowledge of the cliques is not needed. If the cliques are not specified the function uses the algorithm by Hastie et al. (2009, p. 446).

alg

The algorithm used.

pri

If TRUE is verbose

tol

a small positive number indicating the tolerance used in convergence tests.

Details

The algorithms for fitting concentration graph models by maximum likelihood are discussed in Speed and Kiiveri (1986). If the cliques are known the function uses the iterative proportional fitting algorithm described by Whittaker (1990, p. 184). If the cliques are not specified the function uses the algorithm by Hastie et al. (2009, p. 631ff).

Value

Shat

the fitted covariance matrix.

dev

the ‘deviance’ of the model.

df

the degrees of freedom.

it

the iterations.

Author(s)

Giovanni M. Marchetti

References

Cox, D. R. and Wermuth, N. (1996). Multivariate dependencies. London: Chapman \& Hall.

Hastie, T., Tibshirani, R. and Friedman, J. (2009). The elements of statistical learning. Springer Verlag: New York.

Speed, T.P. and Kiiveri, H (1986). Gaussian Markov distributions over finite graphs. Annals of Statistics, 14, 138–150.

Whittaker, J. (1990). Graphical models in applied multivariate statistics. Chichester: Wiley.

See Also

UG, fitDag, marks

Examples

1
2
3
4
5
6
7
8
9
## A model for the mathematics marks (Whittaker, 1990)
data(marks)
## A butterfly concentration graph  
G <- UG(~ mechanics*vectors*algebra + algebra*analysis*statistics)
fitConGraph(G, cov(marks), nrow(marks))   
## Using the cliques

cl = list(c("mechanics", "vectors",   "algebra"), c("algebra", "analysis" ,  "statistics")) 
fitConGraph(G, S = cov(marks), n = nrow(marks), cli = cl) 

Example output

Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union


Attaching package: 'ggm'

The following object is masked from 'package:igraph':

    pa

$Shat
           mechanics   vectors   algebra  analysis statistics
mechanics   305.6885 127.04336 101.46904 100.77459  109.54496
vectors     127.0434 172.84222  85.15726  84.57444   91.93492
algebra     101.4690  85.15726 112.88597 112.11338  121.87056
analysis    100.7746  84.57444 112.11338 220.38036  155.53553
statistics  109.5450  91.93492 121.87056 155.53553  297.75536

$dev
[1] 0.9008831

$df
[1] 4

$it
[1] 5

$Shat
           mechanics   vectors   algebra  analysis statistics
mechanics   305.6885 127.04336 101.46904 100.77459  109.54496
vectors     127.0434 172.84222  85.15726  84.57444   91.93492
algebra     101.4690  85.15726 112.88597 112.11338  121.87056
analysis    100.7746  84.57444 112.11338 220.38036  155.53553
statistics  109.5450  91.93492 121.87056 155.53553  297.75536

$dev
[1] 0.9008831

$df
[1] 4

$it
[1] 2

ggm documentation built on March 26, 2020, 7:49 p.m.

Related to fitConGraph in ggm...