fragla/eq5d

Additional speedup to eq5d3l

Closed this issue · 1 comments

Apologies - I raised a PR (#15) before raising an issue. We can further speedup the eq5d3l() code by tweaking the internal .02() and .O3() functions. #15 does this and provides a significant speed improvement. Copying from the PR description

library(eq5d)

# Example data
scores.df3 <- data.frame(MO=c(1,2,3,3,3), SC=c(1,1,1,3,2), UA=c(1,1,2,3,1), PD=c(1,3,3,3,3), AD=c(1,2,NA,2,1))
scores.df4 <- do.call(rbind, replicate(200,scores.df3,FALSE))
countries2 <- names(VAS)

# The current development version
system.time(
  lapply(countries2, eq5d, scores=scores.df4, version="3L", type="VAS", ignore.invalid=TRUE)
)
#>    user  system elapsed 
#>    4.865   0.000   4.883

After PR:

#>    user  system elapsed 
#>   1.473   0.006   1.487

Issue addressed by PR #15.