| summary.gips | R Documentation |
summary method for gips class.
## S3 method for class 'gips'
summary(object, ...)
## S3 method for class 'summary.gips'
print(x, ...)
object |
An object of class |
... |
Further arguments passed to or from other methods. |
x |
An object of class |
The function summary.gips() computes and returns a list of summary
statistics of the given gips object. Those are:
For unoptimized gips object:
optimized - FALSE.
start_permutation - the permutation this gips represents.
start_permutation_log_posteriori - the log of the a posteriori
value the start permutation has.
times_more_likely_than_id - how many more likely
the start_permutation is over the identity permutation, ().
It can be less than 1, meaning the identity permutation
is more likely. Remember that this number can big and
overflow to Inf or small and underflow to 0.
log_times_more_likely_than_id - log of times_more_likely_than_id.
likelihood_ratio_test_statistics, likelihood_ratio_test_p_value -
statistics and p-value of Likelihood Ratio test, where
the H_0 is that the data was drawn from the normal distribution
with Covariance matrix invariant under the given permutation.
The p-value is calculated from the asymptotic distribution.
Note that this is sensibly defined only for n \ge p.
n0 - the minimum number of observations needed for
the covariance matrix's maximum likelihood estimator
(corresponding to a MAP) to exist. See C\sigma and n0
section in vignette("Theory", package = "gips") or in its
pkgdown page.
S_matrix - the underlying matrix.
This matrix will be used in calculations of
the posteriori value in log_posteriori_of_gips().
number_of_observations - the number of observations that
were observed for the S_matrix to be calculated.
This value will be used in calculations of
the posteriori value in log_posteriori_of_gips().
was_mean_estimated - given by the user while creating the gips object:
TRUE means the S parameter was the output of stats::cov() function;
FALSE means the S parameter was calculated with
S = t(X) %*% X / number_of_observations.
delta, D_matrix - the hyperparameters of the Bayesian method.
See the Hyperparameters section of gips() documentation.
n_parameters - number of free parameters in the covariance matrix.
AIC, BIC - output of AIC.gips() and BIC.gips() functions.
For optimized gips object:
optimized - TRUE.
found_permutation - the permutation this gips represents.
The visited permutation with the biggest a posteriori value.
found_permutation_log_posteriori - the log of the a posteriori
value the found permutation has.
start_permutation - the original permutation this gips
represented before optimization. It is the first visited permutation.
start_permutation_log_posteriori - the log of the a posteriori
value the start permutation has.
times_more_likely_than_start - how many more likely
the found_permutation is over the start_permutation.
It cannot be a number less than 1.
Remember that this number can big and overflow to Inf.
log_times_more_likely_than_start - log of
times_more_likely_than_start.
likelihood_ratio_test_statistics, likelihood_ratio_test_p_value -
statistics and p-value of Likelihood Ratio test, where
the H_0 is that the data was drawn from the normal distribution
with Covariance matrix invariant under found_permutation.
The p-value is calculated from the asymptotic distribution.
Note that this is sensibly defined only for n \ge p.
n0 - the minimal number of observations needed for the existence of
the maximum likelihood estimator (corresponding to a MAP) of
the covariance matrix (see C\sigma and n0
section in vignette("Theory", package = "gips") or in its
pkgdown page).
S_matrix - the underlying matrix.
This matrix will be used in calculations of
the posteriori value in log_posteriori_of_gips().
number_of_observations - the number of observations that
were observed for the S_matrix to be calculated.
This value will be used in calculations of
the posteriori value in log_posteriori_of_gips().
was_mean_estimated - given by the user while creating the gips object:
TRUE means the S parameter was output of the stats::cov() function;
FALSE means the S parameter was calculated with
S = t(X) %*% X / number_of_observations.
delta, D_matrix - the hyperparameters of the Bayesian method.
See the Hyperparameters section of gips() documentation.
n_parameters - number of free parameters in the covariance matrix.
AIC, BIC - output of AIC.gips() and BIC.gips() functions.
optimization_algorithm_used - all used optimization algorithms
in order (one could start optimization with "MH", and then
do an "HC").
did_converge - a boolean, did the last used algorithm converge.
number_of_log_posteriori_calls - how many times was
the log_posteriori_of_gips() function called during
the optimization.
whole_optimization_time - how long was the optimization process;
the sum of all optimization times (when there were multiple).
log_posteriori_calls_after_best - how many times was
the log_posteriori_of_gips() function called after
the found_permutation; in other words, how long ago
could the optimization be stopped and have the same result.
If this value is small, consider running find_MAP()
again with optimizer = "continue".
For optimizer = "BF", it is NULL.
acceptance_rate - only interesting for optimizer = "MH".
How often was the algorithm accepting the change of permutation
in an iteration.
The function print.summary.gips() returns an invisible NULL.
print(summary.gips): Printing method for class summary.gips.
Prints every interesting information in a form pleasant for humans.
find_MAP() - Usually, the summary.gips()
is called on the output of find_MAP().
log_posteriori_of_gips() - Calculate
the likelihood of a permutation.
AIC.gips(), BIC.gips() - Calculate
Akaike's or Bayesian Information Criterion
project_matrix() - Project the known
matrix on the found permutations space.
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.1, 0.8, 0.6, 0.4, 0.6, 0.8,
0.8, 1.1, 0.8, 0.6, 0.4, 0.6,
0.6, 0.8, 1.1, 0.8, 0.6, 0.4,
0.4, 0.6, 0.8, 1.1, 0.8, 0.6,
0.6, 0.4, 0.6, 0.8, 1.1, 0.8,
0.8, 0.6, 0.4, 0.6, 0.8, 1.1
),
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)
unclass(summary(g))
g_map <- find_MAP(g, max_iter = 10, show_progress_bar = FALSE, optimizer = "Metropolis_Hastings")
unclass(summary(g_map))
g_map2 <- find_MAP(g, max_iter = 10, show_progress_bar = FALSE, optimizer = "hill_climbing")
summary(g_map2)
# ================================================================================
S <- matrix(c(1, 0.5, 0.5, 2), nrow = 2, byrow = TRUE)
g <- gips(S, 10)
print(summary(g))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.