Skip to content

Commit

Permalink
Doc updates
Browse files Browse the repository at this point in the history
Doc updates with status labels
  • Loading branch information
mingdeyu committed Dec 12, 2024
1 parent 464e7cd commit 5e2b7ad
Show file tree
Hide file tree
Showing 19 changed files with 95 additions and 37 deletions.
10 changes: 7 additions & 3 deletions R/alm.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#' @title Locate the next design point(s) for a (D)GP emulator or a bundle of (D)GP emulators using Active Learning MacKay (ALM)
#'
#' @description This function searches from a candidate set to locate the next design point(s) to be added to a (D)GP emulator
#' @description
#'
#' `r new_badge("updated")`
#'
#' This function searches from a candidate set to locate the next design point(s) to be added to a (D)GP emulator
#' or a bundle of (D)GP emulators using the Active Learning MacKay (ALM) criterion (see the reference below).
#'
#' @param object can be one of the following:
Expand All @@ -11,7 +15,7 @@
#' from which the next design point(s) are determined. If `object` is an instance of the `bundle` class and `aggregate` is not supplied, `x_cand` can also be a list.
#' The list must have a length equal to the number of emulators in `object`, with each element being a matrix representing the candidate set for a corresponding
#' emulator in the bundle. Defaults to `NULL`.
#' @param n_start an integer that gives the number of initial design points to be used to determine next design point(s). This argument
#' @param n_start `r new_badge("new")` an integer that gives the number of initial design points to be used to determine next design point(s). This argument
#' is only used when `x_cand` is `NULL`. Defaults to `20`.
#' @param batch_size an integer that gives the number of design points to be chosen. Defaults to `1`.
#' @param M `r new_badge("new")` the size of the conditioning set for the Vecchia approximation in the criterion calculation. This argument is only used if the emulator `object`
Expand All @@ -23,7 +27,7 @@
#' If a vector is provided, it will be converted to a two-column row matrix. The rows of the matrix correspond to input dimensions, and its
#' first and second columns correspond to the minimum and maximum values of the input dimensions. This
#' argument is only used when `x_cand = NULL`. Defaults to `NULL`.
#' @param int a bool or a vector of bools that indicates if an input dimension is an integer type. If a single bool is given, it will be applied to
#' @param int `r new_badge("new")` a bool or a vector of bools that indicates if an input dimension is an integer type. If a single bool is given, it will be applied to
#' all input dimensions. If a vector is provided, it should have a length equal to the input dimensions and will be applied to individual
#' input dimensions. This argument is only used when `x_cand = NULL`. Defaults to `FALSE`.
#' @param aggregate an R function that aggregates scores of the ALM across different output dimensions (if `object` is an instance
Expand Down
12 changes: 8 additions & 4 deletions R/design.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#' @title Sequential design of a (D)GP emulator or a bundle of (D)GP emulators
#'
#' @description This function implements sequential design and active learning for a (D)GP emulator or
#' @description
#'
#' `r new_badge("updated")`
#'
#' This function implements sequential design and active learning for a (D)GP emulator or
#' a bundle of (D)GP emulators, supporting an array of popular methods as well as user-specified approaches.
#' It can also be used as a wrapper for Bayesian optimization methods.
#'
Expand All @@ -13,7 +17,7 @@
#' from which the next design points are determined. Defaults to `NULL`.
#' @param y_cand a matrix (with each row being a simulator evaluation and column being an output dimension) that gives the realizations
#' from the simulator at input positions in `x_cand`. Defaults to `NULL`.
#' @param n_sample an integer that gives the size of a sub-set to be sampled from the candidate set `x_cand` at each step of the sequential design to determine the next
#' @param n_sample `r new_badge("new")` an integer that gives the size of a sub-set to be sampled from the candidate set `x_cand` at each step of the sequential design to determine the next
#' design point, if `x_cand` is not `NULL`.
#'
#' Defaults to `200`.
Expand Down Expand Up @@ -59,7 +63,7 @@
#' Defaults to `FALSE`.
#' @param target a number or vector specifying the target evaluation metric value(s) at which the sequential design should terminate.
#' Defaults to `NULL`, in which case the sequential design stops after `N` steps. See the *Note* section below for further details about `target`.
#' @param method an R function that determines the next design points to be evaluated by `f`. The function must adhere to the following rules:
#' @param method `r new_badge("updated")` an R function that determines the next design points to be evaluated by `f`. The function must adhere to the following rules:
#' - **First argument**: an emulator object, which can be one of the following:
#' - an instance of the `gp` class (produced by [gp()]);
#' - an instance of the `dgp` class (produced by [dgp()]);
Expand All @@ -76,7 +80,7 @@
#' represent the new design points for the corresponding emulator.
#'
#' See [alm()], [mice()], and [vigf()] for examples of built-in `method` functions. Defaults to [vigf()].
#' @param batch_size an integer specifying the number of design points to select in a single iteration. Defaults to `1`.
#' @param batch_size `r new_badge("new")` an integer specifying the number of design points to select in a single iteration. Defaults to `1`.
#' This argument is used by the built-in `method` functions [alm()], [mice()], and [vigf()].
#' If you provide a custom `method` function with an argument named `batch_size`, the value of `batch_size` will be passed to your function.
#' @param eval an R function that computes a customized metric for evaluating emulator performance. The function must adhere to the following rules:
Expand Down
8 changes: 6 additions & 2 deletions R/draw.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#' @title Validation and diagnostic plots for a sequential design
#'
#' @description This function draws diagnostic and validation plots for a sequential design of a (D)GP emulator or a bundle of (D)GP emulators.
#' @description
#'
#' `r new_badge("updated")`
#'
#' This function draws diagnostic and validation plots for a sequential design of a (D)GP emulator or a bundle of (D)GP emulators.
#'
#' @param object can be one of the following emulator classes:
#' * the S3 class `gp`.
Expand All @@ -13,7 +17,7 @@
#' Defaults to `"rmse"`.
#' @param log a bool indicating whether to plot RMSEs, log-losses (for DGP emulators with categorical likelihoods), or custom evaluation metrics on a log scale when `type = "rmse"`.
#' Defaults to `FALSE`.
#' @param emulator an index or vector of indices of emulators packed in `object`. This argument is only used if `object` is an instance of the `bundle` class. When set to `NULL`, all
#' @param emulator `r new_badge("updated")` an index or vector of indices of emulators packed in `object`. This argument is only used if `object` is an instance of the `bundle` class. When set to `NULL`, all
#' emulators in the bundle are drawn. Defaults to `NULL`.
#' @param ... N/A.
#'
Expand Down
6 changes: 5 additions & 1 deletion R/lgp.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#' @title Linked (D)GP emulator construction
#'
#' @description This function constructs a linked (D)GP emulator for a model chain or network.
#' @description
#'
#' `r new_badge("updated")`
#'
#' This function constructs a linked (D)GP emulator for a model chain or network.
#'
#' @param struc the structure of the linked emulator, which can take one of two forms:
#' - `r lifecycle::badge("deprecated")` a list contains *L* (the number of layers in a systems of computer models) sub-lists,
Expand Down
10 changes: 7 additions & 3 deletions R/mice.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#' @title Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using MICE
#'
#' @description This function searches from a candidate set to locate the next design point(s) to be added to a (D)GP emulator
#' @description
#'
#' `r new_badge("updated")`
#'
#' This function searches from a candidate set to locate the next design point(s) to be added to a (D)GP emulator
#' or a bundle of (D)GP emulators using the Mutual Information for Computer Experiments (MICE), see the reference below.
#'
#' @param object can be one of the following:
Expand All @@ -20,11 +24,11 @@
#' @param nugget_s the value of the smoothing nugget term used by MICE. Defaults to `1e-6`.
#' @param workers the number of processes to be used for the criterion calculation. If set to `NULL`,
#' the number of processes is set to `max physical cores available %/% 2`. Defaults to `1`.
#' @param limits a two-column matrix that gives the ranges of each input dimension, or a vector of length two if there is only one input dimension.
#' @param limits `r new_badge("new")` a two-column matrix that gives the ranges of each input dimension, or a vector of length two if there is only one input dimension.
#' If a vector is provided, it will be converted to a two-column row matrix. The rows of the matrix correspond to input dimensions, and its
#' first and second columns correspond to the minimum and maximum values of the input dimensions. This
#' argument is only used when `x_cand = NULL`. Defaults to `NULL`.
#' @param int a bool or a vector of bools that indicates if an input dimension is an integer type. If a single bool is given, it will be applied to
#' @param int `r new_badge("new")` a bool or a vector of bools that indicates if an input dimension is an integer type. If a single bool is given, it will be applied to
#' all input dimensions. If a vector is provided, it should have a length equal to the input dimensions and will be applied to individual
#' input dimensions. This argument is only used when `x_cand = NULL`. Defaults to `FALSE`.
#' @param aggregate an R function that aggregates scores of the MICE across different output dimensions (if `object` is an instance
Expand Down
8 changes: 6 additions & 2 deletions R/plot.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#' @title Validation plots of a constructed GP, DGP, or linked (D)GP emulator
#'
#' @description This function draws validation plots of a GP, DGP, or linked (D)GP emulator.
#' @description
#'
#' `r new_badge("updated")`
#'
#' This function draws validation plots of a GP, DGP, or linked (D)GP emulator.
#'
#' @param x can be one of the following emulator classes:
#' * the S3 class `gp`.
#' * the S3 class `dgp`.
#' * the S3 class `lgp`.
#' @param x_test same as that of [validate()].
#' @param y_test same as that of [validate()].
#' @param dim if `dim = NULL`, the index of an emulator's input within the design will be shown on the x-axis in validation plots. Otherwise, `dim` indicates
#' @param dim `r new_badge("updated")` if `dim = NULL`, the index of an emulator's input within the design will be shown on the x-axis in validation plots. Otherwise, `dim` indicates
#' which dimension of an emulator's input will be shown on the x-axis in validation plots:
#' * If `x` is an instance of the `gp` of `dgp` class, `dim` is an integer.
#' * `r lifecycle::badge("deprecated")` If `x` is an instance of the `lgp` class created by [lgp()] without specifying the `struc` argument in data frame form, `dim` can be:
Expand Down
7 changes: 5 additions & 2 deletions R/prediction.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#' @title Prediction from GP, DGP, or linked (D)GP emulators
#'
#' @description This function implements single-core or multi-core prediction (with or without multi-threading)
#' from GP, DGP, or linked (D)GP emulators.
#' @description
#'
#' `r new_badge("updated")`
#'
#' This function implements prediction from GP, DGP, or linked (D)GP emulators.
#'
#' @param object an instance of the `gp`, `dgp`, or `lgp` class.
#' @param x the testing input data:
Expand Down
12 changes: 10 additions & 2 deletions R/serialization.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#' @title Serialize the constructed emulator
#'
#' @description This function serialize the constructed emulator.
#' @description
#'
#' `r new_badge("new")`
#'
#' This function serialize the constructed emulator.
#'
#' @param object an instance of the S3 class `gp`, `dgp`, `lgp`, or `bundle`.
#' @param light a bool indicating if a light version of the constructed emulator (that requires a small storage) will be serialized.
Expand Down Expand Up @@ -98,7 +102,11 @@ serialize <- function(object, light = TRUE) {

#' @title Restore the serialized emulator
#'
#' @description This function restores the serialized emulator created by [serialize()].
#' @description
#'
#' `r new_badge("new")`
#'
#' This function restores the serialized emulator created by [serialize()].
#'
#' @param object the serialized object of an emulator.
#'
Expand Down
12 changes: 8 additions & 4 deletions R/vigf.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#' @title Locate the next design point for a (D)GP emulator or a bundle of (D)GP emulators using VIGF
#'
#' @description This function searches from a candidate set to locate the next design point(s) to be added to a (D)GP emulator
#' @description
#'
#' `r new_badge("updated")`
#'
#' This function searches from a candidate set to locate the next design point(s) to be added to a (D)GP emulator
#' or a bundle of (D)GP emulators using the Variance of Improvement for Global Fit (VIGF). For VIGF on GP emulators, see the reference below.
#'
#' @param object can be one of the following:
Expand All @@ -11,7 +15,7 @@
#' from which the next design point(s) are determined. If `object` is an instance of the `bundle` class and `aggregate` is not supplied, `x_cand` can also be a list.
#' The list must have a length equal to the number of emulators in `object`, with each element being a matrix representing the candidate set for a corresponding
#' emulator in the bundle. Defaults to `NULL`.
#' @param n_start an integer that gives the number of initial design points to be used to determine next design point(s). This argument
#' @param n_start `r new_badge("new")` an integer that gives the number of initial design points to be used to determine next design point(s). This argument
#' is only used when `x_cand` is `NULL`. Defaults to `10`.
#' @param batch_size an integer that gives the number of design points to be chosen.
#' Defaults to `1`.
Expand All @@ -20,11 +24,11 @@
#' @param workers the number of processes to be used for design point selection. If set to `NULL`,
#' the number of processes is set to `max physical cores available %/% 2`. Defaults to `1`. The argument does not currently support Windows machines when the `aggregate`
#' function is provided, due to the significant overhead caused by initializing the Python environment for each worker under spawning.
#' @param limits a two-column matrix that gives the ranges of each input dimension, or a vector of length two if there is only one input dimension.
#' @param limits `r new_badge("new")` a two-column matrix that gives the ranges of each input dimension, or a vector of length two if there is only one input dimension.
#' If a vector is provided, it will be converted to a two-column row matrix. The rows of the matrix correspond to input dimensions, and its
#' first and second columns correspond to the minimum and maximum values of the input dimensions. This
#' argument is only used when `x_cand = NULL`. Defaults to `NULL`.
#' @param int a bool or a vector of bools that indicates if an input dimension is an integer type. If a single bool is given, it will be applied to
#' @param int `r new_badge("new")` a bool or a vector of bools that indicates if an input dimension is an integer type. If a single bool is given, it will be applied to
#' all input dimensions. If a vector is provided, it should have a length equal to the input dimensions and will be applied to individual
#' input dimensions. This argument is only used when `x_cand = NULL`. Defaults to `FALSE`.
#' @param aggregate an R function that aggregates scores of the VIGF across different output dimensions (if `object` is an instance
Expand Down
6 changes: 4 additions & 2 deletions man/alm.Rd

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

2 changes: 2 additions & 0 deletions man/deserialize.Rd

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

Loading

0 comments on commit 5e2b7ad

Please sign in to comment.