plot.gips | R Documentation |
gips
objectPlot the heatmap of the MAP covariance matrix estimator
or the convergence of the optimization method.
The plot depends on the type
argument.
## S3 method for class 'gips'
plot(
x,
type = NA,
logarithmic_y = TRUE,
logarithmic_x = FALSE,
color = NULL,
title_text = "Convergence plot",
xlabel = NULL,
ylabel = NULL,
show_legend = TRUE,
ylim = NULL,
xlim = NULL,
...
)
x |
Object of a |
type |
A character vector of length 1. One of
The default value is |
logarithmic_y , logarithmic_x |
A boolean. Sets the axis of the plot in logarithmic scale. |
color |
Vector of colors to be used to plot lines. |
title_text |
Text to be in the title of the plot. |
xlabel |
Text to be on the bottom of the plot. |
ylabel |
Text to be on the left of the plot. |
show_legend |
A boolean. Whether or not to show a legend. |
ylim |
Limits of the y axis. When |
xlim |
Limits of the x axis. When |
... |
Additional arguments passed to other various elements of the plot. |
When type
is one of "best"
, "all"
, "both"
or "n0"
,
returns an invisible NULL
.
When type
is one of "heatmap"
, "MLE"
or "block_heatmap"
,
returns an object of class ggplot
.
find_MAP()
- Usually, the plot.gips()
is called on the output of find_MAP()
.
project_matrix()
- The function used with type = "MLE"
.
gips()
- The constructor of a gips
class.
The gips
object is used as the x
parameter.
require("MASS") # for mvrnorm()
perm_size <- 6
mu <- runif(6, -10, 10) # Assume we don't know the mean
sigma_matrix <- matrix(
data = c(
1.0, 0.8, 0.6, 0.4, 0.6, 0.8,
0.8, 1.0, 0.8, 0.6, 0.4, 0.6,
0.6, 0.8, 1.0, 0.8, 0.6, 0.4,
0.4, 0.6, 0.8, 1.0, 0.8, 0.6,
0.6, 0.4, 0.6, 0.8, 1.0, 0.8,
0.8, 0.6, 0.4, 0.6, 0.8, 1.0
),
nrow = perm_size, byrow = TRUE
) # sigma_matrix is a matrix invariant under permutation (1,2,3,4,5,6)
number_of_observations <- 13
Z <- MASS::mvrnorm(number_of_observations, mu = mu, Sigma = sigma_matrix)
S <- cov(Z) # Assume we have to estimate the mean
g <- gips(S, number_of_observations)
if (require("graphics")) {
plot(g, type = "MLE")
}
g_map <- find_MAP(g, max_iter = 30, show_progress_bar = FALSE, optimizer = "hill_climbing")
if (require("graphics")) {
plot(g_map, type = "both", logarithmic_x = TRUE)
}
if (require("graphics")) {
plot(g_map, type = "MLE")
}
# Now, the output is (most likely) different because the permutation
# `g_map[[1]]` is (most likely) not an identity permutation.
g_map_MH <- find_MAP(g, max_iter = 30, show_progress_bar = FALSE, optimizer = "MH")
if (require("graphics")) {
plot(g_map_MH, type = "n0")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.