Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Missing updated bounds from `sim_gs_n()` changed from `Inf` to `NA` with latest {gsDesign2}

Abierto
#379 2 comentarios 0 reacciones 1 asignado Ver en GitHub

@jdblischak ya está trabajando en esto.

Desde el 28/9/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Two {simtrial} tests failed the weekly integration test:

══ Failed tests ════════════════════════════════════════════════════════════════
── Failure ('test-unvalidated-sim_gs_n.R:755:3'): sim_gs_n() can update bounds even when some are missing ──
Expected `observed$updated_upper_bound` to equal `c(Inf, 2.46416041021134, 1.99094670148633)`.
Differences:
  `actual`:  NA 2.464160410 1.990946701
`expected`: Inf 2.464160410 1.990946701

── Failure ('test-unvalidated-sim_gs_n.R:759:3'): sim_gs_n() can update bounds even when some are missing ──
Expected `observed$updated_lower_bound` to equal `c(-2.72847356838699, -Inf, -Inf)`.
Differences:
  `actual`: -2.728473568   NA   NA
`expected`: -2.728473568 -Inf -Inf


[ FAIL 2 | WARN 1 | SKIP 3 | PASS 270 ]

I was able to narrow it down to the recent update to gsDesign2::gs_update_ahr() (https://github.com/Merck/gsDesign2/pull/676)

With the latest development version of {gsDesign2} (https://github.com/Merck/gsDesign2/commit/e4f7ae6aec1af252771c1351aee53f01e29bca70), the missing updated bounds are reported as NA.

library("gsDesign")
library("gsDesign2")
library("simtrial")

# futility - IA1; efficacy - IA2 & FA
x <- gs_design_ahr(
  alpha = 0.025,
  beta = 0.1,
  analysis_time = 1:3*12,
  upper = gsDesign2::gs_spending_bound,
  upar = list(sf = sfLDOF, total_spend = 0.025),
  test_upper = c(FALSE, TRUE, TRUE),
  lower = gs_spending_bound,
  lpar = list(sf = sfHSD, param = -4, total_spend = 0.01),
  test_lower = c(TRUE, FALSE, FALSE)
) |> to_integer()

set.seed(1)
observed <- sim_gs_n(
  n_sim = 1,
  sample_size = max(x$analysis$n),
  enroll_rate = x$enroll_rate,
  fail_rate = x$fail_rate,
  test = wlr,
  weight = fh(rho = 0, gamma = 0),
  cut = list(ia1 = create_cut(planned_calendar_time = x$analysis$time[1]),
             ia2 = create_cut(planned_calendar_time = x$analysis$time[2]),
             fa = create_cut(planned_calendar_time = x$analysis$time[3])),
  original_design = x
)

observed
observed[, 13:16]
##   planned_lower_bound planned_upper_bound updated_lower_bound updated_upper_bound
## 1           -2.319759                  NA           -2.728474                  NA
## 2                  NA            2.358356                  NA            2.464160
## 3                  NA            2.009328                  NA            1.990947

Building {gsDesign2} from the previous commit (https://github.com/Merck/gsDesign2/commit/aac76407433f156e44cea798d26b0015088678d9), the missing updated bounds are reported as -Inf or Inf.

library("gsDesign")
library("gsDesign2")
library("simtrial")

# futility - IA1; efficacy - IA2 & FA
x <- gs_design_ahr(
  alpha = 0.025,
  beta = 0.1,
  analysis_time = 1:3*12,
  upper = gsDesign2::gs_spending_bound,
  upar = list(sf = sfLDOF, total_spend = 0.025),
  test_upper = c(FALSE, TRUE, TRUE),
  lower = gs_spending_bound,
  lpar = list(sf = sfHSD, param = -4, total_spend = 0.01),
  test_lower = c(TRUE, FALSE, FALSE)
) |> to_integer()

set.seed(1)
observed <- sim_gs_n(
  n_sim = 1,
  sample_size = max(x$analysis$n),
  enroll_rate = x$enroll_rate,
  fail_rate = x$fail_rate,
  test = wlr,
  weight = fh(rho = 0, gamma = 0),
  cut = list(ia1 = create_cut(planned_calendar_time = x$analysis$time[1]),
             ia2 = create_cut(planned_calendar_time = x$analysis$time[2]),
             fa = create_cut(planned_calendar_time = x$analysis$time[3])),
  original_design = x
)

observed
observed[, 13:16]
##   planned_lower_bound planned_upper_bound updated_lower_bound updated_upper_bound
## 1           -2.319759                  NA           -2.728474                 Inf
## 2                  NA            2.358356                -Inf            2.464160
## 3                  NA            2.009328                -Inf            1.990947

Which is the desired behavior going forward?

xref: #335

Lenguaje dominante
R
Estrellas
41
Forks
14
Merge medio
3 h 4 min
PR fusionados (30 d)
1

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Merck/simtrial

Todos los issues de Merck/simtrial

Issues similares

Más issues de R

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.