Skip to content

Commit a178da9

Browse files
committed
LR rest documentation
1 parent 297bb4a commit a178da9

File tree

5 files changed

+55
-25
lines changed

5 files changed

+55
-25
lines changed

Diff for: DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ Config/testthat/edition: 3
5050
Encoding: UTF-8
5151
Language: en-US
5252
Roxygen: list(markdown = TRUE)
53-
RoxygenNote: 7.3.1
53+
RoxygenNote: 7.3.2
5454
LazyData: true

Diff for: NEWS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ There was a significant improvement in the speed of calculation. Details in the
1313

1414
- `plot.gips()` can get `type = "n0"`, which will plot the change of `n0` along the "MH" optimization. Handy for deciding of burn-in time;
1515
- `find_MAP(optimizer = "MH")` tracks the `n0` along the optimization;
16-
- `summary.gips()` calculates Likelihood-Ratio test (in development, TODO: documentation, mention in vignette, LR for estimated mean);
16+
- `summary.gips()` calculates Likelihood-Ratio test;
1717

1818

1919
# gips 1.2.2

Diff for: R/gips_class.R

+35-20
Original file line numberDiff line numberDiff line change
@@ -1556,26 +1556,33 @@ get_diagonalized_matrix_for_heatmap <- function(g) {
15561556
#' It can be less than 1, meaning the identity permutation
15571557
#' is more likely. Remember that this number can big and
15581558
#' overflow to `Inf` or small and underflow to 0.
1559-
#' 5. `n0` - the minimum number of observations needed for
1559+
#' 5. `log_times_more_likely_than_id` - log of `times_more_likely_than_id`.
1560+
#' 6. `likelihood_ratio_test_statistics`, `likelihood_ratio_test_p_value` -
1561+
#' statistics and p-value of Likelihood Ratio test, where
1562+
#' the H_0 is that the data was drawn from the normal distribution
1563+
#' with Covariance matrix invariant under the given permutation.
1564+
#' The p-value is calculated from the asymptotic distribution.
1565+
#' Note that this is sensibly defined only for \eqn{n \ge p}.
1566+
#' 7. `n0` - the minimum number of observations needed for
15601567
#' the covariance matrix's maximum likelihood estimator
15611568
#' (corresponding to a MAP) to exist. See **\eqn{C\sigma} and `n0`**
15621569
#' section in `vignette("Theory", package = "gips")` or in its
15631570
#' [pkgdown page](https://przechoj.github.io/gips/articles/Theory.html).
1564-
#' 6. `S_matrix` - the underlying matrix.
1571+
#' 8. `S_matrix` - the underlying matrix.
15651572
#' This matrix will be used in calculations of
15661573
#' the posteriori value in [log_posteriori_of_gips()].
1567-
#' 7. `number_of_observations` - the number of observations that
1574+
#' 9. `number_of_observations` - the number of observations that
15681575
#' were observed for the `S_matrix` to be calculated.
15691576
#' This value will be used in calculations of
15701577
#' the posteriori value in [log_posteriori_of_gips()].
1571-
#' 8. `was_mean_estimated` - given by the user while creating the `gips` object:
1578+
#' 10. `was_mean_estimated` - given by the user while creating the `gips` object:
15721579
#' * `TRUE` means the `S` parameter was the output of [stats::cov()] function;
15731580
#' * `FALSE` means the `S` parameter was calculated with
15741581
#' `S = t(X) %*% X / number_of_observations`.
1575-
#' 9. `delta`, `D_matrix` - the hyperparameters of the Bayesian method.
1582+
#' 11. `delta`, `D_matrix` - the hyperparameters of the Bayesian method.
15761583
#' See the **Hyperparameters** section of [gips()] documentation.
1577-
#' 10. `AIC`, `BIC` - output of [AIC.gips()] and [BIC.gips()] functions.
1578-
#' 11. `n_parameters` - number of free parameters in the covariance matrix.
1584+
#' 12. `n_parameters` - number of free parameters in the covariance matrix.
1585+
#' 13. `AIC`, `BIC` - output of [AIC.gips()] and [BIC.gips()] functions.
15791586
#' * For optimized `gips` object:
15801587
#' 1. `optimized` - `TRUE`.
15811588
#' 2. `found_permutation` - the permutation this `gips` represents.
@@ -1590,43 +1597,51 @@ get_diagonalized_matrix_for_heatmap <- function(g) {
15901597
#' the `found_permutation` is over the `start_permutation`.
15911598
#' It cannot be a number less than 1.
15921599
#' Remember that this number can big and overflow to `Inf`.
1593-
#' 7. `n0` - the minimal number of observations needed for the existence of
1600+
#' 7. `log_times_more_likely_than_start` - log of
1601+
#' `times_more_likely_than_start`.
1602+
#' 8. `likelihood_ratio_test_statistics`, `likelihood_ratio_test_p_value` -
1603+
#' statistics and p-value of Likelihood Ratio test, where
1604+
#' the H_0 is that the data was drawn from the normal distribution
1605+
#' with Covariance matrix invariant under `found_permutation`.
1606+
#' The p-value is calculated from the asymptotic distribution.
1607+
#' Note that this is sensibly defined only for \eqn{n \ge p}.
1608+
#' 9. `n0` - the minimal number of observations needed for the existence of
15941609
#' the maximum likelihood estimator (corresponding to a MAP) of
15951610
#' the covariance matrix (see **\eqn{C\sigma} and `n0`**
15961611
#' section in `vignette("Theory", package = "gips")` or in its
15971612
#' [pkgdown page](https://przechoj.github.io/gips/articles/Theory.html)).
1598-
#' 8. `S_matrix` - the underlying matrix.
1613+
#' 10. `S_matrix` - the underlying matrix.
15991614
#' This matrix will be used in calculations of
16001615
#' the posteriori value in [log_posteriori_of_gips()].
1601-
#' 9. `number_of_observations` - the number of observations that
1616+
#' 11. `number_of_observations` - the number of observations that
16021617
#' were observed for the `S_matrix` to be calculated.
16031618
#' This value will be used in calculations of
16041619
#' the posteriori value in [log_posteriori_of_gips()].
1605-
#' 10. `was_mean_estimated` - given by the user while creating the `gips` object:
1620+
#' 12. `was_mean_estimated` - given by the user while creating the `gips` object:
16061621
#' * `TRUE` means the `S` parameter was output of the [stats::cov()] function;
16071622
#' * `FALSE` means the `S` parameter was calculated with
16081623
#' `S = t(X) %*% X / number_of_observations`.
1609-
#' 11. `delta`, `D_matrix` - the hyperparameters of the Bayesian method.
1624+
#' 13. `delta`, `D_matrix` - the hyperparameters of the Bayesian method.
16101625
#' See the **Hyperparameters** section of [gips()] documentation.
1611-
#' 12. `AIC`, `BIC` - output of [AIC.gips()] and [BIC.gips()] functions.
1612-
#' 13. `n_parameters` - number of free parameters in the covariance matrix.
1613-
#' 14. `optimization_algorithm_used` - all used optimization algorithms
1626+
#' 14. `n_parameters` - number of free parameters in the covariance matrix.
1627+
#' 15. `AIC`, `BIC` - output of [AIC.gips()] and [BIC.gips()] functions.
1628+
#' 16. `optimization_algorithm_used` - all used optimization algorithms
16141629
#' in order (one could start optimization with "MH", and then
16151630
#' do an "HC").
1616-
#' 15. `did_converge` - a boolean, did the last used algorithm converge.
1617-
#' 16. `number_of_log_posteriori_calls` - how many times was
1631+
#' 17. `did_converge` - a boolean, did the last used algorithm converge.
1632+
#' 18. `number_of_log_posteriori_calls` - how many times was
16181633
#' the [log_posteriori_of_gips()] function called during
16191634
#' the optimization.
1620-
#' 17. `whole_optimization_time` - how long was the optimization process;
1635+
#' 19. `whole_optimization_time` - how long was the optimization process;
16211636
#' the sum of all optimization times (when there were multiple).
1622-
#' 18. `log_posteriori_calls_after_best` - how many times was
1637+
#' 20. `log_posteriori_calls_after_best` - how many times was
16231638
#' the [log_posteriori_of_gips()] function called after
16241639
#' the `found_permutation`; in other words, how long ago
16251640
#' could the optimization be stopped and have the same result.
16261641
#' If this value is small, consider running [find_MAP()]
16271642
#' again with `optimizer = "continue"`.
16281643
#' For `optimizer = "BF"`, it is `NULL`.
1629-
#' 19. `acceptance_rate` - only interesting for `optimizer = "MH"`.
1644+
#' 21. `acceptance_rate` - only interesting for `optimizer = "MH"`.
16301645
#' How often was the algorithm accepting the change of permutation
16311646
#' in an iteration.
16321647
#' @export

Diff for: inst/WORDLIST

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ CRAN's
88
DOI
99
Diaconis
1010
EDA
11-
EPYC
1211
Eq
1312
Graczyk
1413
HC
@@ -26,6 +25,7 @@ Optimizers
2625
Piotr
2726
Posteriori
2827
Pseudocode
28+
RStudio
2929
Schwarz's
3030
Sym
3131
Validator

Diff for: man/summary.gips.Rd

+17-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)