Skip to content

Commit

Permalink
Documentation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pbastide committed Jan 31, 2024
1 parent 5985683 commit 0493bf8
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 157 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# PhylogeneticEM 1.6.0.9000
* Bug fixes:
* Fix documentation notes on CRAN checks.
* New functions and features:
* Function `node_optimal_values` for optimal values computation at each nodes.
* Trait names are now inherited by the `params_process` objects.

# PhylogeneticEM 1.6.0
* Deprecation fix:
Expand Down
2 changes: 1 addition & 1 deletion R/M_step.R
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ compute_var_diff.OU <- function(phylo, conditional_law_X, selection.strength) {
#' @title Compute weighted sum of var_diff
#'
#' @description
#' \code{compute_sum_var_diff} computes sum_{e edge} ell_j * Var[X_j - X_pa(j) | Y]
#' \code{compute_sum_var_diff} computes \sum_\{e edge\} ell_j * Var[X_j - X_pa(j) | Y]
#'
#' @param phylo a phylogenetic tree
#' @param var_diff result of function \code{compute_var_diff.BM}
Expand Down
3 changes: 2 additions & 1 deletion R/generic_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,8 @@ check_dimensions.shifts <- function(p, shifts){
#' @title Find a reasonable grid for alpha
#'
#' @description Grid so that
#' 2*ln(2)*quantile(d_ij)/factor_up_alpha < t_{1/2} < factor_down_alpha * ln(2) * h_tree
#' 2*ln(2)*quantile(d_ij)/factor_up_alpha < t_1/2 < factor_down_alpha * ln(2) * h_tree,
#' with t_1/2 the phylogenetic half life: t_1/2 = log(2)/alpha.
#' Ensures that for alpha_min, it is almost a BM, and for alpha_max,
#' almost all the tips are decorrelated.
#'
Expand Down
4 changes: 2 additions & 2 deletions R/parsimonyNumber.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ extract.parsimonyCost <- function(x,
#'
#' @details
#' At a tip i in state k, the line-vector is initialized as follow :
#' (1 - Ind(k=p)_{1<=p<=nclus})*Inf (where Inf * 0 = 0)
#' (1 - Ind(k=p)_\{1<=p<=nclus\})*Inf (where Inf * 0 = 0)
#'
#' @param phy a phylogenetic tree, class \code{\link[ape]{phylo}}.
#' @param clusters the vector of the clusters of the tips.
Expand Down Expand Up @@ -356,7 +356,7 @@ extract.parsimonyNumber <- function(x,
#' NAs everywhere, except for the tips.
#'
#' @details
#' At a tip i in state k, the line-vector is initialized as follow : Ind(k=p)_{1<=p<=nclus}
#' At a tip i in state k, the line-vector is initialized as follow : Ind(k=p)_\{1<=p<=nclus\}
#'
#' @param phy phylogenetic tree.
#' @param clusters the vector of the clusters of the tips.
Expand Down
6 changes: 3 additions & 3 deletions R/shifts_manipulations.R
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ shifts.matrix_to_list <- function(delta){
#'
#' @description
#' \code{incidence_matrix_actualization_factors} computes a ntaxa x Nedge matrix of the
#' (1 - exp(-alpha * (t_i - t_pa(j) - nu_j * l_j)))_{i tip, j node}.
#' (1 - exp(-alpha * (t_i - t_pa(j) - nu_j * l_j)))_\{i tip, j node\}.
#' This matrix is to be multiplied to the incidence matrix with an outer product.
#'
#' @param tree a phylogenetic tree.
Expand Down Expand Up @@ -375,7 +375,7 @@ incidence_matrix_actualization_factors <- function(tree,
#'
#' @description
#' \code{compute_actualization_matrix_ultrametric} computes a squares p*Nedge bloc diagonal
#' matrix of the (I_p - exp(-A * (h - t_pa(j))))_{j node}.
#' matrix of the (I_p - exp(-A * (h - t_pa(j))))_\{j node\}.
#'
#' @details
#' Careful: the root is not taken into account in this function.
Expand Down Expand Up @@ -419,7 +419,7 @@ compute_actualization_matrix_ultrametric <- function(tree,
#' tips, with the value at the root.
#'
#' @details
#' This function is used in function \code{compute_betas_from_shifts_from_shifts} and is designed to
#' This function is used in function \code{compute_betas_from_shifts} and is designed to
#' furnish function \code{update.compute_betas_from_shifts} with the right structure of data.
#'
#' @param phy Input tree.
Expand Down
80 changes: 0 additions & 80 deletions R/shutoff.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,86 +120,6 @@ shutoff.EM.OU.stationary.root_AND_shifts_at_nodes.half_life <- function(params_o
}
}

#' ######################################################
#' ## Finite parameters ?
#' ######################################################
# ##
# # @title Check whether parameters are finite.
# #
# # @description
# # \code{is.finite.params} checks whether calculated parameters in the EM are
# # finite or not.
# #
# # @details
# # This function is used to test the convergence of the algorithm.
# #
# # @param params list of parameters with the correct structure
# #
# # @return boolean
# #
# # @keywords internal
# #
# #10/06/14 - Initial release
# ##
#'
#' is.finite.params.BM <- function(params) {
#' if (params$root.state$random) {
#' return(is.finite.params.BM.randroot(params))
#' } else {
#' return(is.finite.params.BM.fixedroot(params))
#' }
#' }
#'
#' is.finite.params.BM.randroot <- function(params) {
#' if (is.finite(params$variance) &&
#' is.finite(params$root.state$exp.root) &&
#' is.finite(params$root.state$var.root) ) {
#' return(TRUE)
#' } else {
#' return(FALSE)
#' }
#' }
#'
#' is.finite.params.BM.fixedroot <- function(params) {
#' if ( is.finite(params$variance) &&
#' is.finite(params$root.state$value.root) ) {
#' return(TRUE)
#' } else {
#' return(FALSE)
#' }
#' }
#'
#' is.finite.params.OU <- function(stationary.root, shifts_at_nodes, alpha_known){
#' if (stationary.root && shifts_at_nodes && alpha_known) {
#' return(is.finite.params.OU.specialCase)
#' } else if (stationary.root && shifts_at_nodes) {
#' return(is.finite.params.OU.stationary.root_AND_shifts_at_nodes)
#' } else {
#' stop("The EM algorithm for the OU is only defined (for the moment) for a stationary root and shifts at nodes !")
#' }
#' }
#'
#' is.finite.params.OU.specialCase <- function(params) {
#' if (is.finite(params$variance) &&
#' is.finite(params$root.state$exp.root) &&
#' is.finite(params$root.state$var.root) ) {
#' return(TRUE)
#' } else {
#' return(FALSE)
#' }
#' }
#'
#' is.finite.params.OU.stationary.root_AND_shifts_at_nodes <- function(params) {
#' if (is.finite(params$variance) &&
#' is.finite(params$root.state$exp.root) &&
#' is.finite(params$root.state$var.root) &&
#' is.finite(params$selection.strength)) {
#' return(TRUE)
#' } else {
#' return(FALSE)
#' }
#' }

#################################################################
## Are parameters in ranges ?
#################################################################
Expand Down
2 changes: 1 addition & 1 deletion man/compute_actualization_matrix_ultrametric.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/compute_sum_var_diff.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/find_grid_alpha.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/incidence_matrix_actualization_factors.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/init.compute_betas_from_shifts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/init.parsimonyCost.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/init.parsimonyNumber.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 0 additions & 63 deletions man/is.in.ranges.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0493bf8

Please sign in to comment.