Coder Social home page Coder Social logo

rich-payne / dreamer Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 1.0 14.02 MB

An R package to fit Bayesian model averaging of (possibly longitudinal) dose-response models.

Home Page: https://rich-payne.github.io/dreamer

License: Other

R 100.00%
bayesian dose-response-modeling r-package

dreamer's People

Contributors

olivroy avatar rich-payne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dreamer's Issues

Clean up README

Some of the equations are not rendering. Perhaps move them to the vignette, and then reference the vignette in the README.

Confusing warning when models are not named

library(dreamer)
mcmc <- dreamer_mcmc(
  data = NULL,
  model_independent_binary(
    mu_b1 = c(0, 0),
    sigma_b1 = c(5, 5),
    doses = c(0, 1),
    link = "logit"
  )
)
#> Warning in names(model_list)[i] <- paste0("model_", i, "_",
#> class(model_list[[i]])): number of items to replace is not a multiple of
#> replacement length
#> model_1_dreamer_independent_binary
#> start : 2022-10-27 09:26:19.981
#> Compiling model graph
#>    Resolving undeclared variables
#>    Allocating nodes
#> Graph information:
#>    Observed stochastic nodes: 0
#>    Unobserved stochastic nodes: 2
#>    Total graph size: 11
#> 
#> Initializing model
#> finish: 2022-10-27 09:26:20.026
#> total : 0.04 secs

Created on 2022-10-27 by the reprex package (v2.0.1)

Rather than try to name the models, an error should be thrown requiring the user to name the arguments.

Consider covariate adjustment

We just learned about a real-world clinical use case that will probably want to use dreamer and needs to adjust for covariates. Sound feasible to add to the dreamer models?

Ensure dose and response are numeric

Error is generated for independent models, but the error is not informative. For binary models, ensure values are 0/1.

library(dreamer)
data <- data.frame(dose = factor(1:2), response = 11:12)
dreamer_mcmc(
  data,
  mod = model_independent(
    mu_b1 = rep(0, 2),
    sigma_b1 = rep(1, 2),
    doses = c(1, 2),
    shape = 1,
    rate = .01
  )
)
#> mod
#> start : 2021-08-26 15:37:02.000
#> Error: Doses specified do not match doses in data

Created on 2021-08-26 by the reprex package (v0.3.0)

Add a hyperbolic emax model function?

This could be a simple wrapper called model_hyper_emax. This would be an alternative to "hacking" the prior of b4 to be N(0, .00001^2) or similar in the emax model.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.