plot.GoF: Plot for "GoF" Object

Description Usage Arguments Details Author(s) See Also Examples

View source: R/GoF_S3methods.R

Description

‘The plot.GoF’ function produces plots to study the sequence of fitted models.

Usage

1
2
3
4
## S3 method for class 'GoF'
plot(x, add.line = TRUE, arg.line = list(lty = 2L, lwd = 2L, col = "red"), 
      add.text = FALSE, arg.text = list(side = 3L), arg.points = list(pch = 2L),
      ...)

Arguments

x

an R object of class ‘GoF’, that is, the output of a goodness-of-fit function such as AIC.cglasso or BIC.cglasso.

add.line

logical; if ‘add.line = TRUE’ then a line is added to identify the optimal value of the tuning parameter.

arg.line

a named list of graphical parameters passed to the function abline (see also par).

add.text

logical; if ‘add.text = TRUE’ then a text is added to the line used to identify the optimal value of the tuning parameter.

arg.text

a list of further parameters passed to the function mtext (only if ‘add.text = TRUE’).

arg.points

a named list of graphical parameters passed to the function points.

...

additional graphical arguments passed to the functions plot, contour or filled.contour.

Details

plot.GoF is the plotting method function of an R object of class ‘GoF’, that is, the output of a goodness-of-fit function (see AIC.cglasso, or BIC.cglasso). This function produces a plot aimed both to evaluate the sequence of fitted models in terms of goodness-of-fit and to identify the optimal values of the tuning parameters.

If a tuning parameter is held fixed, then plot.GoF produces a plot showing the chosen measure of goodness-of-fit as a function of the remaining tuning parameter. In this case, the optimal value is identified by a vertical dashed line. The degrees-of-freedom of the selected fitted model are also shown.

If the cglasso model is fitted using both a sequence of rho and lambda values, then plot.GoF produces a contour plot and a triangle is used to identify the optimal pair of the two tuning parameters.

Author(s)

Luigi Augugliaro (luigi.augugliaro@unipa.it)

See Also

cglasso, AIC.cglasso, BIC.cglasso, summary.cglasso and select.cglasso.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
set.seed(123)
n <- 1000L
p <- 3L
q <- 2
b0 <- runif(p)
B <- matrix(runif(q * p), nrow = q, ncol = p)
X <- matrix(rnorm(n * q), nrow = n, ncol = q)
rho <- 0.3
Sigma <- outer(1L:p, 1L:p, function(i, j) rho^abs(i - j))
Z <- rcggm(n = n, b0 = b0, X = X, B = B, Sigma = Sigma, probl = 0.05, probr = 0.05)

out <- cglasso(. ~ ., data = Z, nlambda = 1L)
plot(AIC(out))
plot(BIC(out))

out <- cglasso(. ~ ., data = Z, nrho = 1L)
plot(AIC(out))
plot(BIC(out))

out <- cglasso(. ~ ., data = Z)
plot(AIC(out))
plot(BIC(out))

cglasso documentation built on April 9, 2021, 9:07 a.m.