summary.gips {gips} | R Documentation |
Summarizing the gips object
Description
summary
method for gips
class.
Usage
## S3 method for class 'gips'
summary(object, ...)
## S3 method for class 'summary.gips'
print(x, ...)
Arguments
object |
An object of class |
... |
Further arguments passed to or from other methods. |
x |
An object of class |
Value
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 thisgips
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 thestart_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 toInf
or small and underflow to 0. -
n0
- the minimum number of observations needed for the covariance matrix's maximum likelihood estimator (corresponding to a MAP) to exist. SeeC\sigma
andn0
section invignette("Theory", package = "gips")
or in its pkgdown page. -
S_matrix
- the underlying matrix. This matrix will be used in calculations of the posteriori value inlog_posteriori_of_gips()
. -
number_of_observations
- the number of observations that were observed for theS_matrix
to be calculated. This value will be used in calculations of the posteriori value inlog_posteriori_of_gips()
. -
was_mean_estimated
- given by the user while creating thegips
object:-
TRUE
means theS
parameter was the output ofstats::cov()
function; -
FALSE
means theS
parameter was calculated withS = t(X) %*% X / number_of_observations
.
-
-
delta
,D_matrix
- the hyperparameters of the Bayesian method. See the Hyperparameters section ofgips()
documentation. -
AIC
,BIC
- output ofAIC.gips()
andBIC.gips()
functions. -
n_parameters
- number of free parameters in the covariance matrix.
-
For optimized
gips
object:-
optimized
-TRUE
. -
found_permutation
- the permutation thisgips
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 thisgips
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 thefound_permutation
is over thestart_permutation
. It cannot be a number less than 1. Remember that this number can big and overflow toInf
. -
n0
- the minimal number of observations needed for the existence of the maximum likelihood estimator (corresponding to a MAP) of the covariance matrix (seeC\sigma
andn0
section invignette("Theory", package = "gips")
or in its pkgdown page). -
S_matrix
- the underlying matrix. This matrix will be used in calculations of the posteriori value inlog_posteriori_of_gips()
. -
number_of_observations
- the number of observations that were observed for theS_matrix
to be calculated. This value will be used in calculations of the posteriori value inlog_posteriori_of_gips()
. -
was_mean_estimated
- given by the user while creating thegips
object:-
TRUE
means theS
parameter was output of thestats::cov()
function; -
FALSE
means theS
parameter was calculated withS = t(X) %*% X / number_of_observations
.
-
-
delta
,D_matrix
- the hyperparameters of the Bayesian method. See the Hyperparameters section ofgips()
documentation. -
AIC
,BIC
- output ofAIC.gips()
andBIC.gips()
functions. -
n_parameters
- number of free parameters in the covariance matrix. -
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 thelog_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 thelog_posteriori_of_gips()
function called after thefound_permutation
; in other words, how long ago could the optimization be stopped and have the same result. If this value is small, consider runningfind_MAP()
again withoptimizer = "continue"
. Foroptimizer = "BF"
, it isNULL
. -
acceptance_rate
- only interesting foroptimizer = "MH"
. How often was the algorithm accepting the change of permutation in an iteration.
-
The function print.summary.gips()
returns an invisible NULL
.
Methods (by generic)
-
print(summary.gips)
: Printing method for classsummary.gips
. Prints every interesting information in a form pleasant for humans.
See Also
-
find_MAP()
- Usually, thesummary.gips()
is called on the output offind_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.
Examples
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)
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))