View source: R/GoF_S3methods.R
plot.GoF | R Documentation |
GoF
’ Object‘The plot.GoF
’ function produces plots to study the sequence of fitted models.
## 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), ...)
x |
an R object of class ‘ |
add.line |
logical; if ‘ |
arg.line |
a named list of graphical parameters passed to the function |
add.text |
logical; if ‘ |
arg.text |
a list of further parameters passed to the function |
arg.points |
a named list of graphical parameters passed to the function |
... |
additional graphical arguments passed to the functions |
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.
Luigi Augugliaro (luigi.augugliaro@unipa.it)
cglasso
, AIC.cglasso
, BIC.cglasso
, summary.cglasso
and select.cglasso
.
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.