bennu

R 패키지 메타데이터와 수집 신호를 모아 봅니다.

Packages / CRAN / bennu

bennu

v0.3.2
bennu
Repository CRANLicense MIT + file LICENSELifecycle activeNeeds compilation yes
DOI
10.32614/CRAN.package.bennu

Core Signals

첫 화면에서 판단해야 할 수집 신호를 먼저 배치합니다.

0
표시할 핵심 신호가 없습니다.

Supported Backends

DESCRIPTION에서 감지한 backend 관련 package입니다.

0
backend package 신호가 없습니다.

Quick Facts

기본 메타데이터를 작은 카드와 토큰으로 압축합니다.

profile
Repository
CRAN
Version
0.3.2
License
MIT + file LICENSE
Lifecycle
active
Needs compilation
yes
Last observed
2026-05-30
CRAN
cran.r-project.org/package=bennu

Build fields

LinkingTo
6
BH (>= 1.66.0)Rcpp (>= 0.12.0)RcppEigen (>= 0.3.3.3.0)RcppParallel (>= 5.0.1)rstan (>= 2.26.0)StanHeaders (>= 2.26.0)

수집 소스별 패키지 정보

1개 소스
CRAN
0.3.2
2026-05-30
License
MIT + file LICENSE
Depends
R (>= 3.4.0)
Imports
dplyr, generics, ggplot2, glue, lifecycle, magrittr, methods, Rcpp (>= 0.12.0), RcppParallel (>= 5.0.1), rlang, rstan (>= 2.26.0), rstantools (>= 2.5.0), scales, tidybayes, tidyr
Suggests
bayesplot, covr, knitr, latex2exp, posterior, progress, rmarkdown, stringr, testthat (>= 3.0.0)
LinkingTo
BH (>= 1.66.0), Rcpp (>= 0.12.0), RcppEigen (>= 0.3.3.3.0), RcppParallel (>= 5.0.1), rstan (>= 2.26.0), StanHeaders (>= 2.26.0)
Needs compilation
yes
Lifecycle
active
Last observed
2026-05-30 10:45:11

이 패키지가 의존하는 패키지

5개 표시전체 30개
PackageTypeSpec
dplyr
CRAN · 0.3.2 · 2026-05-30
Importsdplyr
generics
CRAN · 0.3.2 · 2026-05-30
Importsgenerics
ggplot2
CRAN · 0.3.2 · 2026-05-30
Importsggplot2
glue
CRAN · 0.3.2 · 2026-05-30
Importsglue
lifecycle
CRAN · 0.3.2 · 2026-05-30
Importslifecycle
1 / 6

이 패키지를 쓰는 패키지

0개 표시전체 0개
PackageTypeSpec
표시할 dependency edge가 없습니다.
1 / 1

패키지 페이지

All links
54
Repository
CRAN
Version
0.3.2
Collected
2026-05-21 03:51:12
Package page
https://cran.r-project.org/web/packages/bennu/index.html
DOI
10.32614/CRAN.package.bennu
CRAN checks
https://cran.r-project.org/web/checks/check_results_bennu.html
README
https://cran.r-project.org/web/packages/bennu/readme/README.html
NEWS
https://cran.r-project.org/web/packages/bennu/news/news.html
Reference HTML
https://cran.r-project.org/web/packages/bennu/refman/bennu.html
Reference PDF
https://cran.r-project.org/web/packages/bennu/bennu.pdf
Source package
https://cran.r-project.org/src/contrib/bennu_0.3.2.tar.gz
Archive
https://CRAN.R-project.org/src/contrib/Archive/bennu
Page fields
Author
Mike Irvine [aut, cre, cph], Samantha Bardwell [ctb], Andrew Johnson [ctb]
BugReports
https://github.com/sempwn/bennu/issues
CRAN Checks
bennu results
DOI
10.32614/CRAN.package.bennu
License
MIT + file LICENSE
LinkingTo
BH (≥ 1.66.0), Rcpp (≥ 0.12.0), RcppEigen (≥ 0.3.3.3.0), RcppParallel (≥ 5.0.1), rstan (≥ 2.26.0), StanHeaders (≥ 2.26.0)
Maintainer
Mike Irvine <mike.irvine at bccdc.ca>
Materials
README , NEWS
NeedsCompilation
yes
Old Sources
bennu archive
Package Source
bennu_0.3.2.tar.gz
Published
2025-10-09
Reference Manual
bennu.html , bennu.pdf
SystemRequirements
GNU make
URL
https://sempwn.github.io/bennu/
Version
0.3.2
Vignettes
Introduction ( source , R code ) Simulation Validation Experiments ( source , R code )
Windows Binaries
r-devel: bennu_0.3.2.zip , r-release: bennu_0.3.2.zip , r-oldrel: bennu_0.3.2.zip
MacOS Binaries
r-release (arm64): bennu_0.3.2.tgz , r-oldrel (arm64): bennu_0.3.2.tgz , r-release (x86_64): bennu_0.3.2.tgz , r-oldrel (x86_64): bennu_0.3.2.tgz
Version
0.3.2
LinkingTo
BH (≥ 1.66.0), Rcpp (≥ 0.12.0), RcppEigen (≥ 0.3.3.3.0), RcppParallel (≥ 5.0.1), rstan (≥ 2.26.0), StanHeaders (≥ 2.26.0)
Published
2025-10-09
DOI
10.32614/CRAN.package.bennu
Author
Mike Irvine [aut, cre, cph], Samantha Bardwell [ctb], Andrew Johnson [ctb]
Maintainer
Mike Irvine <mike.irvine at bccdc.ca>
BugReports
https://github.com/sempwn/bennu/issues
License
MIT + file LICENSE
URL
https://sempwn.github.io/bennu/
NeedsCompilation
yes
SystemRequirements
GNU make
Materials
README , NEWS
CRAN Checks
bennu results
Reference Manual
bennu.html , bennu.pdf
Vignettes
Introduction ( source , R code ) Simulation Validation Experiments ( source , R code )
Package Source
bennu_0.3.2.tar.gz
Windows Binaries
r-devel: bennu_0.3.2.zip , r-release: bennu_0.3.2.zip , r-oldrel: bennu_0.3.2.zip
MacOS Binaries
r-release (arm64): bennu_0.3.2.tgz , r-oldrel (arm64): bennu_0.3.2.tgz , r-release (x86_64): bennu_0.3.2.tgz , r-oldrel (x86_64): bennu_0.3.2.tgz
Old Sources
bennu archive
Page sections 3
Documentation
Heading
Documentation
Links
[{"label":"bennu.html","section":"","type":"","url":"https://cran.r-project.org/web/packages/bennu/refman/bennu.html"},{"label":"bennu.pdf","section":"","type":"","url":"https://cran.r-project.org/web/packages/bennu/bennu.pdf"},{"label":"Introduction","section":"","type":"","url":"https://cran.r-project.org/web/packages/bennu/vignettes/Introduction.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/bennu/vignettes/Introduction.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/bennu/vignettes/Introduction.R"},{"label":"Simulation Validation Experiments","section":"","type":"","url":"https://cran.r-project.org/web/packages/bennu/vignettes/simulation_validation_experiments.html"},{"label":"source","section":"","type":"","url":"https://cran.r-project.org/web/packages/bennu/vignettes/simulation_validation_experiments.Rmd"},{"label":"R code","section":"","type":"","url":"https://cran.r-project.org/web/packages/bennu/vignettes/simulation_validation_experiments.R"}]
Text
Reference manual: bennu.html , bennu.pdf Vignettes: Introduction ( source , R code ) Simulation Validation Experiments ( source , R code )
Downloads
Heading
Downloads
Links
[{"label":"bennu_0.3.2.tar.gz","section":"","type":"","url":"https://cran.r-project.org/src/contrib/bennu_0.3.2.tar.gz"},{"label":"bennu_0.3.2.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.7/bennu_0.3.2.zip"},{"label":"bennu_0.3.2.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.6/bennu_0.3.2.zip"},{"label":"bennu_0.3.2.zip","section":"","type":"","url":"https://cran.r-project.org/bin/windows/contrib/4.5/bennu_0.3.2.zip"},{"label":"bennu_0.3.2.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/sonoma-arm64/contrib/4.6/bennu_0.3.2.tgz"},{"label":"bennu_0.3.2.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-arm64/contrib/4.5/bennu_0.3.2.tgz"},{"label":"bennu_0.3.2.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.6/bennu_0.3.2.tgz"},{"label":"bennu_0.3.2.tgz","section":"","type":"","url":"https://cran.r-project.org/bin/macosx/big-sur-x86_64/contrib/4.5/bennu_0.3.2.tgz"},{"label":"bennu archive","section":"","type":"","url":"https://CRAN.R-project.org/src/contrib/Archive/bennu"}]
Text
Package source: bennu_0.3.2.tar.gz Windows binaries: r-devel: bennu_0.3.2.zip , r-release: bennu_0.3.2.zip , r-oldrel: bennu_0.3.2.zip macOS binaries: r-release (arm64): bennu_0.3.2.tgz , r-oldrel (arm64): bennu_0.3.2.tgz , r-release (x86_64): bennu_0.3.2.tgz , r-oldrel (x86_64): bennu_0.3.2.tgz Old sources: bennu archive
Linking
Heading
Linking
Links
[{"label":"https://CRAN.R-project.org/package=bennu","section":"","type":"","url":"https://CRAN.R-project.org/package=bennu"}]
Text
Please use the canonical form https://CRAN.R-project.org/package=bennu to link to this page.
Materials 2
Documentation 8
Vignettes 6
Downloads 9
All page links 54

패키지 문서 원문

4 artifacts
field
NEWS
CRAN · 0.3.2 · Materials · text/html · 2,587 · 2026-05-07
Title
NEWS
Label
NEWS
Text content
Text content
NEWS code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} bennu 0.3.2 Fix stringr issue in tests (#44) bennu 0.3.1 Plan to release simplified version of regression model est_naloxone can accept priors to change the default model priors (#38) plot_kit_use can accept reported to plot reported kits used with the posterior predictive distribution (#34) kit_summary_table changed to provide sum estimates by grouped variables as opposed to the percentiles within each group kit_summary_table can accept empty ... to provide overall summary not grouped by variables bennu 0.3.0 kit_summary_table created to provide a quick way of summarizing model output by different strata model_random_walk_data created to more closely mimic Bayesian data generating process generate_model_data deprecated as model_random_walk_data will supplant it as way of generating simulation data to test properties of the model Updates to stan model to make it compliant to rstan 2.26 (#22) bennu 0.2.1 bennu 0.2.0 bennu 0.1.0 est_naloxone can accept psi_vector of variable length and additionally accepts delay_alpha and delay_beta (#12). est_naloxone can accept missing values for Reported_Distributed and Reported_Used columns (#6). bennu 0.0.0.9000 Added a NEWS.md file to track changes to the package.
field
README
CRAN · 0.3.2 · Materials · text/html · 13,294 · 2026-05-07
Title
README
Label
README
Text content
Text content
README code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} pre > code.sourceCode { white-space: pre; position: relative; } pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } div.sourceCode { margin: 1em 0; } pre.sourceCode { margin: 0; } @media screen { div.sourceCode { overflow: auto; } } @media print { pre > code.sourceCode { white-space: pre-wrap; } pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } } pre.numberSource code { counter-reset: source-line 0; } pre.numberSource code > span { position: relative; left: -4em; counter-increment: source-line; } pre.numberSource code > span > a:first-child::before { content: counter(source-line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding: 0 4px; width: 4em; color: #aaaaaa; } pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } div.sourceCode { } @media screen { pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } } code span.al { color: #ff0000; font-weight: bold; } /* Alert */ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ code span.at { color: #7d9029; } /* Attribute */ code span.bn { color: #40a070; } /* BaseN */ code span.bu { color: #008000; } /* BuiltIn */ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ code span.ch { color: #4070a0; } /* Char */ code span.cn { color: #880000; } /* Constant */ code span.co { color: #60a0b0; font-style: italic; } /* Comment */ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ code span.do { color: #ba2121; font-style: italic; } /* Documentation */ code span.dt { color: #902000; } /* DataType */ code span.dv { color: #40a070; } /* DecVal */ code span.er { color: #ff0000; font-weight: bold; } /* Error */ code span.ex { } /* Extension */ code span.fl { color: #40a070; } /* Float */ code span.fu { color: #06287e; } /* Function */ code span.im { color: #008000; font-weight: bold; } /* Import */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ code span.kw { color: #007020; font-weight: bold; } /* Keyword */ code span.op { color: #666666; } /* Operator */ code span.ot { color: #007020; } /* Other */ code span.pp { color: #bc7a00; } /* Preprocessor */ code span.sc { color: #4070a0; } /* SpecialChar */ code span.ss { color: #bb6688; } /* SpecialString */ code span.st { color: #4070a0; } /* String */ code span.va { color: #19177c; } /* Variable */ code span.vs { color: #4070a0; } /* VerbatimString */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ bennu B ayesian E stimation of N aloxone N umbers U nderreporting ( BENNU ) The package name comes from the Welsh word for “to finish” (pronounced benn-y) An R package 📦 for generating estimates of total naloxone kit numbers distributed and used from naloxone kit orders data. Installation You can install the released version of bennu from CRAN with: install.packages ( "bennu" ) And the development version from GitHub with: # install.packages("devtools") devtools :: install_github ( "sempwn/bennu" ) Example This example runs output for test data generated by the package: library (bennu) library (rstan) #> Loading required package: StanHeaders #> #> rstan version 2.32.7 (Stan version 2.32.2) #> For execution on a local, multicore CPU with excess RAM we recommend calling #> options(mc.cores = parallel::detectCores()). #> To avoid recompilation of unchanged Stan programs, we recommend calling #> rstan_options(auto_write = TRUE) #> For within-chain threading using `reduce_sum()` or `map_rect()` Stan functions, #> change `threads_per_chain` option: #> rstan_options(threads_per_chain = 1) library (bayesplot) #> This is bayesplot version 1.14.0 #> - Online documentation and vignettes at mc-stan.org/bayesplot #> - bayesplot theme set to bayesplot::theme_default() #> * Does _not_ affect other ggplot2 plots #> * See ?bayesplot_theme_set for details on theme setting rstan_options ( auto_write = TRUE ) options ( mc.cores = parallel :: detectCores ( logical = FALSE )) ## basic example code d <- generate_model_data () # note iter should be at least 2000 to generate a reasonable posterior sample fit <- est_naloxone (d, iter= 500 ) mcmc_pairs (fit, pars = c ( "sigma" , "mu0" , "zeta" ), off_diag_args = list ( size = 1 , alpha = 0.5 )) An overall summary of the model output can also be provided as a data frame kit_summary_table (fit, data = d) #> # A tibble: 1 × 6 #> Probability of kit use if dist…¹ Estimated as distrib…² Proportion kits dist…³ #> <glue> <glue> <glue> #> 1 64.97% (95% CrI: 12.93% - 96.79… 24,907.00 (95% CrI: 2… 21.03% (95% CrI: 20.8… #> # ℹ abbreviated names: ¹​`Probability of kit use if distributed`, #> # ²​`Estimated as distributed`, #> # ³​`Proportion kits distributed that are reported` #> # ℹ 3 more variables: `Estimated kits used` <glue>, #> # `Proportion kits used that are reported` <glue>, #> # `Proportion kits ordered that are used` <glue> Getting help If you encounter a clear bug, please file an issue with a minimal reproducible example on GitHub .
reference_manual_html
Reference manual HTML
CRAN · 0.3.2 · Documentation · text/html · 26,938 · 2026-05-07
Title
Help for package bennu
Label
Reference manual HTML
Text content
Text content
Help for package bennu const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"}; function processMathHTML() { var l = document.getElementsByClassName('reqn'); for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); } return; } Package {bennu} Contents bennu-package %>% est_naloxone est_naloxone_vec experimental_validation_data generate_model_data kit_summary_table missing_data_validation model_random_walk_data plot_kit_use Title: Bayesian Estimation of Naloxone Kit Number Under-Reporting Version: 0.3.2 Description: Bayesian model and associated tools for generating estimates of total naloxone kit numbers distributed and used from naloxone kit orders data. Provides functions for generating simulated data of naloxone kit use and functions for generating samples from the posterior. License: MIT + file LICENSE Encoding: UTF-8 LazyData: true RoxygenNote: 7.3.3 Biarch: true Depends: R (≥ 3.4.0) Imports: dplyr, generics, ggplot2, glue, lifecycle, magrittr, methods, Rcpp (≥ 0.12.0), RcppParallel (≥ 5.0.1), rlang, rstan (≥ 2.26.0), rstantools (≥ 2.5.0), scales, tidybayes, tidyr LinkingTo: BH (≥ 1.66.0), Rcpp (≥ 0.12.0), RcppEigen (≥ 0.3.3.3.0), RcppParallel (≥ 5.0.1), rstan (≥ 2.26.0), StanHeaders (≥ 2.26.0) SystemRequirements: GNU make Suggests: bayesplot, covr, knitr, latex2exp, posterior, progress, rmarkdown, stringr, testthat (≥ 3.0.0) Config/testthat/edition: 3 URL: https://sempwn.github.io/bennu/ BugReports: https://github.com/sempwn/bennu/issues VignetteBuilder: knitr NeedsCompilation: yes Packaged: 2025-10-09 17:28:23 UTC; rstudio Author: Mike Irvine [aut, cre, cph], Samantha Bardwell [ctb], Andrew Johnson [ctb] Maintainer: Mike Irvine <mike.irvine@bccdc.ca> Repository: CRAN Date/Publication: 2025-10-09 17:50:02 UTC The 'bennu' package. Description Bayesian Estimation of Naloxone use Number Under-reporting Author(s) Maintainer : Mike Irvine mike.irvine@bccdc.ca ( ORCID ) [copyright holder] Other contributors: Samantha Bardwell [contributor] Andrew Johnson [contributor] References Stan Development Team (2020). RStan: the R interface to Stan. R package version 2.21.2. https://mc-stan.org See Also Useful links: https://sempwn.github.io/bennu/ Report bugs at https://github.com/sempwn/bennu/issues Pipe operator Description See magrittr:: %>% for details. Usage lhs %>% rhs Arguments lhs A value or the magrittr placeholder. rhs A function call using the magrittr semantics. Value The result of calling rhs(lhs) . Run Bayesian estimation of naloxone number under-reporting Description Samples from Bayesian model using input from data frame Usage est_naloxone( d, psi_vec = c(0.7, 0.2, 0.1), max_delays = 3, delay_alpha = 2, delay_beta = 1, priors = the$default_priors, run_estimation = TRUE, rw_type = 1, chains = 4, iter = 2000, seed = 42, adapt_delta = 0.85, pars = the$default_outputs, include = TRUE, ... ) Arguments d data frame with format regions unique id for region times time in months Orders Kits ordered Reported_Used Kits reported as used Reported_Distributed Kits reported as distributed region_name Optional label for region psi_vec reporting delay distribution max_delays maximum delay from kit ordered to kit distributed delay_alpha shape parameter for order to distributed delay distribution delay_beta shape parameter for order to distributed delay distribution priors list of prior values including their mean (mu) and standard deviation (sigma) run_estimation if TRUE will sample from posterior otherwise will sample from prior only rw_type 1 - random walk of order one. 2 - random walk of order 2. chains A positive integer specifying the number of Markov chains. The default is 4. iter A positive integer specifying the number of iterations for each chain (including warmup). The default is 2000. seed Seed for random number generation adapt_delta (double, between 0 and 1, defaults to 0.8) pars A vector of character strings specifying parameters of interest. The default is NA indicating all parameters in the model. If include = TRUE , only samples for parameters named in pars are stored in the fitted results. Conversely, if include = FALSE , samples for all parameters except those named in pars are stored in the fitted results. include Logical scalar defaulting to TRUE indicating whether to include or exclude the parameters given by the pars argument. If FALSE , only entire multidimensional parameters can be excluded, rather than particular elements of them. ... other parameters to pass to rstan::sampling Value An S4 rstan::stanfit class object containing the fitted model See Also Other inference: est_naloxone_vec () Examples ## Not run: library(rstan) library(bayesplot) rstan_options(auto_write = TRUE) options(mc.cores = parallel::detectCores(logical = FALSE)) d <- generate_model_data() priors <- list( c = list(mu = 0, sigma = 1), ct0 = list(mu = 0, sigma = 1), zeta = list(mu = 0, sigma = 1), mu0 = list(mu = 0, sigma = 1), sigma = list(mu = 0, sigma = 1) ) fit <- est_naloxone(d, priors = priors, iter = 100, chains = 1) mcmc_pairs(fit, pars = c("sigma", "mu0"), off_diag_args = list(size = 1, alpha = 0.5) ) ## End(Not run) Run Bayesian estimation of naloxone number under-reporting Description Samples from Bayesian model Usage est_naloxone_vec( N_region, N_t, N_distributed, regions, times, Orders2D, Reported_Distributed, Reported_Used, region_name, psi_vec = c(0.7, 0.2, 0.1), max_delays = 3, delay_alpha = 2, delay_beta = 1, priors = the$default_priors, run_estimation = TRUE, rw_type = 1, chains = 4, iter = 2000, seed = 42, adapt_delta = 0.85, pars = the$default_outputs, include = TRUE, ... ) Arguments N_region Number of regions N_t number of time steps N_distributed Number of samples of reporting for distribution of kits regions vector (time, region) of regions (coded 1 to N_region) times vector (time, region) of regions (coded 1 to N_t) Orders2D vector (time, region) of orders Reported_Distributed vector (time, region) reported as distributed Reported_Used vector (time, region) reported as used region_name bring in region names psi_vec reporting delay distribution max_delays maximum delay from kit ordered to kit distributed delay_alpha shape parameter for order to distributed delay distribution delay_beta shape parameter for order to distributed delay distribution priors list of prior values including their mean (mu) and standard deviation (sigma) run_estimation if TRUE will sample from posterior otherwise will sample from prior only rw_type 1 - random walk of order one. 2 - random walk of order 2. chains A positive integer specifying the number of Markov chains. The default is 4. iter A positive integer specifying the number of iterations for each chain (including warmup). The default is 2000. seed Seed for random number generation adapt_delta (double, between 0 and 1, defaults to 0.8) pars A vector of character strings specifying parameters of interest. The default is NA indicating all parameters in the model. If include = TRUE , only samples for parameters named in pars are stored in the fitted results. Conversely, if include = FALSE , samples for all parameters except those named in pars are stored in the fitted results. include Logical scalar defaulting to TRUE indicating whether to include or exclude the parameters given by the pars argument. If FALSE , only entire multidimensional parameters can be excluded, rather than particular elements of them. ... other parameters to pass to rstan::sampling Value An S4 rstan::stanfit class object containing the fitted model See Also Other inference: est_naloxone () Experimental validation results Description Generated data from validation experiments of simulated data Usage experimental_validation_data Format experimental_validation_data A data frame with 200 rows and 8 columns: .variable Model variable p50 Median of the posterior p25, p75 2nd and 3rd quartiles of the posterior p05, p95 1st and 19th ventiles of the posterior true_value The va
section
bennu.pdf
CRAN · 0.3.2 · Documentation · application/pdf · 146,171 · 2026-05-07
Title
bennu.pdf
Label
bennu.pdf

Reference for bennu (0.3.2)

10개 topic
%>%
Pipe operator
CRAN · 0.3.2 · bennu/man/pipe.Rd · 2026-05-07

See magrittr::[magrittr:pipe]%>% for details.

Aliases
%>%
Keywords
internal
Usage
lhs %>% rhs
Arguments
lhs
A value or the magrittr placeholder.
rhs
A function call using the magrittr semantics.
Value
The result of calling rhs(lhs).
bennu-package
The 'bennu' package.
CRAN · 0.3.2 · package · bennu/man/bennu-package.Rd · 2026-05-07

Bayesian Estimation of Naloxone use Number Under-reporting

Aliases
bennu-packagebennu
See also
Useful links: https://sempwn.github.io/bennu/ Report bugs at https://github.com/sempwn/bennu/issues
Author
Maintainer: Mike Irvine mike.irvine@bccdc.ca (https://orcid.org/0000-0003-4785-8998ORCID) [copyright holder] Other contributors: Samantha Bardwell [contributor] Andrew Johnson [contributor]
References
Stan Development Team (2020). RStan: the R interface to Stan. R package version 2.21.2. https://mc-stan.org
est_naloxone
Run Bayesian estimation of naloxone number under-reporting
CRAN · 0.3.2 · bennu/man/est_naloxone.Rd · 2026-05-07

Samples from Bayesian model using input from data frame

Aliases
est_naloxone
Concepts
inference
Usage
est_naloxone( d, psi_vec = c(0.7, 0.2, 0.1), max_delays = 3, delay_alpha = 2, delay_beta = 1, priors = the$default_priors, run_estimation = TRUE, rw_type = 1, chains = 4, iter = 2000, seed = 42, adapt_delta = 0.85, pars = the$default_outputs, include = TRUE, ... )
Arguments
d
data frame with format regionsunique id for region timestime in months OrdersKits ordered Reported_UsedKits reported as used Reported_DistributedKits reported as distributed region_nameOptional label for region
psi_vec
reporting delay distribution
max_delays
maximum delay from kit ordered to kit distributed
delay_alpha
shape parameter for order to distributed delay distribution
delay_beta
shape parameter for order to distributed delay distribution
priors
list of prior values including their mean (mu) and standard deviation (sigma)
run_estimation
if TRUE will sample from posterior otherwise will sample from prior only
rw_type
1 - random walk of order one. 2 - random walk of order 2.
chains
A positive integer specifying the number of Markov chains. The default is 4.
iter
A positive integer specifying the number of iterations for each chain (including warmup). The default is 2000.
seed
Seed for random number generation
adapt_delta
(double, between 0 and 1, defaults to 0.8)
pars
A vector of character strings specifying parameters of interest. The default is NA indicating all parameters in the model. If include = TRUE, only samples for parameters named in pars are stored in the fitted results. Conversely, if include = FALSE, samples for all parameters except those named in pars are stored in the fitted results.
include
Logical scalar defaulting to TRUE indicating whether to include or exclude the parameters given by the pars argument. If FALSE, only entire multidimensional parameters can be excluded, rather than particular elements of them.
...
other parameters to pass to [rstan:stanmodel-method-sampling]rstan::sampling
Value
An S4 [rstan:stanfit-class]rstan::stanfit class object containing the fitted model
Examples
library(rstan) library(bayesplot) rstan_options(auto_write = TRUE) options(mc.cores = parallel::detectCores(logical = FALSE)) d <- generate_model_data() priors <- list( c = list(mu = 0, sigma = 1), ct0 = list(mu = 0, sigma = 1), zeta = list(mu = 0, sigma = 1), mu0 = list(mu = 0, sigma = 1), sigma = list(mu = 0, sigma = 1) ) fit <- est_naloxone(d, priors = priors, iter = 100, chains = 1) mcmc_pairs(fit, pars = c("sigma", "mu0"), off_diag_args = list(size = 1, alpha = 0.5) )
See also
Other inference: est_naloxone_vec()
est_naloxone_vec
Run Bayesian estimation of naloxone number under-reporting
CRAN · 0.3.2 · bennu/man/est_naloxone_vec.Rd · 2026-05-07

Samples from Bayesian model

Aliases
est_naloxone_vec
Concepts
inference
Usage
est_naloxone_vec( N_region, N_t, N_distributed, regions, times, Orders2D, Reported_Distributed, Reported_Used, region_name, psi_vec = c(0.7, 0.2, 0.1), max_delays = 3, delay_alpha = 2, delay_beta = 1, priors = the$default_priors, run_estimation = TRUE, rw_type = 1, chains = 4, iter = 2000, seed = 42, adapt_delta = 0.85, pars = the$default_outputs, include = TRUE, ... )
Arguments
N_region
Number of regions
N_t
number of time steps
N_distributed
Number of samples of reporting for distribution of kits
regions
vector (time, region) of regions (coded 1 to N_region)
times
vector (time, region) of regions (coded 1 to N_t)
Orders2D
vector (time, region) of orders
Reported_Distributed
vector (time, region) reported as distributed
Reported_Used
vector (time, region) reported as used
region_name
bring in region names
psi_vec
reporting delay distribution
max_delays
maximum delay from kit ordered to kit distributed
delay_alpha
shape parameter for order to distributed delay distribution
delay_beta
shape parameter for order to distributed delay distribution
priors
list of prior values including their mean (mu) and standard deviation (sigma)
run_estimation
if TRUE will sample from posterior otherwise will sample from prior only
rw_type
1 - random walk of order one. 2 - random walk of order 2.
chains
A positive integer specifying the number of Markov chains. The default is 4.
iter
A positive integer specifying the number of iterations for each chain (including warmup). The default is 2000.
seed
Seed for random number generation
adapt_delta
(double, between 0 and 1, defaults to 0.8)
pars
A vector of character strings specifying parameters of interest. The default is NA indicating all parameters in the model. If include = TRUE, only samples for parameters named in pars are stored in the fitted results. Conversely, if include = FALSE, samples for all parameters except those named in pars are stored in the fitted results.
include
Logical scalar defaulting to TRUE indicating whether to include or exclude the parameters given by the pars argument. If FALSE, only entire multidimensional parameters can be excluded, rather than particular elements of them.
...
other parameters to pass to [rstan:stanmodel-method-sampling]rstan::sampling
Value
An S4 [rstan:stanfit-class]rstan::stanfit class object containing the fitted model
See also
Other inference: est_naloxone()
experimental_validation_data
Experimental validation results
CRAN · 0.3.2 · data · bennu/man/experimental_validation_data.Rd · 2026-05-07

Generated data from validation experiments of simulated data

Aliases
experimental_validation_data
Keywords
datasets
Concepts
validation data
Usage
experimental_validation_data
Format
experimental_validation_data A data frame with 200 rows and 8 columns: .variableModel variable p50Median of the posterior p25, p752nd and 3rd quartiles of the posterior p05, p951st and 19th ventiles of the posterior true_valueThe value used to generate the simulation experimentExperiment number index
See also
Other validation data: missing_data_validation
generate_model_data
generate model data for testing purposes
CRAN · 0.3.2 · bennu/man/generate_model_data.Rd · 2026-05-07

htmlhttps://lifecycle.r-lib.org/articles/stages.html#deprecatedlifecycle-deprecated.svgoptions: alt='[Deprecated]'[Deprecated] Simulate kits ordered and kits distributed for a set number of regions and time-points. The kits ordered simulation is a simple square-term multiplied by region_coeffs. For example if region_coeffs = c(1,2) then the number of kits ordered at month 12 are c(1,2) * 12^2 = c(144,288). The probability of kit use in time is assumed to increase linearly in inverse logit space at a constant rate 0.1. The probability of reporting for each month and region is iid distributed logit^-1(p) N(2,5) which produces a mean reporting rate of approximately 88%

Aliases
generate_model_data
Concepts
data generation
Usage
generate_model_data( N_t = 24, region_coeffs = c(5, 0.5), c_region = c(-1, 2), reporting_freq = NULL )
Arguments
N_t
number of time-points
region_coeffs
vector of coefficients for regions determining kit orders
c_region
logit probability of kit use per region
reporting_freq
The frequency that distribution data is provided. If NULL distribution frequency matches orders frequency
Value
A [tibble:tibble]tibble::tibble() OrdersKit orders per time and region regionsNumeric index indicating region of orders and distributions Reported_UsedNumber of kits reported as used Reported_DistributedNumber of kits reported as distributed p_useProbability that a kit was used p_reportedProbability that a distributed kit was reported timesIndex for time region_nameString index for the region
See also
Other data generation: model_random_walk_data()
kit_summary_table
Summarize model fit
CRAN · 0.3.2 · bennu/man/kit_summary_table.Rd · 2026-05-07

Provides a summary of: Estimated kits distributed Percentage of kits distributed that are reported Estimated kits used percentage of kits used that are reported percentage of kits orders that are used probability kit used if distributed

Aliases
kit_summary_table
Concepts
plots
Usage
kit_summary_table( fit, ..., data = NULL, accuracy = 0.01, cri_range = 0.95, ndraws = NULL )
Arguments
fit
[rstan:stanfit-class]rstan::stanfit object
...
variables to group by in estimate
data
data used for model fitting. Can also include p_use column which can be used to plot true values if derived from simulated data.
accuracy
A number to round to. Use (e.g.) 0.01 to show 2 decimal places of precision. If NULL, the default, uses a heuristic that should ensure breaks have the minimum number of digits needed to show the difference between adjacent values.
cri_range
The range of the credible interval e.g. 0.95
ndraws
Number of draws to use in estimate
Value
A [tibble:tibble]tibble::tibble Probability of kit use if distributed Estimated as distributed Proportion kits distributed that are reported Estimated kits used Proportion kits used that are reported Proportion kits ordered that are used
Examples
fit <- est_naloxone(d) kit_summary_table(fit,regions,data = d)
See also
Other plots: plot_kit_use()
missing_data_validation
Missing data experimental validation results
CRAN · 0.3.2 · data · bennu/man/missing_data_validation.Rd · 2026-05-07

Generated data from validation experiments of simulated data

Aliases
missing_data_validation
Keywords
datasets
Concepts
validation data
Usage
missing_data_validation
Format
missing_data_validation A data frame with 10 rows and 6 columns: p50Median of the posterior p25, p752nd and 3rd quartiles of the posterior p05, p951st and 19th ventiles of the posterior reporting_freqThe reporting frequency in months
See also
Other validation data: experimental_validation_data
model_random_walk_data
generate model data for testing purposes
CRAN · 0.3.2 · bennu/man/model_random_walk_data.Rd · 2026-05-07

Model generating process using random walk to match data generating model in Bayesian framework

Aliases
model_random_walk_data
Concepts
data generation
Usage
model_random_walk_data( N_t = 24, region_coeffs = c(5, 0.5), c_region = c(-1, 2), sigma = 2, zeta = 0.5, mu0 = -1, Orders = NULL, reporting_freq = NULL )
Arguments
N_t
number of time-points
region_coeffs
vector of coefficients for regions determining kit orders
c_region
logit probability of kit use per region
sigma
standard deviation of error in logit probability of kit use
zeta
standard deviation of random walk in logit space
mu0
initial condition of random walk in logit space
Orders
A 2D matrix of shape length(region_coeffs) by N_t
reporting_freq
The frequency that distribution data is provided. If NULL distribution frequency matches orders frequency
Value
A tibble OrdersKit orders per time and region regionsNumeric index indicating region of orders and distributions Reported_UsedNumber of kits reported as used Reported_DistributedNumber of kits reported as distributed p_useProbability that a kit was used p_reportedProbability that a distributed kit was reported timesIndex for time region_nameString index for the region
See also
Other data generation: generate_model_data()
plot_kit_use
Plot of probability of naloxone kit use
CRAN · 0.3.2 · bennu/man/plot_kit_use.Rd · 2026-05-07

plot can compare between two different model fits or a single model fit by region. If data are simulated then can also include in plot. For more details see the introduction vignette: vignette("Introduction", package = "bennu")

Aliases
plot_kit_use
Concepts
plots
Usage
plot_kit_use(..., data = NULL, reported = FALSE, regions_to_plot = NULL)
Arguments
...
named list of [rstan:stanfit-class]rstan::stanfit objects
data
data used for model fitting. Can also include p_use column which can be used to plot true values if derived from simulated data.
reported
if TRUE then produces a plot of the reported kits which is equivalent to the predictive check.
regions_to_plot
Optional list to filter which regions are plotted
Value
[ggplot2:ggplot]ggplot2::ggplot object
See also
Other plots: kit_summary_table()

버전 이력

RepositoryVersionPublishedFirst seenLast seenDocs
CRAN0.3.22026-05-292026-05-30

보안

표시할 OSV 데이터가 없습니다.

문헌 신호

표시할 OpenAlex 데이터가 없습니다.