Learn R Programming

cglasso (version 2.0.2)

plot.GoF: Plot for ‘GoF’ Object

Description

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

Usage

# S3 method for 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 or bic.

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, or bic). 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.

See Also

cglasso, aic, bic, summary.cglasso and select.cglasso.

Examples

Run this code
# NOT RUN {
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(Z, nlambda = 1L)
plot(aic(out))
plot(bic(out))

out <- cglasso(Z, nrho = 1L)
plot(aic(out))
plot(bic(out))

out <- cglasso(Z)
plot(aic(out))
plot(bic(out))
# }

Run the code above in your browser using DataLab