Skip to content

Commit

Permalink
Merge pull request #326 from fweber144/mbox_mathrm
Browse files Browse the repository at this point in the history
Docs: Replace `\mbox{}` by `\mathrm{}`
  • Loading branch information
fweber144 authored Jul 1, 2022
2 parents edb504f + a677b12 commit 33047d6
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 50 deletions.
22 changes: 11 additions & 11 deletions R/methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@
#' @param ... Arguments passed to [project()] if `object` is not already an
#' object returned by [project()].
#'
#' @return Let \eqn{S_{\mbox{prj}}}{S_prj} denote the number of (possibly
#' @return Let \eqn{S_{\mathrm{prj}}}{S_prj} denote the number of (possibly
#' clustered) projected posterior draws (short: the number of projected draws)
#' and \eqn{N} the number of observations. Then, if the prediction is done for
#' one submodel only (i.e., `length(nterms) == 1 || !is.null(solution_terms)`
#' in the call to [project()]):
#' * [proj_linpred()] returns a `list` with elements `pred` (predictions) and
#' `lpd` (log predictive densities). Both elements are \eqn{S_{\mbox{prj}}
#' `lpd` (log predictive densities). Both elements are \eqn{S_{\mathrm{prj}}
#' \times N}{S_prj x N} matrices.
#' * [proj_predict()] returns an \eqn{S_{\mbox{prj}} \times N}{S_prj x N}
#' matrix of predictions where \eqn{S_{\mbox{prj}}}{S_prj} denotes
#' * [proj_predict()] returns an \eqn{S_{\mathrm{prj}} \times N}{S_prj x N}
#' matrix of predictions where \eqn{S_{\mathrm{prj}}}{S_prj} denotes
#' `nresample_clusters` in case of clustered projection.
#'
#' If the prediction is done for more than one submodel, the output from above
Expand Down Expand Up @@ -689,18 +689,18 @@ print.vsel <- function(x, ...) {
#' the lower or upper bound (depending on argument `type`) of the
#' normal-approximation confidence interval (with nominal coverage `1 -
#' alpha`; see argument `alpha` of [summary.vsel()]) for \eqn{U_k -
#' U_{\mbox{base}}}{U_k - U_base} (with \eqn{U_k} denoting the \eqn{k}-th
#' submodel's true utility and \eqn{U_{\mbox{base}}}{U_base} denoting the
#' U_{\mathrm{base}}}{U_k - U_base} (with \eqn{U_k} denoting the \eqn{k}-th
#' submodel's true utility and \eqn{U_{\mathrm{base}}}{U_base} denoting the
#' baseline model's true utility) falls above (or is equal to)
#' \deqn{\texttt{pct} \cdot (u_0 - u_{\mbox{base}})}{pct * (u_0 - u_base)}
#' \deqn{\texttt{pct} \cdot (u_0 - u_{\mathrm{base}})}{pct * (u_0 - u_base)}
#' where \eqn{u_0} denotes the null model's estimated utility and
#' \eqn{u_{\mbox{base}}}{u_base} the baseline model's estimated utility. The
#' \eqn{u_{\mathrm{base}}}{u_base} the baseline model's estimated utility. The
#' baseline is either the reference model or the best submodel found (see
#' argument `baseline` of [summary.vsel()]).
#'
#' For example, `alpha = 0.32`, `pct = 0`, and `type = "upper"` means that we
#' select the smallest model size for which the upper bound of the 68%
#' confidence interval for \eqn{U_k - U_{\mbox{base}}}{U_k - U_base} exceeds
#' confidence interval for \eqn{U_k - U_{\mathrm{base}}}{U_k - U_base} exceeds
#' (or is equal to) zero, that is, for which the submodel's utility estimate
#' is at most one standard error smaller than the baseline model's utility
#' estimate.
Expand Down Expand Up @@ -1056,8 +1056,8 @@ get_subparams.gamm4 <- function(x, ...) {
#' uses `"rstanarm"` if the reference model fit is of an unknown class).
#' @param ... Currently ignored.
#'
#' @return An \eqn{S_{\mbox{prj}} \times Q}{S_prj x Q} matrix of projected
#' draws, with \eqn{S_{\mbox{prj}}}{S_prj} denoting the number of projected
#' @return An \eqn{S_{\mathrm{prj}} \times Q}{S_prj x Q} matrix of projected
#' draws, with \eqn{S_{\mathrm{prj}}}{S_prj} denoting the number of projected
#' draws and \eqn{Q} the number of parameters.
#'
#' @examples
Expand Down
16 changes: 8 additions & 8 deletions R/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,24 +181,24 @@ bootstrap <- function(x, fun = mean, B = 2000,
# subsampled (without replacement).
#
# @return Let \eqn{y} denote the response (vector), \eqn{N} the number of
# observations, and \eqn{S_{\mbox{prj}}}{S_prj} the number of projected draws
# (= either `nclusters` or `ndraws`, depending on which one is used). Then the
# return value is a list with elements:
# observations, and \eqn{S_{\mathrm{prj}}}{S_prj} the number of projected
# draws (= either `nclusters` or `ndraws`, depending on which one is used).
# Then the return value is a list with elements:
#
# * `mu`: An \eqn{N \times S_{\mbox{prj}}}{N x S_prj} matrix of expected
# * `mu`: An \eqn{N \times S_{\mathrm{prj}}}{N x S_prj} matrix of expected
# values for \eqn{y} for each draw/cluster.
# * `var`: An \eqn{N \times S_{\mbox{prj}}}{N x S_prj} matrix of predictive
# * `var`: An \eqn{N \times S_{\mathrm{prj}}}{N x S_prj} matrix of predictive
# variances for \eqn{y} for each draw/cluster which are needed for projecting
# the dispersion parameter (the predictive variances are NA for those families
# that do not have a dispersion parameter).
# * `dis`: A vector of length \eqn{S_{\mbox{prj}}}{S_prj} containing the
# * `dis`: A vector of length \eqn{S_{\mathrm{prj}}}{S_prj} containing the
# reference model's dispersion parameter value for each draw/cluster (NA for
# those families that do not have a dispersion parameter).
# * `weights`: A vector of length \eqn{S_{\mbox{prj}}}{S_prj} containing the
# * `weights`: A vector of length \eqn{S_{\mathrm{prj}}}{S_prj} containing the
# weights for the draws/clusters.
# * `cl`: Cluster assignment for each posterior draw, that is, a vector that
# has length equal to the number of posterior draws and each value is an
# integer between 1 and \eqn{S_{\mbox{prj}}}{S_prj}.
# integer between 1 and \eqn{S_{\mathrm{prj}}}{S_prj}.
.get_refdist <- function(refmodel, ndraws = NULL, nclusters = NULL,
thinning = TRUE) {
# Number of draws in the reference model:
Expand Down
20 changes: 10 additions & 10 deletions R/refmodel.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
#' Arguments `ref_predfun`, `proj_predfun`, and `div_minimizer` may be `NULL`
#' for using an internal default. Otherwise, let \eqn{N} denote the number of
#' observations (in case of CV, these may be reduced to each fold),
#' \eqn{S_{\mbox{ref}}}{S_ref} the number of posterior draws for the reference
#' model's parameters, and \eqn{S_{\mbox{prj}}}{S_prj} the number of (possibly
#' \eqn{S_{\mathrm{ref}}}{S_ref} the number of posterior draws for the reference
#' model's parameters, and \eqn{S_{\mathrm{prj}}}{S_prj} the number of (possibly
#' clustered) parameter draws for projection (short: the number of projected
#' draws). Then the functions supplied to these arguments need to have the
#' following prototypes:
Expand All @@ -114,7 +114,7 @@
#' typically stored in `fit`) or data for new observations (at least in the
#' form of a `data.frame`).
#' * `proj_predfun`: `proj_predfun(fits, newdata)` where:
#' + `fits` accepts a `list` of length \eqn{S_{\mbox{prj}}}{S_prj}
#' + `fits` accepts a `list` of length \eqn{S_{\mathrm{prj}}}{S_prj}
#' containing this number of submodel fits. This `list` is the same as that
#' returned by [project()] in its output element `submodl` (which in turn is
#' the same as the return value of `div_minimizer`, except if [project()]
Expand All @@ -125,26 +125,26 @@
#' * `div_minimizer` does not need to have a specific prototype, but it needs to
#' be able to be called with the following arguments:
#' + `formula` accepts either a standard [`formula`] with a single response
#' (if \eqn{S_{\mbox{prj}} = 1}{S_prj = 1}) or a [`formula`] with
#' \eqn{S_{\mbox{prj}} > 1}{S_prj > 1} response variables [cbind()]-ed on
#' (if \eqn{S_{\mathrm{prj}} = 1}{S_prj = 1}) or a [`formula`] with
#' \eqn{S_{\mathrm{prj}} > 1}{S_prj > 1} response variables [cbind()]-ed on
#' the left-hand side in which case the projection has to be performed for
#' each of the response variables separately.
#' + `data` accepts a `data.frame` to be used for the projection.
#' + `family` accepts a [`family`] object.
#' + `weights` accepts either observation weights (at least in the form of a
#' numeric vector) or `NULL` (for using a vector of ones as weights).
#' + `projpred_var` accepts an \eqn{N \times S_{\mbox{prj}}}{N x S_prj}
#' + `projpred_var` accepts an \eqn{N \times S_{\mathrm{prj}}}{N x S_prj}
#' matrix of predictive variances (necessary for \pkg{projpred}'s internal
#' GLM fitter).
#' + `projpred_regul` accepts a single numeric value as supplied to argument
#' `regul` of [project()], for example.
#' + `...` accepts further arguments specified by the user.
#'
#' The return value of these functions needs to be:
#' * `ref_predfun`: an \eqn{N \times S_{\mbox{ref}}}{N x S_ref} matrix.
#' * `proj_predfun`: an \eqn{N \times S_{\mbox{prj}}}{N x S_prj} matrix.
#' * `div_minimizer`: a `list` of length \eqn{S_{\mbox{prj}}}{S_prj} containing
#' this number of submodel fits.
#' * `ref_predfun`: an \eqn{N \times S_{\mathrm{ref}}}{N x S_ref} matrix.
#' * `proj_predfun`: an \eqn{N \times S_{\mathrm{prj}}}{N x S_prj} matrix.
#' * `div_minimizer`: a `list` of length \eqn{S_{\mathrm{prj}}}{S_prj}
#' containing this number of submodel fits.
#'
#' # Argument `extract_model_data`
#'
Expand Down
4 changes: 2 additions & 2 deletions man/as.matrix.projection.Rd

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

8 changes: 4 additions & 4 deletions man/pred-projection.Rd

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

20 changes: 10 additions & 10 deletions man/refmodel-init-get.Rd

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

10 changes: 5 additions & 5 deletions man/suggest_size.Rd

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

0 comments on commit 33047d6

Please sign in to comment.