Skip to content

Commit

Permalink
Debuggin.
Browse files Browse the repository at this point in the history
  • Loading branch information
mnneely committed Jan 6, 2025
1 parent cdc9989 commit 72950e0
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 39 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export(ab_line)
export(add_shapes)
export(add_smooth)
export(additive)
export(cli_ask)
export(combination)
export(compile_model)
export(covariate)
Expand Down
2 changes: 1 addition & 1 deletion R/PM_final.R
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ print.summary.PM_final <- function(x,
flextable::set_header_labels(values = list(Median = glue::glue("Median ({ci}% CI)"), MAWD = glue::glue("MAWD ({ci}% CI)"))) %>%
flextable::set_table_properties(width = .5) %>%
flextable::footnote(i = 1, j = 3,
value = as_paragraph("MAWD: Mean Absolute Weighted Deviation, a nonparametric measure of dispersion similar to variance"),
value = flextable::as_paragraph("MAWD: Mean Absolute Weighted Deviation, a nonparametric measure of dispersion similar to variance"),
ref_symbols = "1",
part = "header") %>%
flextable::theme_zebra() %>%
Expand Down
2 changes: 0 additions & 2 deletions R/PM_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@ PM_Vmodel <- R6::R6Class("PM_model",


# private classes
# TODO: Should I make these fields private?
# This generates text which will be written to genmodel.txt
PM_Vinput <- R6::R6Class(
"PM_Vinput",
Expand Down Expand Up @@ -513,7 +512,6 @@ PM_Vinput <- R6::R6Class(

# PM_model_list -----------------------------------------------------------


PM_model_list <- R6::R6Class("PM_model_list",
inherit = PM_Vmodel,
public = list(
Expand Down
37 changes: 22 additions & 15 deletions R/PM_sim.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,29 @@ PM_sim <- R6::R6Class(
#' - *time* As for `obs`.
#' - *out* The simulated amount.
#' - *comp* The compartment number that contains the `out` amount.
#' * **parValues** A list of data frames with retained simulated parameter
#' values after discarding any due to truncation limits. Each data frame has columns
#' *id* and the parameters for each simulated subject.
#' * **totalSets** Number of all simulated parameter values needed to obtain the
#' requested number of simulated sets within any `limits` specified.
#' * **totalMeans** A list of vectors with the means of simulated parameter values
#' for each subject in the template `data` file. If `usePost` is `FALSE`, which
#' is typical, then each element in this list will be the same, since a single
#' distribution for `poppar`, which may be multimodal and complex if `split` is `TRUE`,
#' is used for all templates in the `data` file.
#' This can be useful to check against the original values in `poppar`, since the
#' * **parValues** A data frame with retained simulated parameter
#' values after discarding any due to truncation limits. The data frame has these columns:
#' - *id* This column is only present if `usePost = TRUE`, since in that case
#' the `nsim` profiles for each template are created by sampling from a different prior
#' joint parameter probability distribution for each template. When `usePost = FALSE`,
#' the same prior is used for every template, so there is no `id` column.
#' - *nsim* The simulation number, from 1 to the value for `nsim` specified when the simulation was run.
#' - a column for each random parameter in the model with the simulated values
#' * **totalSets** When `usePost = FALSE`, the number of all simulated parameter values needed to obtain the
#' requested number of simulated sets within any `limits` specified. When `usePost = TRUE`,
#' a data frame with the same number for each template in the `data` file, since each template
#' is simulated from a different prior distribution (see `parValues:id` above).
#' * **totalMeans** If `usePost = FALSE`, this is a vector with the means of
#' all simulated parameter values, including those discarded for being outside
#' `limits`. If `usePost = TRUE`, this is a data frame of vectors, one for each template in the `data` file,
#' and an `id` column to identify the template in the `data` source.
#' This can be useful to check against the original means in `poppar`, since the
#' mean of the `parValues` may be different due to truncation.
#' * **totalCov** Similar to `totalMeans`, a list of covariance matrices
#' for simulated parameter values from each template. Again, every element
#' of this list will be the same if `usePost` is `FALSE`, and `totalCov` can
#' be useful as a check against the original values in `poppar`.
#' * **totalCov** Similar to `totalMeans`, either a single covariance matrix
#' for all simulated parameter values when `usePost = FALSE` . If `usePost = TRUE`,
#' this is a data frame of such matrices, one for each template in the `data` file,
#' and an `id` column to identify the template in the `data` source.
#' Again, this can be useful as a check against the original covariance in `poppar`.
data = NULL,

#' @description
Expand Down
2 changes: 0 additions & 2 deletions R/PMutilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -1349,8 +1349,6 @@ save_flextable <- function(x) {
#' @param prompt The prompt preceding user input. Default is ">>".
#' @param ... Additional parameters which could be passed to [cli::cli_alert_warning].
#' @return The value of the user response
#' @example
#' cli_ask("Do you wish to proceed?")
#' @export
#'
cli_ask <- function(text, prompt = ">> ", ...) {
Expand Down
51 changes: 32 additions & 19 deletions man/PM_sim.Rd

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

24 changes: 24 additions & 0 deletions man/cli_ask.Rd

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

0 comments on commit 72950e0

Please sign in to comment.