Skip to content

Refactor expected_event() for better computational efficiency #250

@LittleBeannie

Description

@LittleBeannie
x <- microbenchmark::microbenchmark(
  t1 = gsDesign::eEvents(lambda = c(0.05, 0.02, 0.01),  # event hazard rates
                         eta = 0.01,                    # dropout hazard rates
                         gamma = c(5, 10, 20),          # rates of entry
                         R =  c(2, 1, 2),               # duration of time periods for recruitment rates
                         S =  c(1, 1),                  # duration of piecewise constant event rates
                         T = 12,                        # time of analysis
                         Tfinal = NULL,                 # Study duration
                         minfup = 12 - 5,
                         digits = 4),
  t2 = expected_event(enroll_rate = define_enroll_rate(duration = c(2, 1, 2), rate = c(5, 10, 20)),
                      fail_rate = define_fail_rate(duration = c(1, 1, 100), fail_rate = c(0.05, 0.02, 0.01), dropout_rate = 0.01),
                      total_duration = 12,
                      simple = FALSE),
  times = 1000
)
levels(x$expr) <- c("eEvents", "expected_event")

x

image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions