|
| 1 | +# forestsearch NEWS |
| 2 | + |
| 3 | +## forestsearch 0.2.0 |
| 4 | + |
| 5 | +### New functions |
| 6 | + |
| 7 | +* `generate_aft_dgm_flex()` — general data-generating model (DGM) builder. |
| 8 | + Replaces the GBSG-specific `create_gbsg_dgm()` as the primary DGM |
| 9 | + constructor. Accepts any survival dataset and fits an accelerated failure |
| 10 | + time (AFT) super-population model with user-specified treatment effect |
| 11 | + heterogeneity parameters. |
| 12 | + |
| 13 | +* `simulate_from_dgm()` — general simulator for drawing trial replicates from |
| 14 | + an `aft_dgm_flex` DGM. Replaces `simulate_from_gbsg_dgm()`. Column names |
| 15 | + in the returned data frame use underscore notation (`y_sim`, `event_sim`, |
| 16 | + `treat_sim`, `flag_harm`). |
| 17 | + |
| 18 | +* `run_simulation_analysis()` (general version) — simulation wrapper that |
| 19 | + calls `simulate_from_dgm()` and accepts explicit column-name parameters, |
| 20 | + making it applicable to any DGM built with `generate_aft_dgm_flex()`. The |
| 21 | + GBSG dataset is now one application of this general pipeline rather than a |
| 22 | + separate code path. |
| 23 | + |
| 24 | +* `setup_gbsg_dgm()` — convenience bridge function. Wraps |
| 25 | + `create_gbsg_dgm()` (see Deprecated below) and reshapes its output to the |
| 26 | + `aft_dgm_flex` class expected by `simulate_from_dgm()` and |
| 27 | + `run_simulation_analysis()`. Existing GBSG-based simulation scripts can |
| 28 | + adopt the general pipeline with a one-line change: |
| 29 | + `dgm <- setup_gbsg_dgm(model = "alt", k_inter = k, seed = seed)`. |
| 30 | + |
| 31 | +### Deprecated functions |
| 32 | + |
| 33 | +The following functions are retained and fully functional but will be removed |
| 34 | +in a future version. Each emits a deprecation warning on first call with a |
| 35 | +concrete migration example. |
| 36 | + |
| 37 | +* `create_gbsg_dgm()` → use `generate_aft_dgm_flex()` or `setup_gbsg_dgm()`. |
| 38 | + |
| 39 | +* `simulate_from_gbsg_dgm()` → use `simulate_from_dgm(analysis_time = Inf)`. |
| 40 | + Note: the new function defaults to `analysis_time = 48` (staggered-entry |
| 41 | + administrative censoring); pass `analysis_time = Inf` to match the legacy |
| 42 | + `max_follow = Inf` behaviour. Column names in the result also change — see |
| 43 | + the mapping table below. |
| 44 | + |
| 45 | + | Legacy column | General column | |
| 46 | + |---------------|----------------| |
| 47 | + | `y.sim` | `y_sim` | |
| 48 | + | `event.sim` | `event_sim` | |
| 49 | + | `treat` | `treat_sim` | |
| 50 | + | `flag.harm` | `flag_harm` | |
| 51 | + |
| 52 | +### Deprecated parameters |
| 53 | + |
| 54 | +* `run_simulation_analysis(max_follow)` → use `analysis_time`. If supplied, |
| 55 | + `max_follow` is silently forwarded to `analysis_time` with a warning. |
| 56 | + |
| 57 | +* `run_simulation_analysis(muC_adj)` → use `cens_adjust`. If supplied, |
| 58 | + `muC_adj` is silently forwarded to `cens_adjust` with a warning. |
| 59 | + |
| 60 | +### Bug fixes |
| 61 | + |
| 62 | +The following bugs were discovered and fixed during the general pipeline |
| 63 | +migration. All affected code paths were exercised by GBSG factor variables |
| 64 | +(`v1`–`v7`) stored as `factor()` rather than `numeric()`. |
| 65 | + |
| 66 | +* `lasso_selection()` (`get_FSdata_helpers.R`): `as.matrix()` on a data frame |
| 67 | + containing factor columns produced a character matrix that `cv.glmnet()` |
| 68 | + rejected. Factor columns with all-numeric levels are now coerced via |
| 69 | + `as.integer(as.character(.))` before matrix conversion. |
| 70 | + |
| 71 | +* `process_conf_force_expr()` (`get_FSdata_helpers.R`): `mean()` applied to a |
| 72 | + factor column returned `NA`. Factor columns are now coerced to numeric before |
| 73 | + `mean()`, `median()`, and `quantile()` calls. |
| 74 | + |
| 75 | +* `evaluate_comparison()` (`forestsearch_helpers.R`): the `<=` / `>=` |
| 76 | + operator applied to a factor column triggered an `Ops.factor` warning and |
| 77 | + returned `NA`. Factor columns are now coerced to numeric before comparison. |
| 78 | + |
| 79 | +* `forestsearch()` (`forestsearch_main.R`): `df[, conf.screen]` dropped to a |
| 80 | + vector when `conf.screen` had length 1, causing `dummy()` to error on a |
| 81 | + non-data-frame input. Fixed by adding `drop = FALSE`. |
| 82 | + |
| 83 | +* `default_grf_params_gen()` (`run_simulation_analysis.R`): `maxdepth` was |
| 84 | + initialised to `4`, exceeding the maximum of `3` accepted by |
| 85 | + `grf.subg.harm.survival()`. Corrected to `2` (matching the legacy default). |
| 86 | + |
| 87 | +* `default_grf_params_gen()` (`run_simulation_analysis.R`): `sg.criterion` |
| 88 | + was set to `"hr"`, which is not a valid value. Corrected to `"mDiff"` |
| 89 | + (matching the legacy default). |
| 90 | + |
| 91 | +### Internal changes |
| 92 | + |
| 93 | +* `create_gbsg_dgm()` and `simulate_from_gbsg_dgm()` are now thin public |
| 94 | + wrappers that call `.create_gbsg_dgm_()` and `.simulate_from_gbsg_dgm_()` |
| 95 | + internally. This prevents deprecation-warning spam in functions that call |
| 96 | + these internally in loops or binary searches (`calibrate_k_inter()`, |
| 97 | + `get_dgm_with_output()`, `validate_k_inter_effect()`). |
| 98 | + |
| 99 | +* `compute_dgm_cde()` now resolves the super-population data frame from |
| 100 | + `dgm$df_super_rand` (GBSG DGMs) or `dgm$df_super` (general `aft_dgm_flex` |
| 101 | + DGMs), making it compatible with both class hierarchies. |
| 102 | + |
| 103 | +* `globals.R`: added `"sim_id"` to `utils::globalVariables()` to suppress a |
| 104 | + spurious `R CMD check` NOTE from `run_simulation_analysis.R`. |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +## forestsearch 0.1.0 |
| 109 | + |
| 110 | +* Initial release. |
0 commit comments