diff --git a/.Rbuildignore b/.Rbuildignore index d479ca3..c423c30 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -22,3 +22,5 @@ index.md ^CRAN-SUBMISSION$ ^CODE_OF_CONDUCT\.md$ ^paper/*$ +^CONTRIBUTING\.md$ +^CITATION\.cff$ diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..cf71c3c --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,44 @@ +cff-version: "1.2.0" +authors: +- family-names: Khoshnevis + given-names: Naeem + orcid: "https://orcid.org/0000-0003-4315-1426" +- family-names: Ren + given-names: Boyu + orcid: "https://orcid.org/0000-0002-5300-1184" +- family-names: Braun + given-names: Danielle + orcid: "https://orcid.org/0000-0002-5177-8598" +contact: +- family-names: Khoshnevis + given-names: Naeem + orcid: "https://orcid.org/0000-0003-4315-1426" +doi: 10.5281/zenodo.10757333 +message: If you use this software, please cite our article in the + Journal of Open Source Software. +preferred-citation: + authors: + - family-names: Khoshnevis + given-names: Naeem + orcid: "https://orcid.org/0000-0003-4315-1426" + - family-names: Ren + given-names: Boyu + orcid: "https://orcid.org/0000-0002-5300-1184" + - family-names: Braun + given-names: Danielle + orcid: "https://orcid.org/0000-0002-5177-8598" + date-published: 2024-03-13 + doi: 10.21105/joss.05465 + issn: 2475-9066 + issue: 95 + journal: Journal of Open Source Software + publisher: + name: Open Journals + start: 5465 + title: GPCERF - An R package for implementing Gaussian processes for + estimating causal exposure response curves + type: article + url: "https://joss.theoj.org/papers/10.21105/joss.05465" + volume: 9 +title: GPCERF - An R package for implementing Gaussian processes for + estimating causal exposure response curves diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..6681376 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,150 @@ +# Contributing + +Contributions are appreciated and can take various forms, such as: + +- Adding new features. +- Enhancing documentation. +- Addressing existing open issues. +- Creating new issues. +- Correcting typos. + +Please review the following documents before making changes to the codebase. + +## Environment Setup + +To contribute to the project, it's recommended to have your own local copy of _GPCERF_ on your Github account. As a result, please fork the project. Then open your terminal (or Gitbash for Windows, Anaconda prompt, ...) and run the following command (brackets are not included): + +```S +git clone git@github.com:[your user name]/GPCERF.git +``` +- If you haven't already, generate an SSH key. Learn more [here](https://docs.github.com/en/github-ae@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent). + +Now, you can modify the codebase and track your changes. Consider creating a new branch to work on the codebase. Refer to the following instructions for git branching. + +## Git Branching Model + +While you can choose any branch name for your personal repository, maintaining consistency and understanding who's working on what is crucial. In this project, we follow the convention that is proposed by Vincent Driessen in his [A successful Git branching model](https://nvie.com/posts/a-successful-git-branching-model/) post. + +Here is the summary of the branches: + +- **main**: The main branch only hosts released software packages. Only project maintainers have write access to the master branch. +- **develop**: The develop branch serves as the primary branch, with the source code of HEAD always reflecting the latest delivered development changes for the next release. +- **supporting** branch: There are various supporting branches. We recommend contributors follow the naming convention for three main supporting branches: + - *feature*: we start a new feature branch to add new features to the software. The naming convention is iss[issue_number]_short_description. For example, if I need to add unittest to one of the functions in the package and the issue number is 12, iss12_add_unittest can be a valid git branch name. We start it with the issue number to go back and take a look at the issue details if necessary. Although feature branches are temporary, this naming convention helps developers to understand the situation while working on the codebase. If you are working on some features that there is no open issue for that, please open an issue [here](https://github.com/NSAPH-Software/GPCERF/issues/) and assign it to yourself. You can also make a comment that you are working on that. + - *hotfix*: hotfix branches will be only used for fixing a bug on a released package. After fixing the bug, the third digit of the version number should be incremented by one. For example, 2.3.5 –> 2.3.6. These branches will be prefixed with hotfix and followed by the upcoming version number (e.g., in this case, hotfix_2.3.6) + - *release*: Release branches support the preparation of a new production release. + +## Where to submit pull requests? + +Submit all pull requests to `base repository: NSAPH-Software/GPCERF` and `base: develop` branch. + +## Pull request checklist + +- Please run `devtools::document()`, `devtools::load_all()` after your final modifications. +- Make sure that your modified code passes all checks and tests (you can run `devtools::check()` in RStudio) +- Your PR should pass all the CI and for merging. +- Add a line(s) about the modification to the NEWS.md file. +- If you are adding new features, please make sure that appropriate documentation is added or updated. +- Please clean up white spaces. Read more [here](https://softwareengineering.stackexchange.com/questions/121555/why-is-trailing-whitespace-a-big-deal/). + +## Reporting bugs + +Please report potential bugs by creating a [new issue](https://github.com/NSAPH-Software/GPCERF/issues/) or sending us an email. Please include the following information in your bug report: + +- A brief description of what you are doing, what you expected to happen, and what happened. +- OS that you are using and whether you are using a personal computer or HPC cluster. +- The version of the package that you have installed. + +## Style Guide + +In this project, we follow the [tidyverse style guide](https://style.tidyverse.org/). + +### Summary + +#### Names + +- File names all snake_case and ends with .R (e.g., create_matching.R) +- variable names small letter and separate with _ if need (e.g., delta_n) +- Function names should follow snake_case style (e.g., generate_data) +- Function names follow verb+output convention (e.g., compute_resid) + +#### Spaces and Indentation + +- Indentations are two spaces (do not use tab) +- Place space around binary operators (e.g., x + y) + +```R +#Acceptable: +z <- x + y + +#Not recommended: +z<-x+y # (no space) +z<- x+y +z<-x +y +``` + +- Place space after comma + +```R +#Acceptable: +a <- matrix(c(1:100), nrow = 5) + +#Not recommended: +a <- matrix(c(1:100),nrow = 5) # (no space after comma) +a <- matrix( c(1:100), nrow = 5 ) # (extra space after and before parentheses) +a<-matrix(c(1:100), nrow = 5) # (no space around unary operator <- ) +``` + +- Place space after # and before commenting and avoid multiple ### + +```R +#Acceptable: +# This is a comment + +#Not recommended: +#This is a comment +# This is a comment (more than one space after #) +## This is a comment (multiple #) +### This is a comment (multiple # and more than one space) +``` + +- Do not put space at the opening and closing the parenthesis + +```R +#Acceptable: +x <- (z + y) + +#Not recommended: +x <- ( z + y ) # (unnecessary space) +x <- (z + y ) +x <- ( z + y) +``` + +- Place a space before and after `()` when used with `if`, `for`, or `while`. + +```R + +#Acceptible +if (x > 2) { + print(x) +} + +# Not recommended +if(x > 2){ + print(x) +} +``` + +#### Other notes + +- Maximum line length is 80 character +- Use explicit returns +- Use explicit tags in documentation (e.g., @title, @description, ...) + +## Notes on SuperLearner + +In this package we create a customized wrapper for the SuperLearner internal libraries. Please read Notes on SL Wrappers for more details. + +## Logger + +Use the logger to examine the internal process. By default, the level is set to "INFO", writing messages to the "GPCERF.log" file. To change the log file location and level, use the update_logger function. diff --git a/DESCRIPTION b/DESCRIPTION index 097309a..1ae993e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: GPCERF Title: Gaussian Processes for Estimating Causal Exposure Response Curves -Version: 0.2.2 +Version: 0.2.3 Authors@R: c( person("Naeem", "Khoshnevis", email = "nkhoshnevis@g.harvard.edu", role=c("aut","cre"), diff --git a/NEWS.md b/NEWS.md index 660f5f9..5cef239 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# GPCERF (developing) +# GPCERF 0.2.3 (2024-03-02) ## Changed diff --git a/R/compute_deriv_weights_gp.R b/R/compute_deriv_weights_gp.R index d8bbe03..684937c 100644 --- a/R/compute_deriv_weights_gp.R +++ b/R/compute_deriv_weights_gp.R @@ -14,7 +14,7 @@ #' (e_gps_pred). #' - Column 3: Standard deviation of e_gps (e_gps_std) #' used_params: -#' - dnorm_log: TRUE or FLASE +#' - dnorm_log: TRUE or FALSE #' @param hyperparam A vector of hyper-parameters in the GP model. #' @param kernel_fn The covariance function. #' @param kernel_deriv_fn The partial derivative of the covariance function. diff --git a/README.md b/README.md index e96591a..0bfb59f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,26 @@ -| Resource | Github Actions | Code Coverage | -| ---------- | -------------------- | --------------- | -| Platforms | Windows, macOS, Linux| codecov | -| R CMD check | [](https://github.com/NSAPH-Software/GPCERF/actions) | [](https://app.codecov.io/gh/NSAPH-Software/GPCERF) | +<p align="center"> + <img src="man/figures/png/gpcerf_logo.png" height="100" alt="Cover Image"/> +</p> + +<div align="center"> + <a href="https://CRAN.R-project.org/package=GPCERF"> + <img src="https://www.r-pkg.org/badges/version-last-release/GPCERF" alt="CRAN Package Version"> + </a> + <a href="https://joss.theoj.org/papers/10.21105/joss.05465"> + <img src="https://joss.theoj.org/papers/10.21105/joss.05465/status.svg" alt="JOSS Status"> + </a> + <a href="https://github.com/NSAPH-Software/GPCERF/actions"> + <img src="https://github.com/NSAPH-Software/GPCERF/workflows/R-CMD-check/badge.svg", alt="R-CMD-check status"> + </a> + <a href="https://app.codecov.io/gh/NSAPH-Software/GPCERF"> + <img src="https://codecov.io/gh/NSAPH-Software/GPCERF/branch/develop/graph/badge.svg?token=066ISL822N", alt="Codecov"> + </a> + <a href="http://www.r-pkg.org/pkg/GPCERF"> + <img src="https://cranlogs.r-pkg.org/badges/grand-total/GPCERF" alt="CRAN RStudio Mirror Downloads"> + </a> +</div> + + # Gaussian processes for the estimation of causal exposure-response curves (GP-CERF) @@ -173,6 +192,10 @@ Original covariate balance: Please note that the GPCERF project is released with a [Contributor Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct). By contributing to this project, you agree to abide by its terms. +## Contributing + +Contributions to the package are encouraged. For detailed information on how to contribute, please refer to the [CONTRIBUTING](CONTRIBUTING.md) guidelines. + ## Reporting Issues & Seeking Support diff --git a/cran-comments.md b/cran-comments.md index cf2b68a..ee13456 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,8 +1,9 @@ -Submission (February 16, 2024): +Submission (March 2, 2024): -We appreciate your efforts in reviewing the GPCERF 0.2.2 package. In this upgrade, we: +We appreciate your efforts in reviewing the GPCERF 0.2.3 package. In this upgrade, we: -- Fixed a note raised in some of CRAN checks. +- Modified the method by which the user specifies the covariate columns. +- Resolved an issue involving data that contains a single covariate. All tests and checks have passed successfully. diff --git a/docs/404.html b/docs/404.html index 3670d04..9567a70 100644 --- a/docs/404.html +++ b/docs/404.html @@ -24,7 +24,7 @@ <a class="navbar-brand me-2" href="https://NSAPH-Software.github.io/GPCERF/index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/CODE_OF_CONDUCT.html b/docs/CODE_OF_CONDUCT.html index 883af3a..7b64d02 100644 --- a/docs/CODE_OF_CONDUCT.html +++ b/docs/CODE_OF_CONDUCT.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/LICENSE.html b/docs/LICENSE.html index c552081..38b7c3a 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/articles/A-Note-on-Choosing-Hyperparameters.html b/docs/articles/A-Note-on-Choosing-Hyperparameters.html index 7369a8a..4651afb 100644 --- a/docs/articles/A-Note-on-Choosing-Hyperparameters.html +++ b/docs/articles/A-Note-on-Choosing-Hyperparameters.html @@ -26,7 +26,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/articles/Developers-Guide.html b/docs/articles/Developers-Guide.html index 63e88d6..c582adf 100644 --- a/docs/articles/Developers-Guide.html +++ b/docs/articles/Developers-Guide.html @@ -26,7 +26,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/articles/GPCERF.html b/docs/articles/GPCERF.html index 5e07751..7fc8c8c 100644 --- a/docs/articles/GPCERF.html +++ b/docs/articles/GPCERF.html @@ -26,7 +26,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/articles/Nearest-neighbor-Gaussian-Processes.html b/docs/articles/Nearest-neighbor-Gaussian-Processes.html index 7f961e1..d26c053 100644 --- a/docs/articles/Nearest-neighbor-Gaussian-Processes.html +++ b/docs/articles/Nearest-neighbor-Gaussian-Processes.html @@ -26,7 +26,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/articles/Standard-Gaussian-Processes.html b/docs/articles/Standard-Gaussian-Processes.html index ca10c55..0023a41 100644 --- a/docs/articles/Standard-Gaussian-Processes.html +++ b/docs/articles/Standard-Gaussian-Processes.html @@ -26,7 +26,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/articles/index.html b/docs/articles/index.html index 43db7fc..4278dfe 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/authors.html b/docs/authors.html index a3c3c16..a60ab0d 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/index.html b/docs/index.html index 5223ab4..fffd85d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -26,7 +26,7 @@ <a class="navbar-brand me-2" href="index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> @@ -146,7 +146,7 @@ <h2 data-toc-skip>Dev status</h2> <li><a href="https://github.com/NSAPH-Software/GPCERF/actions" class="external-link"><img src="https://github.com/NSAPH-Software/GPCERF/workflows/R-CMD-check/badge.svg" alt="R build status"></a></li> <li><a href="https://app.codecov.io/gh/NSAPH-Software/GPCERF" class="external-link"><img src="https://codecov.io/gh/NSAPH-Software/GPCERF/branch/develop/graph/badge.svg?token=066ISL822N" alt="codecov"></a></li> <li><a href="http://www.r-pkg.org/pkg/gpcerf" class="external-link"><img src="https://cranlogs.r-pkg.org/badges/grand-total/GPCERF" alt="CRAN RStudio mirror downloads"></a></li> -<li><a href="https://github.com/NSAPH-Software/GPCERF/issues" class="external-link"><img src="https://img.shields.io/github/issues/nsaph-software/GPCERF" alt="Github issues"></a></li> +<li><a href="https://github.com/NSAPH-Software/GPCERF/issues" class="external-link"><img src="https://img.shields.io/github/issues/nsaph-software/GPCERF" alt="GitHub issues"></a></li> </ul> </div> diff --git a/docs/news/index.html b/docs/news/index.html index 7eecc30..188f7f9 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> @@ -59,6 +59,29 @@ <h6 class="dropdown-header" data-toc-skip>Collabration</h6> <small>Source: <a href="https://github.com/NSAPH-Software/GPCERF/blob/HEAD/NEWS.md" class="external-link"><code>NEWS.md</code></a></small> </div> + <div class="section level2"> +<h2 class="pkg-version" data-toc-text="0.2.3" id="gpcerf-023-2024-03-02">GPCERF 0.2.3 (2024-03-02)<a class="anchor" aria-label="anchor" href="#gpcerf-023-2024-03-02"></a></h2> +<div class="section level3"> +<h3 id="changed-0-2-3">Changed<a class="anchor" aria-label="anchor" href="#changed-0-2-3"></a></h3> +<ul><li> +<code>estimate_cerf_nngp</code> takes <code>outcome_col</code>, <code>treatment_col</code>, and <code>covariates_col</code> names as inputs.</li> +<li> +<code>estimate_cerf_gp</code> takes <code>outcome_col</code>, <code>treatment_col</code>, and <code>covariates_col</code> names as inputs.</li> +</ul></div> +<div class="section level3"> +<h3 id="added-0-2-3">Added<a class="anchor" aria-label="anchor" href="#added-0-2-3"></a></h3> +<ul><li> +<code>estimate_cerf_gp</code> and <code>estimate_cerf_nngp</code> have notes on selecting <code>w</code>.</li> +</ul></div> +</div> + <div class="section level2"> +<h2 class="pkg-version" data-toc-text="0.2.2" id="gpcerf-022-2024-02-16">GPCERF 0.2.2 (2024-02-16)<a class="anchor" aria-label="anchor" href="#gpcerf-022-2024-02-16"></a></h2><p class="text-muted">CRAN release: 2024-02-16</p> +<div class="section level3"> +<h3 id="changed-0-2-2">Changed<a class="anchor" aria-label="anchor" href="#changed-0-2-2"></a></h3> +<ul><li> +<code>n_thread</code> -> <code>nthread</code> in <code>estimate_noise_nn</code> documentation.</li> +</ul></div> +</div> <div class="section level2"> <h2 class="pkg-version" data-toc-text="0.2.1" id="gpcerf-021-2023-01-15">GPCERF 0.2.1 (2023-01-15)<a class="anchor" aria-label="anchor" href="#gpcerf-021-2023-01-15"></a></h2><p class="text-muted">CRAN release: 2023-03-15</p> <div class="section level3"> diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 17ab986..00d5874 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -7,7 +7,7 @@ articles: GPCERF: GPCERF.html Nearest-neighbor-Gaussian-Processes: Nearest-neighbor-Gaussian-Processes.html Standard-Gaussian-Processes: Standard-Gaussian-Processes.html -last_built: 2023-11-21T17:36Z +last_built: 2024-03-01T23:09Z urls: reference: https://NSAPH-Software.github.io/GPCERF/reference article: https://NSAPH-Software.github.io/GPCERF/articles diff --git a/docs/reference/GPCERF-package.html b/docs/reference/GPCERF-package.html index f972d2d..9088f1e 100644 --- a/docs/reference/GPCERF-package.html +++ b/docs/reference/GPCERF-package.html @@ -14,7 +14,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/autoplot.cerf_gp.html b/docs/reference/autoplot.cerf_gp.html index f227a5e..c8ef03c 100644 --- a/docs/reference/autoplot.cerf_gp.html +++ b/docs/reference/autoplot.cerf_gp.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/autoplot.cerf_nngp.html b/docs/reference/autoplot.cerf_nngp.html index 508ffee..89c9c04 100644 --- a/docs/reference/autoplot.cerf_nngp.html +++ b/docs/reference/autoplot.cerf_nngp.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/compute_deriv_nn.html b/docs/reference/compute_deriv_nn.html index eb46a26..6cc6dc2 100644 --- a/docs/reference/compute_deriv_nn.html +++ b/docs/reference/compute_deriv_nn.html @@ -12,7 +12,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/compute_deriv_weights_gp.html b/docs/reference/compute_deriv_weights_gp.html index 8684536..a06e965 100644 --- a/docs/reference/compute_deriv_weights_gp.html +++ b/docs/reference/compute_deriv_weights_gp.html @@ -12,7 +12,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> @@ -97,7 +97,7 @@ <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#argumen (e_gps_pred). - Column 3: Standard deviation of e_gps (e_gps_std) used_params: -- dnorm_log: TRUE or FLASE</p></dd> +- dnorm_log: TRUE or FALSE</p></dd> <dt>hyperparam</dt> diff --git a/docs/reference/compute_inverse.html b/docs/reference/compute_inverse.html index d6f4c08..00c06f3 100644 --- a/docs/reference/compute_inverse.html +++ b/docs/reference/compute_inverse.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/compute_m_sigma.html b/docs/reference/compute_m_sigma.html index e946dc1..1a876a6 100644 --- a/docs/reference/compute_m_sigma.html +++ b/docs/reference/compute_m_sigma.html @@ -14,7 +14,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/compute_posterior_m_nn.html b/docs/reference/compute_posterior_m_nn.html index 565f1b0..9e5915f 100644 --- a/docs/reference/compute_posterior_m_nn.html +++ b/docs/reference/compute_posterior_m_nn.html @@ -14,7 +14,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/compute_posterior_sd_nn.html b/docs/reference/compute_posterior_sd_nn.html index 781afbc..961319f 100644 --- a/docs/reference/compute_posterior_sd_nn.html +++ b/docs/reference/compute_posterior_sd_nn.html @@ -12,7 +12,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/compute_rl_deriv_gp.html b/docs/reference/compute_rl_deriv_gp.html index 1e22a84..3ee287d 100644 --- a/docs/reference/compute_rl_deriv_gp.html +++ b/docs/reference/compute_rl_deriv_gp.html @@ -12,7 +12,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/compute_rl_deriv_nn.html b/docs/reference/compute_rl_deriv_nn.html index 9685354..b73ebaf 100644 --- a/docs/reference/compute_rl_deriv_nn.html +++ b/docs/reference/compute_rl_deriv_nn.html @@ -14,7 +14,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/compute_sd_gp.html b/docs/reference/compute_sd_gp.html index 8655167..b9f876c 100644 --- a/docs/reference/compute_sd_gp.html +++ b/docs/reference/compute_sd_gp.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/compute_w_corr.html b/docs/reference/compute_w_corr.html index 0e2e494..695dd47 100644 --- a/docs/reference/compute_w_corr.html +++ b/docs/reference/compute_w_corr.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/compute_weight_gp.html b/docs/reference/compute_weight_gp.html index 0e6c342..d25a1be 100644 --- a/docs/reference/compute_weight_gp.html +++ b/docs/reference/compute_weight_gp.html @@ -12,7 +12,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/estimate_cerf_gp.html b/docs/reference/estimate_cerf_gp.html index 479e3ad..ce6c6cd 100644 --- a/docs/reference/estimate_cerf_gp.html +++ b/docs/reference/estimate_cerf_gp.html @@ -14,7 +14,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> @@ -92,7 +92,8 @@ <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#argumen <dt>w</dt> -<dd><p>A vector of exposure level to compute CERF.</p></dd> +<dd><p>A vector of exposure level to compute CERF (please also see the +notes).</p></dd> <dt>gps_m</dt> @@ -146,6 +147,19 @@ <h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2 <li><p>pst_mean, Computed mean for the w vector.</p></li> <li><p>pst_sd, Computed credible interval for the w vector.</p></li> </ul></div> + <div class="section level2"> + <h2 id="note">Note<a class="anchor" aria-label="anchor" href="#note"></a></h2> + <p>Please note that <code>w</code> is a vector representing a grid of exposure levels at +which the CERF is to be estimated. This grid can include both observed and +hypothetical values of the exposure variable. The purpose of defining this +grid is to provide a structured set of points across the exposure spectrum +for estimating the CERF. This approach is essential in nonparametric models +like Gaussian Processes (GPs), where the CERF is evaluated at specific points +to understand the relationship between the exposure and outcome variables +across a continuum. It facilitates a comprehensive analysis by allowing +practitioners to examine the effect of varying exposure levels, including +those not directly observed in the dataset.</p> + </div> <div class="section level2"> <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> diff --git a/docs/reference/estimate_cerf_nngp.html b/docs/reference/estimate_cerf_nngp.html index b7cb24a..24c2fe4 100644 --- a/docs/reference/estimate_cerf_nngp.html +++ b/docs/reference/estimate_cerf_nngp.html @@ -16,7 +16,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> @@ -95,7 +95,8 @@ <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#argumen <dt>w</dt> -<dd><p>A vector of exposure level to compute CERF.</p></dd> +<dd><p>A vector of exposure level to compute CERF (please also see the +notes).</p></dd> <dt>gps_m</dt> @@ -153,6 +154,19 @@ <h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2 <li><p>pst_mean, the computed mean for the w vector.</p></li> <li><p>pst_sd, the computed credible interval for the w vector.</p></li> </ul></div> + <div class="section level2"> + <h2 id="note">Note<a class="anchor" aria-label="anchor" href="#note"></a></h2> + <p>Please note that <code>w</code> is a vector representing a grid of exposure levels at +which the CERF is to be estimated. This grid can include both observed and +hypothetical values of the exposure variable. The purpose of defining this +grid is to provide a structured set of points across the exposure spectrum +for estimating the CERF. This approach is essential in nonparametric models +like Gaussian Processes (GPs), where the CERF is evaluated at specific points +to understand the relationship between the exposure and outcome variables +across a continuum. It facilitates a comprehensive analysis by allowing +practitioners to examine the effect of varying exposure levels, including +those not directly observed in the dataset.</p> + </div> <div class="section level2"> <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> diff --git a/docs/reference/estimate_gps.html b/docs/reference/estimate_gps.html index f6fffa2..27140e9 100644 --- a/docs/reference/estimate_gps.html +++ b/docs/reference/estimate_gps.html @@ -12,7 +12,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/estimate_mean_sd_nn.html b/docs/reference/estimate_mean_sd_nn.html index 511c588..ae20878 100644 --- a/docs/reference/estimate_mean_sd_nn.html +++ b/docs/reference/estimate_mean_sd_nn.html @@ -12,7 +12,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/estimate_noise_gp.html b/docs/reference/estimate_noise_gp.html index b016908..e01f594 100644 --- a/docs/reference/estimate_noise_gp.html +++ b/docs/reference/estimate_noise_gp.html @@ -14,7 +14,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/estimate_noise_nn.html b/docs/reference/estimate_noise_nn.html index c2807ad..943cb5a 100644 --- a/docs/reference/estimate_noise_nn.html +++ b/docs/reference/estimate_noise_nn.html @@ -12,7 +12,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> @@ -103,12 +103,12 @@ <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#argumen <dd><p>A number of nearest neighbors on one side.</p></dd> -<dt>kernel_fn</dt> -<dd><p>The covariance function of the GP.</p></dd> +<dt>nthread</dt> +<dd><p>A number of cores used in the estimation.</p></dd> -<dt>n_thread</dt> -<dd><p>A number of cores used in the estimation.</p></dd> +<dt>kernel_fn</dt> +<dd><p>The covariance function of the GP.</p></dd> </dl></div> <div class="section level2"> diff --git a/docs/reference/figures/png/readme_gp.png b/docs/reference/figures/png/readme_gp.png index ca4d8e1..6b81b13 100644 Binary files a/docs/reference/figures/png/readme_gp.png and b/docs/reference/figures/png/readme_gp.png differ diff --git a/docs/reference/figures/png/readme_nngp.png b/docs/reference/figures/png/readme_nngp.png index f1076e5..8754342 100644 Binary files a/docs/reference/figures/png/readme_nngp.png and b/docs/reference/figures/png/readme_nngp.png differ diff --git a/docs/reference/find_optimal_nn.html b/docs/reference/find_optimal_nn.html index f20e6b3..69abddf 100644 --- a/docs/reference/find_optimal_nn.html +++ b/docs/reference/find_optimal_nn.html @@ -12,7 +12,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/generate_synthetic_data.html b/docs/reference/generate_synthetic_data.html index 5c79ba2..6402b24 100644 --- a/docs/reference/generate_synthetic_data.html +++ b/docs/reference/generate_synthetic_data.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/get_logger.html b/docs/reference/get_logger.html index 9038e9a..3718091 100644 --- a/docs/reference/get_logger.html +++ b/docs/reference/get_logger.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/index.html b/docs/reference/index.html index 3cc8042..1778d7f 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/log_system_info.html b/docs/reference/log_system_info.html index f540e94..9695777 100644 --- a/docs/reference/log_system_info.html +++ b/docs/reference/log_system_info.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/plot.cerf_gp.html b/docs/reference/plot.cerf_gp.html index 76f988c..2fadae2 100644 --- a/docs/reference/plot.cerf_gp.html +++ b/docs/reference/plot.cerf_gp.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/plot.cerf_nngp.html b/docs/reference/plot.cerf_nngp.html index ca867cf..78327dc 100644 --- a/docs/reference/plot.cerf_nngp.html +++ b/docs/reference/plot.cerf_nngp.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/print.cerf_gp.html b/docs/reference/print.cerf_gp.html index 85488dd..447d958 100644 --- a/docs/reference/print.cerf_gp.html +++ b/docs/reference/print.cerf_gp.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/print.cerf_nngp.html b/docs/reference/print.cerf_nngp.html index 3f93f80..5af3878 100644 --- a/docs/reference/print.cerf_nngp.html +++ b/docs/reference/print.cerf_nngp.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/set_logger.html b/docs/reference/set_logger.html index 0aeac62..12eef52 100644 --- a/docs/reference/set_logger.html +++ b/docs/reference/set_logger.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/summary.cerf_gp.html b/docs/reference/summary.cerf_gp.html index 267356a..dc25970 100644 --- a/docs/reference/summary.cerf_gp.html +++ b/docs/reference/summary.cerf_gp.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/reference/summary.cerf_nngp.html b/docs/reference/summary.cerf_nngp.html index 3c94e9b..36769a7 100644 --- a/docs/reference/summary.cerf_nngp.html +++ b/docs/reference/summary.cerf_nngp.html @@ -10,7 +10,7 @@ <a class="navbar-brand me-2" href="../index.html">GPCERF</a> - <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.1.9000</small> + <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">0.2.3</small> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation"> diff --git a/docs/search.json b/docs/search.json index 9e2b210..b1c51ce 100644 --- a/docs/search.json +++ b/docs/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement nkhoshnevis@g.harvard.edu. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU General Public License","title":"GNU General Public License","text":"Version 3, 29 June 2007Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU General Public License","text":"GNU General Public License free, copyleft license software kinds works. licenses software practical works designed take away freedom share change works. contrast, GNU General Public License intended guarantee freedom share change versions program–make sure remains free software users. , Free Software Foundation, use GNU General Public License software; applies also work released way authors. can apply programs, . speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge wish), receive source code can get want , can change software use pieces new free programs, know can things. protect rights, need prevent others denying rights asking surrender rights. Therefore, certain responsibilities distribute copies software, modify : responsibilities respect freedom others. example, distribute copies program, whether gratis fee, must pass recipients freedoms received. must make sure , , receive can get source code. must show terms know rights. Developers use GNU GPL protect rights two steps: (1) assert copyright software, (2) offer License giving legal permission copy, distribute /modify . developers’ authors’ protection, GPL clearly explains warranty free software. users’ authors’ sake, GPL requires modified versions marked changed, problems attributed erroneously authors previous versions. devices designed deny users access install run modified versions software inside , although manufacturer can . fundamentally incompatible aim protecting users’ freedom change software. systematic pattern abuse occurs area products individuals use, precisely unacceptable. Therefore, designed version GPL prohibit practice products. problems arise substantially domains, stand ready extend provision domains future versions GPL, needed protect freedom users. Finally, every program threatened constantly software patents. States allow patents restrict development use software general-purpose computers, , wish avoid special danger patents applied free program make effectively proprietary. prevent , GPL assures patents used render program non-free. precise terms conditions copying, distribution modification follow.","code":""},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_0-definitions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"0. Definitions","title":"GNU General Public License","text":"“License” refers version 3 GNU General Public License. “Copyright” also means copyright-like laws apply kinds works, semiconductor masks. “Program” refers copyrightable work licensed License. licensee addressed “”. “Licensees” “recipients” may individuals organizations. “modify” work means copy adapt part work fashion requiring copyright permission, making exact copy. resulting work called “modified version” earlier work work “based ” earlier work. “covered work” means either unmodified Program work based Program. “propagate” work means anything , without permission, make directly secondarily liable infringement applicable copyright law, except executing computer modifying private copy. Propagation includes copying, distribution (without modification), making available public, countries activities well. “convey” work means kind propagation enables parties make receive copies. Mere interaction user computer network, transfer copy, conveying. interactive user interface displays “Appropriate Legal Notices” extent includes convenient prominently visible feature (1) displays appropriate copyright notice, (2) tells user warranty work (except extent warranties provided), licensees may convey work License, view copy License. interface presents list user commands options, menu, prominent item list meets criterion.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_1-source-code","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"1. Source Code","title":"GNU General Public License","text":"“source code” work means preferred form work making modifications . “Object code” means non-source form work. “Standard Interface” means interface either official standard defined recognized standards body, , case interfaces specified particular programming language, one widely used among developers working language. “System Libraries” executable work include anything, work whole, () included normal form packaging Major Component, part Major Component, (b) serves enable use work Major Component, implement Standard Interface implementation available public source code form. “Major Component”, context, means major essential component (kernel, window system, ) specific operating system () executable work runs, compiler used produce work, object code interpreter used run . “Corresponding Source” work object code form means source code needed generate, install, (executable work) run object code modify work, including scripts control activities. However, include work’s System Libraries, general-purpose tools generally available free programs used unmodified performing activities part work. example, Corresponding Source includes interface definition files associated source files work, source code shared libraries dynamically linked subprograms work specifically designed require, intimate data communication control flow subprograms parts work. Corresponding Source need include anything users can regenerate automatically parts Corresponding Source. Corresponding Source work source code form work.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_2-basic-permissions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"2. Basic Permissions","title":"GNU General Public License","text":"rights granted License granted term copyright Program, irrevocable provided stated conditions met. License explicitly affirms unlimited permission run unmodified Program. output running covered work covered License output, given content, constitutes covered work. License acknowledges rights fair use equivalent, provided copyright law. may make, run propagate covered works convey, without conditions long license otherwise remains force. may convey covered works others sole purpose make modifications exclusively , provide facilities running works, provided comply terms License conveying material control copyright. thus making running covered works must exclusively behalf, direction control, terms prohibit making copies copyrighted material outside relationship . Conveying circumstances permitted solely conditions stated . Sublicensing allowed; section 10 makes unnecessary.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_3-protecting-users-legal-rights-from-anti-circumvention-law","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"3. Protecting Users’ Legal Rights From Anti-Circumvention Law","title":"GNU General Public License","text":"covered work shall deemed part effective technological measure applicable law fulfilling obligations article 11 WIPO copyright treaty adopted 20 December 1996, similar laws prohibiting restricting circumvention measures. convey covered work, waive legal power forbid circumvention technological measures extent circumvention effected exercising rights License respect covered work, disclaim intention limit operation modification work means enforcing, work’s users, third parties’ legal rights forbid circumvention technological measures.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_4-conveying-verbatim-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"4. Conveying Verbatim Copies","title":"GNU General Public License","text":"may convey verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice; keep intact notices stating License non-permissive terms added accord section 7 apply code; keep intact notices absence warranty; give recipients copy License along Program. may charge price price copy convey, may offer support warranty protection fee.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_5-conveying-modified-source-versions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"5. Conveying Modified Source Versions","title":"GNU General Public License","text":"may convey work based Program, modifications produce Program, form source code terms section 4, provided also meet conditions: ) work must carry prominent notices stating modified , giving relevant date. b) work must carry prominent notices stating released License conditions added section 7. requirement modifies requirement section 4 “keep intact notices”. c) must license entire work, whole, License anyone comes possession copy. License therefore apply, along applicable section 7 additional terms, whole work, parts, regardless packaged. License gives permission license work way, invalidate permission separately received . d) work interactive user interfaces, must display Appropriate Legal Notices; however, Program interactive interfaces display Appropriate Legal Notices, work need make . compilation covered work separate independent works, nature extensions covered work, combined form larger program, volume storage distribution medium, called “aggregate” compilation resulting copyright used limit access legal rights compilation’s users beyond individual works permit. Inclusion covered work aggregate cause License apply parts aggregate.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_6-conveying-non-source-forms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"6. Conveying Non-Source Forms","title":"GNU General Public License","text":"may convey covered work object code form terms sections 4 5, provided also convey machine-readable Corresponding Source terms License, one ways: ) Convey object code , embodied , physical product (including physical distribution medium), accompanied Corresponding Source fixed durable physical medium customarily used software interchange. b) Convey object code , embodied , physical product (including physical distribution medium), accompanied written offer, valid least three years valid long offer spare parts customer support product model, give anyone possesses object code either (1) copy Corresponding Source software product covered License, durable physical medium customarily used software interchange, price reasonable cost physically performing conveying source, (2) access copy Corresponding Source network server charge. c) Convey individual copies object code copy written offer provide Corresponding Source. alternative allowed occasionally noncommercially, received object code offer, accord subsection 6b. d) Convey object code offering access designated place (gratis charge), offer equivalent access Corresponding Source way place charge. need require recipients copy Corresponding Source along object code. place copy object code network server, Corresponding Source may different server (operated third party) supports equivalent copying facilities, provided maintain clear directions next object code saying find Corresponding Source. Regardless server hosts Corresponding Source, remain obligated ensure available long needed satisfy requirements. e) Convey object code using peer--peer transmission, provided inform peers object code Corresponding Source work offered general public charge subsection 6d. separable portion object code, whose source code excluded Corresponding Source System Library, need included conveying object code work. “User Product” either (1) “consumer product”, means tangible personal property normally used personal, family, household purposes, (2) anything designed sold incorporation dwelling. determining whether product consumer product, doubtful cases shall resolved favor coverage. particular product received particular user, “normally used” refers typical common use class product, regardless status particular user way particular user actually uses, expects expected use, product. product consumer product regardless whether product substantial commercial, industrial non-consumer uses, unless uses represent significant mode use product. “Installation Information” User Product means methods, procedures, authorization keys, information required install execute modified versions covered work User Product modified version Corresponding Source. information must suffice ensure continued functioning modified object code case prevented interfered solely modification made. convey object code work section , , specifically use , User Product, conveying occurs part transaction right possession use User Product transferred recipient perpetuity fixed term (regardless transaction characterized), Corresponding Source conveyed section must accompanied Installation Information. requirement apply neither third party retains ability install modified object code User Product (example, work installed ROM). requirement provide Installation Information include requirement continue provide support service, warranty, updates work modified installed recipient, User Product modified installed. Access network may denied modification materially adversely affects operation network violates rules protocols communication across network. Corresponding Source conveyed, Installation Information provided, accord section must format publicly documented (implementation available public source code form), must require special password key unpacking, reading copying.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_7-additional-terms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"7. Additional Terms","title":"GNU General Public License","text":"“Additional permissions” terms supplement terms License making exceptions one conditions. Additional permissions applicable entire Program shall treated though included License, extent valid applicable law. additional permissions apply part Program, part may used separately permissions, entire Program remains governed License without regard additional permissions. convey copy covered work, may option remove additional permissions copy, part . (Additional permissions may written require removal certain cases modify work.) may place additional permissions material, added covered work, can give appropriate copyright permission. Notwithstanding provision License, material add covered work, may (authorized copyright holders material) supplement terms License terms: ) Disclaiming warranty limiting liability differently terms sections 15 16 License; b) Requiring preservation specified reasonable legal notices author attributions material Appropriate Legal Notices displayed works containing ; c) Prohibiting misrepresentation origin material, requiring modified versions material marked reasonable ways different original version; d) Limiting use publicity purposes names licensors authors material; e) Declining grant rights trademark law use trade names, trademarks, service marks; f) Requiring indemnification licensors authors material anyone conveys material (modified versions ) contractual assumptions liability recipient, liability contractual assumptions directly impose licensors authors. non-permissive additional terms considered “restrictions” within meaning section 10. Program received , part , contains notice stating governed License along term restriction, may remove term. license document contains restriction permits relicensing conveying License, may add covered work material governed terms license document, provided restriction survive relicensing conveying. add terms covered work accord section, must place, relevant source files, statement additional terms apply files, notice indicating find applicable terms. Additional terms, permissive non-permissive, may stated form separately written license, stated exceptions; requirements apply either way.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_8-termination","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"8. Termination","title":"GNU General Public License","text":"may propagate modify covered work except expressly provided License. attempt otherwise propagate modify void, automatically terminate rights License (including patent licenses granted third paragraph section 11). However, cease violation License, license particular copyright holder reinstated () provisionally, unless copyright holder explicitly finally terminates license, (b) permanently, copyright holder fails notify violation reasonable means prior 60 days cessation. Moreover, license particular copyright holder reinstated permanently copyright holder notifies violation reasonable means, first time received notice violation License (work) copyright holder, cure violation prior 30 days receipt notice. Termination rights section terminate licenses parties received copies rights License. rights terminated permanently reinstated, qualify receive new licenses material section 10.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_9-acceptance-not-required-for-having-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"9. Acceptance Not Required for Having Copies","title":"GNU General Public License","text":"required accept License order receive run copy Program. Ancillary propagation covered work occurring solely consequence using peer--peer transmission receive copy likewise require acceptance. However, nothing License grants permission propagate modify covered work. actions infringe copyright accept License. Therefore, modifying propagating covered work, indicate acceptance License .","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_10-automatic-licensing-of-downstream-recipients","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"10. Automatic Licensing of Downstream Recipients","title":"GNU General Public License","text":"time convey covered work, recipient automatically receives license original licensors, run, modify propagate work, subject License. responsible enforcing compliance third parties License. “entity transaction” transaction transferring control organization, substantially assets one, subdividing organization, merging organizations. propagation covered work results entity transaction, party transaction receives copy work also receives whatever licenses work party’s predecessor interest give previous paragraph, plus right possession Corresponding Source work predecessor interest, predecessor can get reasonable efforts. may impose restrictions exercise rights granted affirmed License. example, may impose license fee, royalty, charge exercise rights granted License, may initiate litigation (including cross-claim counterclaim lawsuit) alleging patent claim infringed making, using, selling, offering sale, importing Program portion .","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_11-patents","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"11. Patents","title":"GNU General Public License","text":"“contributor” copyright holder authorizes use License Program work Program based. work thus licensed called contributor’s “contributor version”. contributor’s “essential patent claims” patent claims owned controlled contributor, whether already acquired hereafter acquired, infringed manner, permitted License, making, using, selling contributor version, include claims infringed consequence modification contributor version. purposes definition, “control” includes right grant patent sublicenses manner consistent requirements License. contributor grants non-exclusive, worldwide, royalty-free patent license contributor’s essential patent claims, make, use, sell, offer sale, import otherwise run, modify propagate contents contributor version. following three paragraphs, “patent license” express agreement commitment, however denominated, enforce patent (express permission practice patent covenant sue patent infringement). “grant” patent license party means make agreement commitment enforce patent party. convey covered work, knowingly relying patent license, Corresponding Source work available anyone copy, free charge terms License, publicly available network server readily accessible means, must either (1) cause Corresponding Source available, (2) arrange deprive benefit patent license particular work, (3) arrange, manner consistent requirements License, extend patent license downstream recipients. “Knowingly relying” means actual knowledge , patent license, conveying covered work country, recipient’s use covered work country, infringe one identifiable patents country reason believe valid. , pursuant connection single transaction arrangement, convey, propagate procuring conveyance , covered work, grant patent license parties receiving covered work authorizing use, propagate, modify convey specific copy covered work, patent license grant automatically extended recipients covered work works based . patent license “discriminatory” include within scope coverage, prohibits exercise , conditioned non-exercise one rights specifically granted License. may convey covered work party arrangement third party business distributing software, make payment third party based extent activity conveying work, third party grants, parties receive covered work , discriminatory patent license () connection copies covered work conveyed (copies made copies), (b) primarily connection specific products compilations contain covered work, unless entered arrangement, patent license granted, prior 28 March 2007. Nothing License shall construed excluding limiting implied license defenses infringement may otherwise available applicable patent law.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_12-no-surrender-of-others-freedom","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"12. No Surrender of Others’ Freedom","title":"GNU General Public License","text":"conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. convey covered work satisfy simultaneously obligations License pertinent obligations, consequence may convey . example, agree terms obligate collect royalty conveying convey Program, way satisfy terms License refrain entirely conveying Program.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_13-use-with-the-gnu-affero-general-public-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"13. Use with the GNU Affero General Public License","title":"GNU General Public License","text":"Notwithstanding provision License, permission link combine covered work work licensed version 3 GNU Affero General Public License single combined work, convey resulting work. terms License continue apply part covered work, special requirements GNU Affero General Public License, section 13, concerning interaction network apply combination .","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_14-revised-versions-of-this-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"14. Revised Versions of this License","title":"GNU General Public License","text":"Free Software Foundation may publish revised /new versions GNU General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies certain numbered version GNU General Public License “later version” applies , option following terms conditions either numbered version later version published Free Software Foundation. Program specify version number GNU General Public License, may choose version ever published Free Software Foundation. Program specifies proxy can decide future versions GNU General Public License can used, proxy’s public statement acceptance version permanently authorizes choose version Program. Later license versions may give additional different permissions. However, additional obligations imposed author copyright holder result choosing follow later version.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_15-disclaimer-of-warranty","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"15. Disclaimer of Warranty","title":"GNU General Public License","text":"WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_16-limitation-of-liability","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"16. Limitation of Liability","title":"GNU General Public License","text":"EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MODIFIES /CONVEYS PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_17-interpretation-of-sections-15-and-16","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"17. Interpretation of Sections 15 and 16","title":"GNU General Public License","text":"disclaimer warranty limitation liability provided given local legal effect according terms, reviewing courts shall apply local law closely approximates absolute waiver civil liability connection Program, unless warranty assumption liability accompanies copy Program return fee. END TERMS CONDITIONS","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"how-to-apply-these-terms-to-your-new-programs","dir":"","previous_headings":"","what":"How to Apply These Terms to Your New Programs","title":"GNU General Public License","text":"develop new program, want greatest possible use public, best way achieve make free software everyone can redistribute change terms. , attach following notices program. safest attach start source file effectively state exclusion warranty; file least “copyright” line pointer full notice found. Also add information contact electronic paper mail. program terminal interaction, make output short notice like starts interactive mode: hypothetical commands show w show c show appropriate parts General Public License. course, program’s commands might different; GUI interface, use “box”. also get employer (work programmer) school, , sign “copyright disclaimer” program, necessary. information , apply follow GNU GPL, see <http://www.gnu.org/licenses/>. GNU General Public License permit incorporating program proprietary programs. program subroutine library, may consider useful permit linking proprietary applications library. want , use GNU Lesser General Public License instead License. first, please read <http://www.gnu.org/philosophy/--lgpl.html>.","code":"<one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. <program> Copyright (C) <year> <name of author> This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details."},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"environment-setup","dir":"Articles","previous_headings":"","what":"Environment Setup","title":"Developers Guide","text":"contribute project, ’s recommended local copy GPCERF Github account. result, please fork project. open terminal (Gitbash Windows, Anaconda prompt, …) run following command (brackets included): haven’t already, generate SSH key. Learn . Now, can modify codebase track changes. Consider creating new branch work codebase. Refer following instructions git branching.","code":"git clone git@github.com:[your user name]/GPCERF.git"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"git-branching-model","dir":"Articles","previous_headings":"","what":"Git Branching Model","title":"Developers Guide","text":"can choose branch name personal repository, maintaining consistency understanding ’s working crucial. project, follow convention proposed Vincent Driessen successful Git branching model post. summary branches: main: main branch hosts released software packages. project maintainers write access master branch. develop: develop branch serves primary branch, source code HEAD always reflecting latest delivered development changes next release. feature: start new feature branch add new features software. naming convention iss[issue_number]_short_description. example, need add unittest one functions package issue number 12, iss12_add_unittest can valid git branch name. start issue number go back take look issue details necessary. Although feature branches temporary, naming convention helps developers understand situation working codebase. working features open issue , please open issue assign . can also make comment working . hotfix: hotfix branches used fixing bug released package. fixing bug, third digit version number incremented one. example, 2.3.5 –> 2.3.6. branches prefixed hotfix followed upcoming version number (e.g., case, hotfix_2.3.6) release: Release branches support preparation new production release.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"where-to-submit-pull-requests","dir":"Articles","previous_headings":"","what":"Where to submit pull requests?","title":"Developers Guide","text":"Submit pull requests base repository: NSAPH-Software/GPCERF base: develop branch.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"pull-request-checklist","dir":"Articles","previous_headings":"","what":"Pull request checklist","title":"Developers Guide","text":"Please run devtools::document(), devtools::load_all() final modifications. Make sure modified code passes checks tests (can run devtools::check() RStudio) PR pass CI merging. Add line(s) modification NEWS.md file. adding new features, please make sure appropriate documentation added updated. Please clean white spaces. Read .","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"reporting-bugs","dir":"Articles","previous_headings":"","what":"Reporting bugs","title":"Developers Guide","text":"Please report potential bugs creating new issue sending us email. Please include following information bug report: brief description , expected happen, happened. OS using whether using personal computer HPC cluster. version package installed.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"style-guide","dir":"Articles","previous_headings":"","what":"Style Guide","title":"Developers Guide","text":"project, follow tidyverse style guide.","code":""},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"names","dir":"Articles","previous_headings":"Style Guide > Summary","what":"Names","title":"Developers Guide","text":"File names snake_case ends .R (e.g., create_matching.R) variable names small letter separate _ need (e.g., delta_n) Function names follow snake_case style (e.g., generate_data) Function names follow verb+output convention (e.g., compute_resid)","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"spaces-and-indentation","dir":"Articles","previous_headings":"Style Guide > Summary","what":"Spaces and Indentation","title":"Developers Guide","text":"Indentations two spaces (use tab) Place space around binary operators (e.g., x + y) Place space comma Place space # commenting avoid multiple ### put space opening closing parenthesis Place space () used , , .","code":"#Acceptable: z <- x + y #Not recommended: z<-x+y # (no space) z<- x+y z<-x +y #Acceptable: a <- matrix(c(1:100), nrow = 5) #Not recommended: a <- matrix(c(1:100),nrow = 5) # (no space after comma) a <- matrix( c(1:100), nrow = 5 ) # (extra space after and before parentheses) a<-matrix(c(1:100), nrow = 5) # (no space around unary operator <- ) #Acceptable: # This is a comment #Not recommended: #This is a comment # This is a comment (more than one space after #) ## This is a comment (multiple #) ### This is a comment (multiple # and more than one space) #Acceptable: x <- (z + y) #Not recommended: x <- ( z + y ) # (unnecessary space) x <- (z + y ) x <- ( z + y) #Acceptible if (x > 2) { print(x) } # Not recommended if(x > 2){ print(x) }"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"other-notes","dir":"Articles","previous_headings":"Style Guide > Summary","what":"Other notes","title":"Developers Guide","text":"Maximum line length 80 character Use explicit returns Use explicit tags documentation (e.g., @title, @description, …)","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"notes-on-superlearner","dir":"Articles","previous_headings":"","what":"Notes on SuperLearner","title":"Developers Guide","text":"package create customized wrapper SuperLearner internal libraries. Please read Notes SL Wrappers details.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"logger","dir":"Articles","previous_headings":"","what":"Logger","title":"Developers Guide","text":"Use logger examine internal process. default, level set “INFO”, writing messages “GPCERF.log” file. change log file location level, use update_logger function.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Full-Gaussian-Processes.html","id":"generate-synthetic-data","dir":"Articles","previous_headings":"","what":"Generate Synthetic Data","title":"Standard Gaussian Processes","text":"first generate synthetic dataset six covariates, one continuous exposure one outcome. consider two types conditional distributions (normal student’s t) exposure given covariates. details synthetic data generation, see document. use function tru_R derive actual ERF population w=seq(0,20,0.1).","code":"set.seed(134) # Generate dataset with a normally distributed exposure given covariates data_sim_normal <- generate_synthetic_data(sample_size = 400, outcome_sd = 10, gps_spec = 1) # Generate dataset with a t-distributed with 2df exposure given covariates data_sim_t <- generate_synthetic_data(sample_size = 400, outcome_sd = 10, gps_spec = 2) tru_R <- function(w, sim_data) { design_mt <- model.matrix(~cf1 + cf2 + cf3 + cf4 + cf5 + cf6 - 1, data = sim_data) mean(apply(design_mt, 1, function(x) { -10 - sum(c(2, 2, 3, -1, 2, 2) * x) - w * (0.1 - 0.1 * x[1] + 0.1 * x[4] + 0.1 * x[5] + 0.1 * x[3] ^ 2) + 0.13 ^ 2 * w ^ 3 })) } plot_fun <- function(object, ...) { # extract data tmp_data <- data.frame(w_vals = object$posterior$w, mean_vals = object$posterior$mean, sd_vals = object$posterior$sd) g1 <- ggplot2::ggplot(tmp_data) + ggplot2::geom_ribbon(ggplot2::aes(.data$w_vals, y = .data$mean_vals, ymin = .data$mean_vals - 1.96 * .data$sd_vals, ymax = .data$mean_vals + 1.96 * .data$sd_vals), fill = \"blue\", alpha = 0.25) + ggplot2::geom_line(ggplot2::aes(.data$w_vals, .data$mean_vals), color = \"blue\", size = 1) + ggplot2::theme_bw() + ggplot2::ggtitle(\"Estimated CERF (gp) with credible band (1.96sd)\") + ggplot2::xlab(\"Exposure level\") + ggplot2::ylab(\"Population average counterfactual outcome\") return(g1) } erf_tru_normal <- sapply(seq(0, 20, 0.1), function(w) tru_R(w, data_sim_normal)) erf_tru_t <- sapply(seq(0, 20, 0.1), function(w) tru_R(w, data_sim_t))"},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Full-Gaussian-Processes.html","id":"train-gps-model","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"Train GPS Model","title":"Standard Gaussian Processes","text":"GPCERF first convert covariate values single composite score (GPS) use fit Gaussian processes. use GPS estimation function CasaulGPS (see ) get GPS model maps covariates GPS. use estimate_cerf_gp estimate ERF exposure w. estimate ERF w = seq(0,20,0.1). estimated ERF well pointwise 95% credible band visualized call plot. also plot actual ERF top estimated ERF.","code":"gps_m_normal <- estimate_gps(cov_mt = data_sim_normal[, -(1:2)], w_all = data_sim_normal$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) #> Loading required package: nnls gps_m_t <- estimate_gps(cov_mt = data_sim_t[, -(1:2)], w_all = data_sim_t$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Full-Gaussian-Processes.html","id":"normally-distributed-exposure","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"Normally Distributed Exposure","title":"Standard Gaussian Processes","text":"can see estimated curve follows true ERF closely 95% credible band completely covers true ERF.","code":"w_all <- seq(0, 20, 0.1) gp_res_normal <- estimate_cerf_gp(data_sim_normal, w_all, gps_m_normal, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, tune_app = \"all\"), nthread = 1) plot_fun(gp_res_normal) + geom_line(data = data.frame(w = w_all, y = erf_tru_normal), aes(x = w, y = y, color = \"True\"), size = 1.5) #> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. #> ℹ Please use `linewidth` instead. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was #> generated."},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Full-Gaussian-Processes.html","id":"t-distributed-exposure","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"T-distributed Exposure","title":"Standard Gaussian Processes","text":"results look similar case exposure normally distributed. difference might exposure t-distributed, estimated curve tends less smooth.","code":"gp_res_t <- estimate_cerf_gp(data_sim_t, w_all, gps_m_t, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, tune_app = \"all\"), nthread = 1) plot_fun(gp_res_t) + geom_line(data = data.frame(w = w_all, y = erf_tru_t), aes(x = w, y = y, color = \"True\"), size = 1.5)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/GPCERF.html","id":"installation","dir":"Articles","previous_headings":"","what":"Installation","title":"GPCERF","text":"","code":"library(\"devtools\") install_github(\"NSAPH-Software/GPCERF\", ref = \"main\") library(\"GPCERF\")"},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/GPCERF.html","id":"estimating-gps-values","dir":"Articles","previous_headings":"Usage","what":"Estimating GPS values","title":"GPCERF","text":"Input parameters: cov_mt Covariate matrix containing covariates. row represents sample, column covariate.w_all vector observed exposure level.","code":"mydata <- generate_synthetic_data() gps_m <- estimate_gps(cov_mt = mydata[, c(\"cf1\", \"cf2\", \"cf3\", \"cf4\", \"cf5\", \"cf6\")], w_all = mydata$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) #> Loading required package: nnls"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/GPCERF.html","id":"estimating-exposure-response-using-gaussian-processes","dir":"Articles","previous_headings":"Usage","what":"Estimating exposure response using Gaussian Processes","title":"GPCERF","text":"Input parameters: data data.frame observation data. - Column 1: Outcome (Y) - Column 2: Exposure treatment (w) - Column 3~m: Confounders (C)w vector exposure level compute CERF.gps_m data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred) - Column 3: Standard deviation e_gps (e_gps_std)params list parameters required run process. - alpha: scaling factor GPS value. - beta: scaling factor exposure value. - g_sigma: scaling factor kernel function (gamma/sigma). - tune_app: tuning approach. Available approaches: - : try combinations hyperparameters. alpha, beta, g_sigma can vector parameters. nthread integer value represents number threads used shared memory system.kernel_fn kernel function. default value Gaussian kernel.","code":"set.seed(129) sim_data <- generate_synthetic_data(sample_size = 400, gps_spec = 3) # Estimate GPS function gps_m <- estimate_gps(cov_mt = sim_data[, -(1:2)], w_all = sim_data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = TRUE) # exposure values q1 <- stats::quantile(sim_data$treat, 0.05) q2 <- stats::quantile(sim_data$treat, 0.95) w_all <- seq(q1, q2, 1) params_lst <- list(alpha = c(0.05), beta = c(12), g_sigma = c(0.1), tune_app = \"all\") cerf_gp_obj <- estimate_cerf_gp(sim_data, w_all, gps_m, params = params_lst, outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) summary(cerf_gp_obj) #> GPCERF standard Gaussian grocess exposure response function object #> #> Optimal hyper parameters(#trial: 1): #> alpha = 0.05 beta = 12 g_sigma = 0.1 #> #> Optimal covariate balance: #> cf1 = 0.080 #> cf2 = 0.081 #> cf3 = 0.111 #> cf4 = 0.119 #> cf5 = 0.084 #> cf6 = 0.104 #> #> Original covariate balance: #> cf1 = 0.185 #> cf2 = 0.161 #> cf3 = 0.106 #> cf4 = 0.208 #> cf5 = 0.246 #> cf6 = 0.283 #> ----***---- plot(cerf_gp_obj)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/GPCERF.html","id":"estimating-exposure-response-using-nearest-neighbor-gaussian-processes","dir":"Articles","previous_headings":"Usage","what":"Estimating exposure response using nearest-neighbor Gaussian Processes","title":"GPCERF","text":"Input parameters: data data.frame observation data.w vector exposure level compute CERF.gps_m data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred) - Column 3: Standard deviation e_gps (e_gps_std)params list parameters required run process. - alpha: scaling factor GPS value. - beta: scaling factor exposure value. - g_sigma: scaling factor kernel function (gamma/sigma). - tune_app: tuning approach. Available approaches: - : try combinations hyperparameters. - n_neighbors: Number nearest neighbors one side. - block_size: Number samples included computation block. Mainly used balance speed memory requirement. Larger faster, requires memory. alpha, beta, g_sigma can vector parameters. outcome_col outcome column name data. treatment_col treatment column name data. covariates_col Covariates columns name data. nthread integer value represents number threads used shared memory system.kernel_fn kernel function. default value Gaussian kernel.","code":"set.seed(19) sim_data <- generate_synthetic_data(sample_size = 1000, gps_spec = 3) # Estimate GPS function gps_m <- estimate_gps(cov_mt = sim_data[, -(1:2)], w_all = sim_data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = TRUE) # exposure values q1 <- stats::quantile(sim_data$treat, 0.05) q2 <- stats::quantile(sim_data$treat, 0.95) w_all <- seq(q1, q2, 1) params_lst <- list(alpha = c(0.05), beta = c(12), g_sigma = c(0.1), tune_app = \"all\", n_neighbor = 20, block_size = 1e4) cerf_nngp_obj <- estimate_cerf_nngp(sim_data, w_all, gps_m, params = params_lst, outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) summary(cerf_nngp_obj) #> GPCERF nearest neighbore Gaussian process exposure response function object summary #> #> Optimal hyper parameters(#trial: 1): #> alpha = 0.05 beta = 12 g_sigma = 0.1 #> #> Optimal covariate balance: #> cf1 = 0.118 #> cf2 = 0.103 #> cf3 = 0.105 #> cf4 = 0.089 #> cf5 = 0.159 #> cf6 = 0.149 #> #> Original covariate balance: #> cf1 = 0.136 #> cf2 = 0.148 #> cf3 = 0.105 #> cf4 = 0.228 #> cf5 = 0.184 #> cf6 = 0.280 #> ----***---- plot(cerf_nngp_obj)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/GPCERF.html","id":"logging","dir":"Articles","previous_headings":"Usage","what":"Logging","title":"GPCERF","text":"GPCERF package logs internal activities screen GPCERF.log file. Users can change logging file name (path) logging threshold. logging mechanism different thresholds (see logger package). two important thresholds INFO DEBUG levels. former, default level, logs general information process. latter, activated, logs detailed information can used debugging purposes. log file located source file location appended.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Nearest-neighbor-Gaussian-Processes.html","id":"generate-synthetic-data","dir":"Articles","previous_headings":"","what":"Generate Synthetic Data","title":"Nearest-neighbor Gaussian Processes","text":"first generate synthetic dataset six covariates, one continuous exposure one outcome. consider two types conditional distributions (normal student’s t) exposure given covariates. details synthetic data generation, see document. use function tru_R derive actual ERF population w=seq(0,20,0.1).","code":"set.seed(1) # Generate dataset with a normally distributed exposure given covariates data_sim_normal <- generate_synthetic_data(sample_size = 500, outcome_sd = 10, gps_spec = 1) # Generate dataset with a t-distributed with 2df exposure given covariates data_sim_t <- generate_synthetic_data(sample_size = 500, outcome_sd = 10, gps_spec = 2) tru_R <- function(w, sim_data) { design_mt <- model.matrix(~cf1 + cf2 + cf3 + cf4 + cf5 + cf6 - 1, data = sim_data) mean(apply(design_mt, 1, function(x) { -10 - sum(c(2, 2, 3, -1, 2, 2) * x) - w * (0.1 - 0.1 * x[1] + 0.1 * x[4] + 0.1 * x[5] + 0.1 * x[3] ^ 2) + 0.13 ^ 2 * w ^ 3 })) } plot_fun <- function(object, ...) { tmp_data <- data.frame(w_vals = object$posterior$w, mean_vals = object$posterior$mean, sd_vals = object$posterior$sd) g1 <- ggplot2::ggplot(tmp_data) + ggplot2::geom_ribbon(ggplot2::aes(.data$w_vals, y = .data$mean_vals, ymin = .data$mean_vals - 1.96 * .data$sd_vals, ymax = .data$mean_vals + 1.96 * .data$sd_vals), fill = \"#FC4E07\", alpha = 0.25) + ggplot2::geom_line(ggplot2::aes(.data$w_vals, .data$mean_vals), color = \"#FC4E07\", size = 1) + ggplot2::theme_bw() + ggplot2::ggtitle(\"Estimated CERF (nngp) with credible band (1.96sd)\") + ggplot2::xlab(\"Exposure level\") + ggplot2::ylab(\"Population average counterfactual outcome\") return(g1) } erf_tru_normal <- sapply(seq(0, 20, 0.1), function(w) tru_R(w, data_sim_normal)) erf_tru_t <- sapply(seq(0, 20, 0.1), function(w) tru_R(w, data_sim_t))"},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Nearest-neighbor-Gaussian-Processes.html","id":"train-gps-model","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"Train GPS Model","title":"Nearest-neighbor Gaussian Processes","text":"GPCERF first convert covariate values single composite score (GPS) use fit Gaussian processes. use GPS estimation function CausalGPS (see ) get GPS model maps covariates GPS. use estimate_cerf_nngp estimate ERF exposure w. estimate ERF w = seq(0,20,0.1). estimated ERF well pointwise 95% credible band visualized call plot. also plot actual ERF top estimated ERF.","code":"gps_m_normal <- estimate_gps(cov_mt = data_sim_normal[, -(1:2)], w_all = data_sim_normal$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) #> Loading required package: nnls gps_m_t <- estimate_gps(cov_mt = data_sim_t[, -(1:2)], w_all = data_sim_t$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Nearest-neighbor-Gaussian-Processes.html","id":"normally-distributed-exposure","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"Normally Distributed Exposure","title":"Nearest-neighbor Gaussian Processes","text":"can see estimated curve follows true ERF closely 95% credible band completely covers true ERF. running time much smaller standard GP approach.","code":"w_all <- seq(0, 20, 0.1) nngp_res_normal <- estimate_cerf_nngp(data_sim_normal, w_all, gps_m_normal, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, n_neighbor = 20, block_size = 50, tune_app = \"all\"), outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) plot_fun(nngp_res_normal) + geom_line(data = data.frame(w = w_all, y = erf_tru_normal), aes(x = w, y = y, color = \"True\"), size = 1.5) #> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. #> ℹ Please use `linewidth` instead. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was #> generated."},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Nearest-neighbor-Gaussian-Processes.html","id":"t-distributed-exposure","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"T-distributed Exposure","title":"Nearest-neighbor Gaussian Processes","text":"results look similar case exposure normally distributed. difference might exposure t-distributed, estimated curve tends less smooth.","code":"nngp_res_t <- estimate_cerf_nngp(data_sim_t, w_all, gps_m_t, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, n_neighbor = 20, block_size = 50, tune_app = \"all\"), outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) plot_fun(nngp_res_t) + geom_line(data = data.frame(w = w_all, y = erf_tru_t), aes(x = w, y = y, color = \"True\"), size = 1.5)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Standard-Gaussian-Processes.html","id":"generate-synthetic-data","dir":"Articles","previous_headings":"","what":"Generate Synthetic Data","title":"Standard Gaussian Processes","text":"first generate synthetic dataset six covariates, one continuous exposure one outcome. consider two types conditional distributions (normal student’s t) exposure given covariates. details synthetic data generation, see document. use function tru_R derive actual ERF population w=seq(0,20,0.1).","code":"set.seed(134) # Generate dataset with a normally distributed exposure given covariates data_sim_normal <- generate_synthetic_data(sample_size = 400, outcome_sd = 10, gps_spec = 1) # Generate dataset with a t-distributed with 2df exposure given covariates data_sim_t <- generate_synthetic_data(sample_size = 400, outcome_sd = 10, gps_spec = 2) tru_R <- function(w, sim_data) { design_mt <- model.matrix(~cf1 + cf2 + cf3 + cf4 + cf5 + cf6 - 1, data = sim_data) mean(apply(design_mt, 1, function(x) { -10 - sum(c(2, 2, 3, -1, 2, 2) * x) - w * (0.1 - 0.1 * x[1] + 0.1 * x[4] + 0.1 * x[5] + 0.1 * x[3] ^ 2) + 0.13 ^ 2 * w ^ 3 })) } plot_fun <- function(object, ...) { # extract data tmp_data <- data.frame(w_vals = object$posterior$w, mean_vals = object$posterior$mean, sd_vals = object$posterior$sd) g1 <- ggplot2::ggplot(tmp_data) + ggplot2::geom_ribbon(ggplot2::aes(.data$w_vals, y = .data$mean_vals, ymin = .data$mean_vals - 1.96 * .data$sd_vals, ymax = .data$mean_vals + 1.96 * .data$sd_vals), fill = \"blue\", alpha = 0.25) + ggplot2::geom_line(ggplot2::aes(.data$w_vals, .data$mean_vals), color = \"blue\", size = 1) + ggplot2::theme_bw() + ggplot2::ggtitle(\"Estimated CERF (gp) with credible band (1.96sd)\") + ggplot2::xlab(\"Exposure level\") + ggplot2::ylab(\"Population average counterfactual outcome\") return(g1) } erf_tru_normal <- sapply(seq(0, 20, 0.1), function(w) tru_R(w, data_sim_normal)) erf_tru_t <- sapply(seq(0, 20, 0.1), function(w) tru_R(w, data_sim_t))"},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Standard-Gaussian-Processes.html","id":"train-gps-model","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"Train GPS Model","title":"Standard Gaussian Processes","text":"GPCERF first convert covariate values single composite score (GPS) use fit Gaussian processes. use GPS estimation function CausalGPS (see ) get GPS model maps covariates GPS. use estimate_cerf_gp estimate ERF exposure w. estimate ERF w = seq(0,20,0.1). estimated ERF well pointwise 95% credible band visualized call plot. also plot actual ERF top estimated ERF.","code":"gps_m_normal <- estimate_gps(cov_mt = data_sim_normal[, -(1:2)], w_all = data_sim_normal$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) #> Loading required package: nnls gps_m_t <- estimate_gps(cov_mt = data_sim_t[, -(1:2)], w_all = data_sim_t$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Standard-Gaussian-Processes.html","id":"normally-distributed-exposure","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"Normally Distributed Exposure","title":"Standard Gaussian Processes","text":"can see estimated curve follows true ERF closely 95% credible band completely covers true ERF.","code":"w_all <- seq(0, 20, 0.1) gp_res_normal <- estimate_cerf_gp(data_sim_normal, w_all, gps_m_normal, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, tune_app = \"all\"), outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) plot_fun(gp_res_normal) + geom_line(data = data.frame(w = w_all, y = erf_tru_normal), aes(x = w, y = y, color = \"True\"), size = 1.5) #> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. #> ℹ Please use `linewidth` instead. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was #> generated."},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Standard-Gaussian-Processes.html","id":"t-distributed-exposure","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"T-distributed Exposure","title":"Standard Gaussian Processes","text":"results look similar case exposure normally distributed. difference might exposure t-distributed, estimated curve tends less smooth.","code":"gp_res_t <- estimate_cerf_gp(data_sim_t, w_all, gps_m_t, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, tune_app = \"all\"), outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) plot_fun(gp_res_t) + geom_line(data = data.frame(w = w_all, y = erf_tru_t), aes(x = w, y = y, color = \"True\"), size = 1.5)"},{"path":"https://NSAPH-Software.github.io/GPCERF/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Naeem Khoshnevis. Author, maintainer. HUIT Boyu Ren. Author. McLean Hospital Tanujit Dey. Contributor. HMS Danielle Braun. Author. HSPH","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Khoshnevis N, Ren B, Braun D (2023). GPCERF: Gaussian Processes Estimating Causal Exposure Response Curves. R package version 0.2.1, https://CRAN.R-project.org/package=GPCERF.","code":"@Manual{, title = {GPCERF: Gaussian Processes for Estimating Causal Exposure Response Curves}, author = {Naeem Khoshnevis and Boyu Ren and Danielle Braun}, year = {2023}, note = {R package version 0.2.1}, url = {https://CRAN.R-project.org/package=GPCERF}, }"},{"path":[]},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/index.html","id":"summary","dir":"","previous_headings":"","what":"Summary","title":"Gaussian Process (GP) approach for nonparametric modeling.","text":"Gaussian Process (GP) approach nonparametric modeling. Provides non-parametric Bayesian framework based Gaussian process priors estimating causal effects continuous exposure detecting change points causal exposure response curves using observational data.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Gaussian Process (GP) approach for nonparametric modeling.","text":"Ren, B., Wu, X., Braun, D., Pillai, N. Dominici, F., 2021. Bayesian modeling exposure response curve via gaussian processes: Causal effects exposure air pollution health outcomes. arXiv preprint arXiv:2105.03454.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/GPCERF-package.html","id":null,"dir":"Reference","previous_headings":"","what":"The 'GPCERF' package. — GPCERF-package","title":"The 'GPCERF' package. — GPCERF-package","text":"Provides non-parametric Bayesian framework based Gaussian process priors estimating causal effects continuous exposure detecting change points causal exposure response curves using observational data.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/GPCERF-package.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"The 'GPCERF' package. — GPCERF-package","text":"Ren, B., Wu, X., Braun, D., Pillai, N. Dominici, F., 2021. Bayesian modeling exposure response curve via gaussian processes: Causal effects exposure air pollution health outcomes. arXiv preprint arXiv:2105.03454.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/GPCERF-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"The 'GPCERF' package. — GPCERF-package","text":"Naeem Khoshnevis Boyu Ren Danielle Braun","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"A helper function for cerf_gp object — autoplot.cerf_gp","title":"A helper function for cerf_gp object — autoplot.cerf_gp","text":"helper function plot cerf_gp object using ggplot2 package.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A helper function for cerf_gp object — autoplot.cerf_gp","text":"","code":"# S3 method for cerf_gp autoplot(object, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A helper function for cerf_gp object — autoplot.cerf_gp","text":"object cerf_gp object. ... Additional arguments passed customize plot.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A helper function for cerf_gp object — autoplot.cerf_gp","text":"Returns ggplot object.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_nngp.html","id":null,"dir":"Reference","previous_headings":"","what":"A helper function for cerf_nngp object — autoplot.cerf_nngp","title":"A helper function for cerf_nngp object — autoplot.cerf_nngp","text":"helper function plot cerf_nngp object using ggplot2 package.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_nngp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A helper function for cerf_nngp object — autoplot.cerf_nngp","text":"","code":"# S3 method for cerf_nngp autoplot(object, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_nngp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A helper function for cerf_nngp object — autoplot.cerf_nngp","text":"object cerf_nngp object. ... Additional arguments passed customize plot.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_nngp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A helper function for cerf_nngp object — autoplot.cerf_nngp","text":"Returns ggplot object.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/calc_ac.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate covariate balance — calc_ac","title":"Calculate covariate balance — calc_ac","text":"Calculates weighted correlation list covariates exposure. covariance function GP defines weights.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/calc_ac.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate covariate balance — calc_ac","text":"","code":"calc_ac(w, X, weights)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/calc_ac.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate covariate balance — calc_ac","text":"w vector exposure values across subjects. X matrix covariate values. Subjects rows covariates columns. weights vector weights assigned subjects based trained GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/calc_ac.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate covariate balance — calc_ac","text":"vector correlations w column X.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate derivatives of CERF for nnGP — compute_deriv_nn","title":"Calculate derivatives of CERF for nnGP — compute_deriv_nn","text":"Calculates posterior mean derivative CERF given exposure level nnGP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate derivatives of CERF for nnGP — compute_deriv_nn","text":"","code":"compute_deriv_nn( w, w_obs, gps_m, y_obs, hyperparam, n_neighbor, block_size, kernel_fn = function(x) exp(-x), kernel_deriv_fn = function(x) -exp(-x) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate derivatives of CERF for nnGP — compute_deriv_nn","text":"w scalar exposure level interest. w_obs vector observed exposure levels samples. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FALSE y_obs vector observed outcome values. hyperparam vector hyper-parameters GP model. n_neighbor number nearest neighbors one side. block_size number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory. kernel_fn covariance function. input square Euclidean distance. kernel_deriv_fn partial derivative covariance function. input square Euclidean distance.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate derivatives of CERF for nnGP — compute_deriv_nn","text":"scalar estimated derivative CERF w nnGP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_weights_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate derivatives of CERF — compute_deriv_weights_gp","title":"Calculate derivatives of CERF — compute_deriv_weights_gp","text":"Calculates weights assigned observed outcome deriving posterior mean first derivative CERF given exposure level.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_weights_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate derivatives of CERF — compute_deriv_weights_gp","text":"","code":"compute_deriv_weights_gp( w, w_obs, gps_m, hyperparam, kernel_fn = function(x) exp(-x), kernel_deriv_fn = function(x) -exp(-x) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_weights_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate derivatives of CERF — compute_deriv_weights_gp","text":"w scalar exposure level interest. w_obs vector observed exposure levels samples. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE hyperparam vector hyper-parameters GP model. kernel_fn covariance function. kernel_deriv_fn partial derivative covariance function.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_weights_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate derivatives of CERF — compute_deriv_weights_gp","text":"vector weights samples, based posterior mean derivative CERF exposure level interest calculated.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_inverse.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute matrix inverse for a covariate matrix — compute_inverse","title":"Compute matrix inverse for a covariate matrix — compute_inverse","text":"Computes inverse covariate matrix using Choleski decomposition.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_inverse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute matrix inverse for a covariate matrix — compute_inverse","text":"","code":"compute_inverse(mtrx)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_inverse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute matrix inverse for a covariate matrix — compute_inverse","text":"mtrx n * n covariate matrix","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_inverse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute matrix inverse for a covariate matrix — compute_inverse","text":"matrix represent inverse input matrix.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_m_sigma.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute mean, credible interval, and covariate balance in standard Gaussian\nprocess (GP) — compute_m_sigma","title":"Compute mean, credible interval, and covariate balance in standard Gaussian\nprocess (GP) — compute_m_sigma","text":"Calculates induced covariate balance associated one hyper-parameter configuration standard GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_m_sigma.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute mean, credible interval, and covariate balance in standard Gaussian\nprocess (GP) — compute_m_sigma","text":"","code":"compute_m_sigma( hyperparam, outcome_data, treatment_data, covariates_data, w, gps_m, tuning, kernel_fn = function(x) exp(-x^2) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_m_sigma.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute mean, credible interval, and covariate balance in standard Gaussian\nprocess (GP) — compute_m_sigma","text":"hyperparam vector values hyper-parameters. First element: alpha Second element: beta Third element: g_sigma (gamma / sigma) outcome_data vector outcome data. treatment_data vector treatment data. covariates_data data frame covariates data. w vector exposure levels CERF estimated. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE tuning function used parameter tuning (default = TRUE) estimation (FALSE) kernel_fn covariance function GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_m_sigma.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute mean, credible interval, and covariate balance in standard Gaussian\nprocess (GP) — compute_m_sigma","text":"list containing two elements: vector absolute weighted correlation covariate exposure, metric covariate balance estimated CERF w_all based hyper-parameter values param.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_m_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate posterior means for nnGP model — compute_posterior_m_nn","title":"Calculate posterior means for nnGP model — compute_posterior_m_nn","text":"Calculates posterior mean point CERF based nnGP model. function also returns weights assigned nearest neighbors calculating posterior mean.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_m_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate posterior means for nnGP model — compute_posterior_m_nn","text":"","code":"compute_posterior_m_nn( hyperparam, w, gps_w, obs_ord, y_obs_ord, kernel_fn = function(x) exp(-x^2), n_neighbor = 10, block_size = 10000 )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_m_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate posterior means for nnGP model — compute_posterior_m_nn","text":"hyperparam set hyperparameters GP model. w scaler representing exposure level point interest CERF. gps_w GPS samples exposure levels set w. obs_ord matrix two columns. First column observed exposure levels samples; second GPS observed exposure levels. rows ascending order first column. y_obs_ord vector observed outcome values. vector ordered obs_ord. kernel_fn covariance function GP. n_neighbor number nearest neighbors one side. block_size Number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_m_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate posterior means for nnGP model — compute_posterior_m_nn","text":"TODO: first column selected index second column weight. two-column matrix. first column weights assigned nearest neighbor. second column corresponding observed outcome value. weight last row matrix NA observed outcome value estimated posterior mean CERF point w, weighted sum observed outcome values neighbors.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_sd_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate posterior standard deviations for nnGP model — compute_posterior_sd_nn","title":"Calculate posterior standard deviations for nnGP model — compute_posterior_sd_nn","text":"Calculates posterior standard deviation point CERF based nnGP model.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_sd_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate posterior standard deviations for nnGP model — compute_posterior_sd_nn","text":"","code":"compute_posterior_sd_nn( hyperparam, w, gps_w, obs_ord, sigma2, kernel_fn = function(x) exp(-x^2), n_neighbor = 10, block_size = 10000 )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_sd_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate posterior standard deviations for nnGP model — compute_posterior_sd_nn","text":"hyperparam values hyperparameters GP model. w exposure level point interest CERF. gps_w GPS samples exposure levels set w. obs_ord matrix two columns. first column observed exposure levels samples; second GPS observed exposure levels. rows ascending order first column. sigma2 scaler representing sigma^2. kernel_fn covariance function GP. n_neighbor Number nearest neighbors one side. block_size Number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_sd_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate posterior standard deviations for nnGP model — compute_posterior_sd_nn","text":"posterior standard deviation estimated CERF w.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect change-point in standard GP — compute_rl_deriv_gp","title":"Detect change-point in standard GP — compute_rl_deriv_gp","text":"Calculates posterior mean difference left- right-derivatives exposure level detection change points.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect change-point in standard GP — compute_rl_deriv_gp","text":"","code":"compute_rl_deriv_gp( w, w_obs, y_obs, gps_m, hyperparam, kernel_fn = function(x) exp(-x), kernel_deriv_fn = function(x) -exp(-x) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect change-point in standard GP — compute_rl_deriv_gp","text":"w scalar exposure level interest. w_obs vector observed exposure levels samples. y_obs vector observed outcome values samples. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE hyperparam vector hyper-parameters GP model. kernel_fn covariance function. kernel_deriv_fn partial derivative covariance function.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect change-point in standard GP — compute_rl_deriv_gp","text":"numeric value posterior mean difference two one-sided derivatives.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_gp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect change-point in standard GP — compute_rl_deriv_gp","text":"","code":"# \\donttest{ set.seed(847) data <- generate_synthetic_data(sample_size = 100) gps_m <- estimate_gps(cov_mt = data[,-(1:2)], w_all = data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) #> Loading required package: nnls wi <- 8.6 val <- compute_rl_deriv_gp(w = wi, w_obs = data$treat, y_obs = data$Y, gps_m = gps_m, hyperparam = c(1,1,2)) # }"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate right minus left derivatives for change-point detection in nnGP — compute_rl_deriv_nn","title":"Calculate right minus left derivatives for change-point detection in nnGP — compute_rl_deriv_nn","text":"Calculates posterior mean difference left- right-derivatives exposure level detection change points. nnGP approximation used.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate right minus left derivatives for change-point detection in nnGP — compute_rl_deriv_nn","text":"","code":"compute_rl_deriv_nn( w, w_obs, gps_m, y_obs, hyperparam, n_neighbor, block_size, kernel_fn = function(x) exp(-x), kernel_deriv_fn = function(x) -exp(-x) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate right minus left derivatives for change-point detection in nnGP — compute_rl_deriv_nn","text":"w scalar exposure level interest. w_obs vector observed exposure levels samples. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE y_obs vector observed outcome values. hyperparam vector hyper-parameters GP model. n_neighbor number nearest neighbors one side. block_size number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory. kernel_fn covariance function. input square Euclidean distance. kernel_deriv_fn partial derivative covariance function. input square Euclidean distance.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate right minus left derivatives for change-point detection in nnGP — compute_rl_deriv_nn","text":"numeric value posterior mean difference two one-sided derivatives.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_nn.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate right minus left derivatives for change-point detection in nnGP — compute_rl_deriv_nn","text":"","code":"# \\donttest{ set.seed(325) data <- generate_synthetic_data(sample_size = 200) gps_m <- estimate_gps(cov_mt = data[,-(1:2)], w_all = data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) wi <- 12.2 deriv_val <- compute_rl_deriv_nn(w = wi, w_obs = data$treat, gps_m = gps_m, y_obs = data$Y, hyperparam = c(0.2,0.4,1.2), n_neighbor = 20, block_size = 10) # }"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_sd_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute posterior credible interval — compute_sd_gp","title":"Compute posterior credible interval — compute_sd_gp","text":"Computes posterior credible interval requested exposure level.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_sd_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute posterior credible interval — compute_sd_gp","text":"","code":"compute_sd_gp( w, scaled_obs, hyperparam, sigma, gps_m, kernel_fn = function(x) exp(-x^2) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_sd_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute posterior credible interval — compute_sd_gp","text":"w scalar exposure level interest. scaled_obs matrix two columns. First column scaled GPS value samples (GPS * 1/sqrt(alpha)) Second column scaled exposure value samples (w * 1/sqrt(beta)) hyperparam vector hyper-parameters GP. First element: alpha Second element: beta Third element: gamma/sigma sigma scaler represents noise. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE kernel_fn covariance function GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_sd_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute posterior credible interval — compute_sd_gp","text":"Posterior credible interval (scaler) requested exposure level (w).","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_w_corr.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute weighted covariate balance — compute_w_corr","title":"Compute weighted covariate balance — compute_w_corr","text":"Computes weighted covariate balance given data sets.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_w_corr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute weighted covariate balance — compute_w_corr","text":"","code":"compute_w_corr(w, covariate, weight)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_w_corr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute weighted covariate balance — compute_w_corr","text":"w vector observed continuous exposure variable. covariate data frame observed covariates variable. weight vector weights.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_w_corr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute weighted covariate balance — compute_w_corr","text":"function returns list saved measure related covariate balance absolute_corr: absolute correlations pre-exposure covairates; mean_absolute_corr: average absolute correlations pre-exposure covairates.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_w_corr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute weighted covariate balance — compute_w_corr","text":"","code":"set.seed(639) n <- 100 mydata <- generate_synthetic_data(sample_size=100) year <- sample(x=c(\"2001\",\"2002\",\"2003\",\"2004\",\"2005\"),size = n, replace = TRUE) region <- sample(x=c(\"North\", \"South\", \"East\", \"West\"),size = n, replace = TRUE) mydata$year <- as.factor(year) mydata$region <- as.factor(region) mydata$cf5 <- as.factor(mydata$cf5) cor_val <- compute_w_corr(mydata[,2], mydata[, 3:length(mydata)], runif(n)) print(cor_val$mean_absolute_corr) #> [1] 0.1461331"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_weight_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate weights for estimation of a point on CERF — compute_weight_gp","title":"Calculate weights for estimation of a point on CERF — compute_weight_gp","text":"Calculates weights observed outcomes used estimate posterior mean CERF given exposure level.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_weight_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate weights for estimation of a point on CERF — compute_weight_gp","text":"","code":"compute_weight_gp( w, w_obs, scaled_obs, hyperparam, inv_sigma_obs, gps_m, est_sd = FALSE, kernel_fn = function(x) exp(-x^2) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_weight_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate weights for estimation of a point on CERF — compute_weight_gp","text":"w scalar exposure level interest. w_obs vector observed exposure levels samples. scaled_obs matrix two columns. First column scaled GPS value samples (GPS * 1 / sqrt(alpha)) Second column scaled exposure value samples (w * 1/sqrt(beta)) hyperparam vector hyper-parameters GP. First element: alpha Second element: beta Third element: gamma/sigma inv_sigma_obs Inverse covariance matrix observed samples. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE est_sd posterior se computed (default=FALSE) kernel_fn covariance function GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_weight_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate weights for estimation of a point on CERF — compute_weight_gp","text":"list two elements, weight standard deviation.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","title":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","text":"Estimates conditional exposure response function (cerf) using Gaussian Process (gp). function tune best match (lowest covariate balance) provided set hyperparameters.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","text":"","code":"estimate_cerf_gp( data, w, gps_m, params, outcome_col, treatment_col, covariates_col, nthread = 1, kernel_fn = function(x) exp(-x^2) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","text":"data data.frame observation data. w vector exposure level compute CERF. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE params list parameters required run process. parameters include: alpha: scaling factor GPS value. beta: scaling factor exposure value. g_sigma: scaling factor kernel function (gamma/sigma). tune_app: tuning approach. Available approaches: : try combinations hyperparameters. alpha, beta, g_sigma can vector parameters. outcome_col outcome column name data. treatment_col treatment column name data. covariates_col Covariates columns name data. nthread integer value represents number threads used internal packages. kernel_fn kernel function. default value Gaussian Kernel.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","text":"cerf_gp object includes following values: w, vector exposure levels. pst_mean, Computed mean w vector. pst_sd, Computed credible interval w vector.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_gp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","text":"","code":"# \\donttest{ set.seed(129) data <- generate_synthetic_data(sample_size = 100, gps_spec = 3) # Estimate GPS function gps_m <- estimate_gps(cov_mt = data[,-(1:2)], w_all = data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) # exposure values w_all <- seq(0,10,1) cerf_gp_obj <- estimate_cerf_gp(data, w_all, gps_m, params = list(alpha = c(0.1), beta=0.2, g_sigma = 1, tune_app = \"all\"), outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) # }"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_nngp.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","title":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","text":"Estimates conditional exposure response function (cerf) using nearest neighbor (nn) Gaussian Process (gp). function tune best match (lowest covariate balance) provided set hyperparameters.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_nngp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","text":"","code":"estimate_cerf_nngp( data, w, gps_m, params, outcome_col, treatment_col, covariates_col, kernel_fn = function(x) exp(-x^2), nthread = 1 )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_nngp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","text":"data data.frame observation data. w vector exposure level compute CERF. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE params list parameters required run process. parameters include: alpha: scaling factor GPS value. beta: scaling factor exposure value. g_sigma: scaling factor kernel function (gamma/sigma). tune_app: tuning approach. Available approaches: : try combinations hyperparameters. n_neighbor: Number nearest neighbors one side. block_size: Number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory. alpha, beta, g_sigma can vector parameters. outcome_col outcome column name data. treatment_col treatment column name data. covariates_col Covariates columns name data. kernel_fn kernel function. default value Gaussian Kernel. nthread integer value represents number threads used internal packages.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_nngp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","text":"cerf_nngp object includes following values: w, vector exposure levels. pst_mean, computed mean w vector. pst_sd, computed credible interval w vector.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_nngp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","text":"","code":"# \\donttest{ set.seed(19) data <- generate_synthetic_data(sample_size = 120, gps_spec = 3) # Estimate GPS function gps_m <- estimate_gps(cov_mt = data[,-(1:2)], w_all = data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) # exposure values w.all <- seq(0,20,2) cerf_nngp_obj <- estimate_cerf_nngp(data, w.all, gps_m, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, tune_app = \"all\", n_neighbor = 20, block_size = 1e4), outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) # }"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_gps.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate a model for generalized propensity score — estimate_gps","title":"Estimate a model for generalized propensity score — estimate_gps","text":"Estimates model generalized propensity score (GPS) using parametric approach.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_gps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate a model for generalized propensity score — estimate_gps","text":"","code":"estimate_gps(cov_mt, w_all, sl_lib, dnorm_log)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_gps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate a model for generalized propensity score — estimate_gps","text":"cov_mt covariate matrix containing covariates. row data sample column covariate. w_all vector observed exposure levels. sl_lib vector SuperLearner's package libraries. dnorm_log Logical, TRUE, probabilities p given log(p).","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_gps.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate a model for generalized propensity score — estimate_gps","text":"data.frame includes: vector estimated GPS observed exposure levels; vector estimated conditional means exposure levels covariates fixed observed values; estimated standard deviation exposure levels vector observed exposure levels.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_gps.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate a model for generalized propensity score — estimate_gps","text":"","code":"# \\donttest{ data <- generate_synthetic_data(sample_size = 200) gps_m <- estimate_gps(cov_mt = data[,-(1:2)], w_all = data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) # }"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_mean_sd_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the CERF with the nnGP model — estimate_mean_sd_nn","title":"Estimate the CERF with the nnGP model — estimate_mean_sd_nn","text":"Estimates posterior mean conditional exposure response function specified exposure levels nnGP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_mean_sd_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the CERF with the nnGP model — estimate_mean_sd_nn","text":"","code":"estimate_mean_sd_nn( hyperparam, sigma2, w_obs, w, y_obs, gps_m, kernel_fn = function(x) exp(-x^2), n_neighbor = 50, block_size = 2000, nthread = 1 )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_mean_sd_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the CERF with the nnGP model — estimate_mean_sd_nn","text":"hyperparam set hyperparameters nnGP. sigma2 scaler representing sigma^2. w_obs vector observed exposure levels. w vector exposure levels CERF estimated. y_obs vector observed outcome values. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE kernel_fn covariance function GP. n_neighbor number nearest neighbors one side. block_size number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory. nthread integer value represents number threads used internal packages.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_mean_sd_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the CERF with the nnGP model — estimate_mean_sd_nn","text":"vector returned value compute_posterior_sd_nn.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the standard deviation of the nugget term in standard Gaussian\nprocess — estimate_noise_gp","title":"Estimate the standard deviation of the nugget term in standard Gaussian\nprocess — estimate_noise_gp","text":"Estimates standard deviations nugget term standard GP calculating standard deviations residuals.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the standard deviation of the nugget term in standard Gaussian\nprocess — estimate_noise_gp","text":"","code":"estimate_noise_gp(data, sigma_obs, inv_sigma_obs)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the standard deviation of the nugget term in standard Gaussian\nprocess — estimate_noise_gp","text":"data vector outcome data. sigma_obs Covariance matrix observed covariates. inv_sigma_obs Inverse covariance matrix observed covariates.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the standard deviation of the nugget term in standard Gaussian\nprocess — estimate_noise_gp","text":"scalar estimated standard deviation nugget term standard GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the standard deviation (noise) of the nugget term in nnGP — estimate_noise_nn","title":"Estimate the standard deviation (noise) of the nugget term in nnGP — estimate_noise_nn","text":"Estimates standard deviations nugget term (noise) nnGP calculating standard deviations residuals.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the standard deviation (noise) of the nugget term in nnGP — estimate_noise_nn","text":"","code":"estimate_noise_nn( hyperparam, w_obs, GPS_obs, y_obs, n_neighbor, nthread, kernel_fn = function(x) exp(-x^2) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the standard deviation (noise) of the nugget term in nnGP — estimate_noise_nn","text":"hyperparam vector hyper-parameter values. w_obs vector observed exposure levels. GPS_obs vector estimated GPS evaluated observed exposure levels. y_obs vector observed outcomes. n_neighbor number nearest neighbors one side. kernel_fn covariance function GP. n_thread number cores used estimation.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the standard deviation (noise) of the nugget term in nnGP — estimate_noise_nn","text":"scalar estimated standard deviation nugget term nnGP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/find_optimal_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Find the optimal hyper-parameter for the nearest neighbor Gaussian process — find_optimal_nn","title":"Find the optimal hyper-parameter for the nearest neighbor Gaussian process — find_optimal_nn","text":"Computes covariate balance combination provided hyper-parameters selects hyper-parameter values minimizes covariate balance.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/find_optimal_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find the optimal hyper-parameter for the nearest neighbor Gaussian process — find_optimal_nn","text":"","code":"find_optimal_nn( w_obs, w, y_obs, gps_m, design_mt, hyperparams = expand.grid(seq(0.5, 4.5, 1), seq(0.5, 4.5, 1), seq(0.5, 4.5, 1)), kernel_fn = function(x) exp(-x^2), n_neighbor = 50, block_size = 2000, nthread = 1 )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/find_optimal_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find the optimal hyper-parameter for the nearest neighbor Gaussian process — find_optimal_nn","text":"w_obs vector observed exposure levels. w vector exposure levels CERF estimated. y_obs vector observed outcomes gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE design_mt covariate matrix samples (intercept excluded). hyperparams matrix candidate values hyper-parameters, row contains set values hyper-parameters. kernel_fn covariance function GP. n_neighbor number nearest neighbors one side. block_size number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory. nthread integer value represents number threads used internal packages.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/find_optimal_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find the optimal hyper-parameter for the nearest neighbor Gaussian process — find_optimal_nn","text":"Estimated covariate balance scores grid hyper-parameter values considered hyperparams.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/generate_synthetic_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate synthetic data for the GPCERF package — generate_synthetic_data","title":"Generate synthetic data for the GPCERF package — generate_synthetic_data","text":"Generates synthetic data set based different GPS models covariates.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/generate_synthetic_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate synthetic data for the GPCERF package — generate_synthetic_data","text":"","code":"generate_synthetic_data( sample_size = 1000, outcome_sd = 10, gps_spec = 1, cova_spec = 1 )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/generate_synthetic_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate synthetic data for the GPCERF package — generate_synthetic_data","text":"sample_size number data samples. outcome_sd Standard deviation used generate outcome synthetic data set. gps_spec numeric value (1-6) indicates GPS model used generate continuous exposure. cova_spec numeric value (1-2) modify covariates.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/generate_synthetic_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate synthetic data for the GPCERF package — generate_synthetic_data","text":"data frame synthetic data. Outcome labeled Y, exposure w, covariates cf1-6.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/generate_synthetic_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate synthetic data for the GPCERF package — generate_synthetic_data","text":"","code":"set.seed(351) data <- generate_synthetic_data(sample_size = 200)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/get_logger.html","id":null,"dir":"Reference","previous_headings":"","what":"Get logger settings — get_logger","title":"Get logger settings — get_logger","text":"Returns current logger settings.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/get_logger.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get logger settings — get_logger","text":"","code":"get_logger()"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/get_logger.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get logger settings — get_logger","text":"Returns list includes logger_file_path logger_level.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/get_logger.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get logger settings — get_logger","text":"","code":"set_logger(\"mylogger.log\", \"INFO\") log_meta <- get_logger()"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/log_system_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Log system information — log_system_info","title":"Log system information — log_system_info","text":"Logs system related information log file.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/log_system_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Log system information — log_system_info","text":"","code":"log_system_info()"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/log_system_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Log system information — log_system_info","text":"return value. function called side effects.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Extend generic plot functions for cerf_gp class — plot.cerf_gp","title":"Extend generic plot functions for cerf_gp class — plot.cerf_gp","text":"wrapper function extend generic plot functions cerf_gp class.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extend generic plot functions for cerf_gp class — plot.cerf_gp","text":"","code":"# S3 method for cerf_gp plot(x, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extend generic plot functions for cerf_gp class — plot.cerf_gp","text":"x cerf_gp object. ... Additional arguments passed customize plot.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extend generic plot functions for cerf_gp class — plot.cerf_gp","text":"Returns ggplot2 object, invisibly. function called side effects.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_nngp.html","id":null,"dir":"Reference","previous_headings":"","what":"Extend generic plot functions for cerf_nngp class — plot.cerf_nngp","title":"Extend generic plot functions for cerf_nngp class — plot.cerf_nngp","text":"wrapper function extend generic plot functions cerf_nngp class.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_nngp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extend generic plot functions for cerf_nngp class — plot.cerf_nngp","text":"","code":"# S3 method for cerf_nngp plot(x, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_nngp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extend generic plot functions for cerf_nngp class — plot.cerf_nngp","text":"x cerf_nngp object. ... Additional arguments passed customize plot.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_nngp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extend generic plot functions for cerf_nngp class — plot.cerf_nngp","text":"Returns ggplot2 object, invisibly. function called side effects.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Extend print function for cerf_gp object — print.cerf_gp","title":"Extend print function for cerf_gp object — print.cerf_gp","text":"Extend print function cerf_gp object","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extend print function for cerf_gp object — print.cerf_gp","text":"","code":"# S3 method for cerf_gp print(x, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extend print function for cerf_gp object — print.cerf_gp","text":"x cerf_gp object. ... Additional arguments passed customize results.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extend print function for cerf_gp object — print.cerf_gp","text":"return value. function called side effects.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_nngp.html","id":null,"dir":"Reference","previous_headings":"","what":"Extend print function for cerf_nngp object — print.cerf_nngp","title":"Extend print function for cerf_nngp object — print.cerf_nngp","text":"Extend print function cerf_nngp object","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_nngp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extend print function for cerf_nngp object — print.cerf_nngp","text":"","code":"# S3 method for cerf_nngp print(x, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_nngp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extend print function for cerf_nngp object — print.cerf_nngp","text":"x cerf_nngp object. ... Additional arguments passed customize results.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_nngp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extend print function for cerf_nngp object — print.cerf_nngp","text":"return value. function called side effects.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/set_logger.html","id":null,"dir":"Reference","previous_headings":"","what":"Set logger settings — set_logger","title":"Set logger settings — set_logger","text":"Updates logger settings, including log level location file.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/set_logger.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set logger settings — set_logger","text":"","code":"set_logger(logger_file_path = \"GPCERF.log\", logger_level = \"INFO\")"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/set_logger.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set logger settings — set_logger","text":"logger_file_path path (including file name) log messages. (Default: GPCERF.log) logger_level log level. Available levels include: TRACE DEBUG INFO (Default) SUCCESS WARN ERROR FATAL","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/set_logger.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set logger settings — set_logger","text":"return value. function called side effects.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/set_logger.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set logger settings — set_logger","text":"","code":"set_logger(\"mylogger.log\", \"INFO\")"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"print summary of cerf_gp object — summary.cerf_gp","title":"print summary of cerf_gp object — summary.cerf_gp","text":"print summary cerf_gp object","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"print summary of cerf_gp object — summary.cerf_gp","text":"","code":"# S3 method for cerf_gp summary(object, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"print summary of cerf_gp object — summary.cerf_gp","text":"object cerf_gp object. ... Additional arguments passed customize results.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"print summary of cerf_gp object — summary.cerf_gp","text":"Returns summary data","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_nngp.html","id":null,"dir":"Reference","previous_headings":"","what":"print summary of cerf_nngp object — summary.cerf_nngp","title":"print summary of cerf_nngp object — summary.cerf_nngp","text":"print summary cerf_nngp object","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_nngp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"print summary of cerf_nngp object — summary.cerf_nngp","text":"","code":"# S3 method for cerf_nngp summary(object, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_nngp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"print summary of cerf_nngp object — summary.cerf_nngp","text":"object cerf_nngp object. ... Additional arguments passed customize results.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_nngp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"print summary of cerf_nngp object — summary.cerf_nngp","text":"Returns summary data.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/train_GPS.html","id":null,"dir":"Reference","previous_headings":"","what":"Train a model for generalized propensity score — train_gps","title":"Train a model for generalized propensity score — train_gps","text":"Estimates conditional mean sd exposure level function covariates.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/train_GPS.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Train a model for generalized propensity score — train_gps","text":"","code":"train_gps(cov_mt, w_all, sl_lib, dnorm_log)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/train_GPS.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Train a model for generalized propensity score — train_gps","text":"cov_mt covariate matrix containing covariates. row data sample column covariate. w_all vector observed exposure levels. sl_lib vector SuperLearner's package libraries. dnorm_log Logical, TRUE, probabilities p given log(p).","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/train_GPS.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Train a model for generalized propensity score — train_gps","text":"data.frame includes: vector estimated GPS observed exposure levels; vector estimated conditional means exposure levels covariates fixed observed values; estimated standard deviation exposure levels","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/train_GPS.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Train a model for generalized propensity score — train_gps","text":"","code":"# \\donttest{ data <- generate_synthetic_data(sample_size = 200) GPS_m <- train_gps(cov_mt = data[,-(1:2)], w_all = data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) # }"},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"gpcerf-021-2023-01-15","dir":"Changelog","previous_headings":"","what":"GPCERF 0.2.1 (2023-01-15)","title":"GPCERF 0.2.1 (2023-01-15)","text":"CRAN release: 2023-03-15","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"changed-0-2-1","dir":"Changelog","previous_headings":"","what":"Changed","title":"GPCERF 0.2.1 (2023-01-15)","text":"full GP –> standard GP plots exposure response function objects include covariate balance. formula longer need nn functions. estimate_gps now returns used exposure level, . train_gps –> estimate_gps nearest neighbor approach get expand input parameter (n_neighbor * expand –> n_neighbor). weighted covariate balance now computed using wCorr package.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"gpcerf-020-2023-01-22","dir":"Changelog","previous_headings":"","what":"GPCERF 0.2.0 (2023-01-22)","title":"GPCERF 0.2.0 (2023-01-22)","text":"CRAN release: 2023-01-22","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"changed-0-2-0","dir":"Changelog","previous_headings":"","what":"Changed","title":"GPCERF 0.2.0 (2023-01-22)","text":"estimate_noise_nn now allows parallelization added argument nthread number CPUs used parallel. estimate_mean_sd_nn now computes posterior variance. find_optimal_nn now returns posterior mean covariate balance optimal hyper-parameter values. Add argument kernel_fn nn related functions allow user-defined kernel functions. Add argument formula nn related functions allow user-defined design matrix. find_optimal_nn becomes internal function. estimate_noise_gp estimate_noise_nn become internal functions. estimate_mean_sd_nn becomes internal function. compute_weight_gp becomes internal function. compute_w_corr accepts w confounders separately. also normalizes w internally. compute_posterior_sd_nn becomes internal function. compute_posterior_m_nn becomes internal function. compute_derive_weights_gp becomes internal function. compute_m_sigma becomes internal function. compute_inverse becomes internal function. compute_m_sigma, tuning option default value. train_gps default values. train_gps accepts vector SuperLearner package’s libraries. train_GPS -> train_gps","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"gpcerf-010-2022-07-02","dir":"Changelog","previous_headings":"","what":"GPCERF 0.1.0 (2022-07-02)","title":"GPCERF 0.1.0 (2022-07-02)","text":"CRAN release: 2022-07-02","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"changed-0-1-0","dir":"Changelog","previous_headings":"","what":"Changed","title":"GPCERF 0.1.0 (2022-07-02)","text":"nn_cp_calc -> compute_rl_deriv_nn deriv_nn_fast -> compute_deriv_nn get_nn_sd -> compute_posterior_sd_nn nn_sigma_est -> estimate_noise_nn idx.-> idx_select GPS.new -> GPS_w w.new -> w get.nn.fast -> compute_posterior_m_nn w.est -> w nn_balance -> best_nn_cb","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"added-0-1-0","dir":"Changelog","previous_headings":"","what":"Added","title":"GPCERF 0.1.0 (2022-07-02)","text":"Package website using pkgdown Logger functions compute_sd_gp function","code":""},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"changed-0-0-1","dir":"Changelog","previous_headings":"","what":"Changed","title":"GPCERF 0.0.1 (2022-03-31)","text":"Removed examples internal functions w.obs -> w_obs inv.Sigma.obs -> inv_sigma_obs obs.use -> scaled_obs tune.fn -> compute_m_sigma GP.weights.test -> compute_weight_gp data.generate -> generate_synthetic_data","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"added-0-0-1","dir":"Changelog","previous_headings":"","what":"Added","title":"GPCERF 0.0.1 (2022-03-31)","text":"estimate_noise function estimate_cerf_gp function compute_inverse function compute_w_corr function","code":""}] +[{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement nkhoshnevis@g.harvard.edu. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"GNU General Public License","title":"GNU General Public License","text":"Version 3, 29 June 2007Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone permitted copy distribute verbatim copies license document, changing allowed.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"preamble","dir":"","previous_headings":"","what":"Preamble","title":"GNU General Public License","text":"GNU General Public License free, copyleft license software kinds works. licenses software practical works designed take away freedom share change works. contrast, GNU General Public License intended guarantee freedom share change versions program–make sure remains free software users. , Free Software Foundation, use GNU General Public License software; applies also work released way authors. can apply programs, . speak free software, referring freedom, price. General Public Licenses designed make sure freedom distribute copies free software (charge wish), receive source code can get want , can change software use pieces new free programs, know can things. protect rights, need prevent others denying rights asking surrender rights. Therefore, certain responsibilities distribute copies software, modify : responsibilities respect freedom others. example, distribute copies program, whether gratis fee, must pass recipients freedoms received. must make sure , , receive can get source code. must show terms know rights. Developers use GNU GPL protect rights two steps: (1) assert copyright software, (2) offer License giving legal permission copy, distribute /modify . developers’ authors’ protection, GPL clearly explains warranty free software. users’ authors’ sake, GPL requires modified versions marked changed, problems attributed erroneously authors previous versions. devices designed deny users access install run modified versions software inside , although manufacturer can . fundamentally incompatible aim protecting users’ freedom change software. systematic pattern abuse occurs area products individuals use, precisely unacceptable. Therefore, designed version GPL prohibit practice products. problems arise substantially domains, stand ready extend provision domains future versions GPL, needed protect freedom users. Finally, every program threatened constantly software patents. States allow patents restrict development use software general-purpose computers, , wish avoid special danger patents applied free program make effectively proprietary. prevent , GPL assures patents used render program non-free. precise terms conditions copying, distribution modification follow.","code":""},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_0-definitions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"0. Definitions","title":"GNU General Public License","text":"“License” refers version 3 GNU General Public License. “Copyright” also means copyright-like laws apply kinds works, semiconductor masks. “Program” refers copyrightable work licensed License. licensee addressed “”. “Licensees” “recipients” may individuals organizations. “modify” work means copy adapt part work fashion requiring copyright permission, making exact copy. resulting work called “modified version” earlier work work “based ” earlier work. “covered work” means either unmodified Program work based Program. “propagate” work means anything , without permission, make directly secondarily liable infringement applicable copyright law, except executing computer modifying private copy. Propagation includes copying, distribution (without modification), making available public, countries activities well. “convey” work means kind propagation enables parties make receive copies. Mere interaction user computer network, transfer copy, conveying. interactive user interface displays “Appropriate Legal Notices” extent includes convenient prominently visible feature (1) displays appropriate copyright notice, (2) tells user warranty work (except extent warranties provided), licensees may convey work License, view copy License. interface presents list user commands options, menu, prominent item list meets criterion.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_1-source-code","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"1. Source Code","title":"GNU General Public License","text":"“source code” work means preferred form work making modifications . “Object code” means non-source form work. “Standard Interface” means interface either official standard defined recognized standards body, , case interfaces specified particular programming language, one widely used among developers working language. “System Libraries” executable work include anything, work whole, () included normal form packaging Major Component, part Major Component, (b) serves enable use work Major Component, implement Standard Interface implementation available public source code form. “Major Component”, context, means major essential component (kernel, window system, ) specific operating system () executable work runs, compiler used produce work, object code interpreter used run . “Corresponding Source” work object code form means source code needed generate, install, (executable work) run object code modify work, including scripts control activities. However, include work’s System Libraries, general-purpose tools generally available free programs used unmodified performing activities part work. example, Corresponding Source includes interface definition files associated source files work, source code shared libraries dynamically linked subprograms work specifically designed require, intimate data communication control flow subprograms parts work. Corresponding Source need include anything users can regenerate automatically parts Corresponding Source. Corresponding Source work source code form work.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_2-basic-permissions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"2. Basic Permissions","title":"GNU General Public License","text":"rights granted License granted term copyright Program, irrevocable provided stated conditions met. License explicitly affirms unlimited permission run unmodified Program. output running covered work covered License output, given content, constitutes covered work. License acknowledges rights fair use equivalent, provided copyright law. may make, run propagate covered works convey, without conditions long license otherwise remains force. may convey covered works others sole purpose make modifications exclusively , provide facilities running works, provided comply terms License conveying material control copyright. thus making running covered works must exclusively behalf, direction control, terms prohibit making copies copyrighted material outside relationship . Conveying circumstances permitted solely conditions stated . Sublicensing allowed; section 10 makes unnecessary.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_3-protecting-users-legal-rights-from-anti-circumvention-law","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"3. Protecting Users’ Legal Rights From Anti-Circumvention Law","title":"GNU General Public License","text":"covered work shall deemed part effective technological measure applicable law fulfilling obligations article 11 WIPO copyright treaty adopted 20 December 1996, similar laws prohibiting restricting circumvention measures. convey covered work, waive legal power forbid circumvention technological measures extent circumvention effected exercising rights License respect covered work, disclaim intention limit operation modification work means enforcing, work’s users, third parties’ legal rights forbid circumvention technological measures.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_4-conveying-verbatim-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"4. Conveying Verbatim Copies","title":"GNU General Public License","text":"may convey verbatim copies Program’s source code receive , medium, provided conspicuously appropriately publish copy appropriate copyright notice; keep intact notices stating License non-permissive terms added accord section 7 apply code; keep intact notices absence warranty; give recipients copy License along Program. may charge price price copy convey, may offer support warranty protection fee.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_5-conveying-modified-source-versions","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"5. Conveying Modified Source Versions","title":"GNU General Public License","text":"may convey work based Program, modifications produce Program, form source code terms section 4, provided also meet conditions: ) work must carry prominent notices stating modified , giving relevant date. b) work must carry prominent notices stating released License conditions added section 7. requirement modifies requirement section 4 “keep intact notices”. c) must license entire work, whole, License anyone comes possession copy. License therefore apply, along applicable section 7 additional terms, whole work, parts, regardless packaged. License gives permission license work way, invalidate permission separately received . d) work interactive user interfaces, must display Appropriate Legal Notices; however, Program interactive interfaces display Appropriate Legal Notices, work need make . compilation covered work separate independent works, nature extensions covered work, combined form larger program, volume storage distribution medium, called “aggregate” compilation resulting copyright used limit access legal rights compilation’s users beyond individual works permit. Inclusion covered work aggregate cause License apply parts aggregate.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_6-conveying-non-source-forms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"6. Conveying Non-Source Forms","title":"GNU General Public License","text":"may convey covered work object code form terms sections 4 5, provided also convey machine-readable Corresponding Source terms License, one ways: ) Convey object code , embodied , physical product (including physical distribution medium), accompanied Corresponding Source fixed durable physical medium customarily used software interchange. b) Convey object code , embodied , physical product (including physical distribution medium), accompanied written offer, valid least three years valid long offer spare parts customer support product model, give anyone possesses object code either (1) copy Corresponding Source software product covered License, durable physical medium customarily used software interchange, price reasonable cost physically performing conveying source, (2) access copy Corresponding Source network server charge. c) Convey individual copies object code copy written offer provide Corresponding Source. alternative allowed occasionally noncommercially, received object code offer, accord subsection 6b. d) Convey object code offering access designated place (gratis charge), offer equivalent access Corresponding Source way place charge. need require recipients copy Corresponding Source along object code. place copy object code network server, Corresponding Source may different server (operated third party) supports equivalent copying facilities, provided maintain clear directions next object code saying find Corresponding Source. Regardless server hosts Corresponding Source, remain obligated ensure available long needed satisfy requirements. e) Convey object code using peer--peer transmission, provided inform peers object code Corresponding Source work offered general public charge subsection 6d. separable portion object code, whose source code excluded Corresponding Source System Library, need included conveying object code work. “User Product” either (1) “consumer product”, means tangible personal property normally used personal, family, household purposes, (2) anything designed sold incorporation dwelling. determining whether product consumer product, doubtful cases shall resolved favor coverage. particular product received particular user, “normally used” refers typical common use class product, regardless status particular user way particular user actually uses, expects expected use, product. product consumer product regardless whether product substantial commercial, industrial non-consumer uses, unless uses represent significant mode use product. “Installation Information” User Product means methods, procedures, authorization keys, information required install execute modified versions covered work User Product modified version Corresponding Source. information must suffice ensure continued functioning modified object code case prevented interfered solely modification made. convey object code work section , , specifically use , User Product, conveying occurs part transaction right possession use User Product transferred recipient perpetuity fixed term (regardless transaction characterized), Corresponding Source conveyed section must accompanied Installation Information. requirement apply neither third party retains ability install modified object code User Product (example, work installed ROM). requirement provide Installation Information include requirement continue provide support service, warranty, updates work modified installed recipient, User Product modified installed. Access network may denied modification materially adversely affects operation network violates rules protocols communication across network. Corresponding Source conveyed, Installation Information provided, accord section must format publicly documented (implementation available public source code form), must require special password key unpacking, reading copying.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_7-additional-terms","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"7. Additional Terms","title":"GNU General Public License","text":"“Additional permissions” terms supplement terms License making exceptions one conditions. Additional permissions applicable entire Program shall treated though included License, extent valid applicable law. additional permissions apply part Program, part may used separately permissions, entire Program remains governed License without regard additional permissions. convey copy covered work, may option remove additional permissions copy, part . (Additional permissions may written require removal certain cases modify work.) may place additional permissions material, added covered work, can give appropriate copyright permission. Notwithstanding provision License, material add covered work, may (authorized copyright holders material) supplement terms License terms: ) Disclaiming warranty limiting liability differently terms sections 15 16 License; b) Requiring preservation specified reasonable legal notices author attributions material Appropriate Legal Notices displayed works containing ; c) Prohibiting misrepresentation origin material, requiring modified versions material marked reasonable ways different original version; d) Limiting use publicity purposes names licensors authors material; e) Declining grant rights trademark law use trade names, trademarks, service marks; f) Requiring indemnification licensors authors material anyone conveys material (modified versions ) contractual assumptions liability recipient, liability contractual assumptions directly impose licensors authors. non-permissive additional terms considered “restrictions” within meaning section 10. Program received , part , contains notice stating governed License along term restriction, may remove term. license document contains restriction permits relicensing conveying License, may add covered work material governed terms license document, provided restriction survive relicensing conveying. add terms covered work accord section, must place, relevant source files, statement additional terms apply files, notice indicating find applicable terms. Additional terms, permissive non-permissive, may stated form separately written license, stated exceptions; requirements apply either way.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_8-termination","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"8. Termination","title":"GNU General Public License","text":"may propagate modify covered work except expressly provided License. attempt otherwise propagate modify void, automatically terminate rights License (including patent licenses granted third paragraph section 11). However, cease violation License, license particular copyright holder reinstated () provisionally, unless copyright holder explicitly finally terminates license, (b) permanently, copyright holder fails notify violation reasonable means prior 60 days cessation. Moreover, license particular copyright holder reinstated permanently copyright holder notifies violation reasonable means, first time received notice violation License (work) copyright holder, cure violation prior 30 days receipt notice. Termination rights section terminate licenses parties received copies rights License. rights terminated permanently reinstated, qualify receive new licenses material section 10.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_9-acceptance-not-required-for-having-copies","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"9. Acceptance Not Required for Having Copies","title":"GNU General Public License","text":"required accept License order receive run copy Program. Ancillary propagation covered work occurring solely consequence using peer--peer transmission receive copy likewise require acceptance. However, nothing License grants permission propagate modify covered work. actions infringe copyright accept License. Therefore, modifying propagating covered work, indicate acceptance License .","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_10-automatic-licensing-of-downstream-recipients","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"10. Automatic Licensing of Downstream Recipients","title":"GNU General Public License","text":"time convey covered work, recipient automatically receives license original licensors, run, modify propagate work, subject License. responsible enforcing compliance third parties License. “entity transaction” transaction transferring control organization, substantially assets one, subdividing organization, merging organizations. propagation covered work results entity transaction, party transaction receives copy work also receives whatever licenses work party’s predecessor interest give previous paragraph, plus right possession Corresponding Source work predecessor interest, predecessor can get reasonable efforts. may impose restrictions exercise rights granted affirmed License. example, may impose license fee, royalty, charge exercise rights granted License, may initiate litigation (including cross-claim counterclaim lawsuit) alleging patent claim infringed making, using, selling, offering sale, importing Program portion .","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_11-patents","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"11. Patents","title":"GNU General Public License","text":"“contributor” copyright holder authorizes use License Program work Program based. work thus licensed called contributor’s “contributor version”. contributor’s “essential patent claims” patent claims owned controlled contributor, whether already acquired hereafter acquired, infringed manner, permitted License, making, using, selling contributor version, include claims infringed consequence modification contributor version. purposes definition, “control” includes right grant patent sublicenses manner consistent requirements License. contributor grants non-exclusive, worldwide, royalty-free patent license contributor’s essential patent claims, make, use, sell, offer sale, import otherwise run, modify propagate contents contributor version. following three paragraphs, “patent license” express agreement commitment, however denominated, enforce patent (express permission practice patent covenant sue patent infringement). “grant” patent license party means make agreement commitment enforce patent party. convey covered work, knowingly relying patent license, Corresponding Source work available anyone copy, free charge terms License, publicly available network server readily accessible means, must either (1) cause Corresponding Source available, (2) arrange deprive benefit patent license particular work, (3) arrange, manner consistent requirements License, extend patent license downstream recipients. “Knowingly relying” means actual knowledge , patent license, conveying covered work country, recipient’s use covered work country, infringe one identifiable patents country reason believe valid. , pursuant connection single transaction arrangement, convey, propagate procuring conveyance , covered work, grant patent license parties receiving covered work authorizing use, propagate, modify convey specific copy covered work, patent license grant automatically extended recipients covered work works based . patent license “discriminatory” include within scope coverage, prohibits exercise , conditioned non-exercise one rights specifically granted License. may convey covered work party arrangement third party business distributing software, make payment third party based extent activity conveying work, third party grants, parties receive covered work , discriminatory patent license () connection copies covered work conveyed (copies made copies), (b) primarily connection specific products compilations contain covered work, unless entered arrangement, patent license granted, prior 28 March 2007. Nothing License shall construed excluding limiting implied license defenses infringement may otherwise available applicable patent law.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_12-no-surrender-of-others-freedom","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"12. No Surrender of Others’ Freedom","title":"GNU General Public License","text":"conditions imposed (whether court order, agreement otherwise) contradict conditions License, excuse conditions License. convey covered work satisfy simultaneously obligations License pertinent obligations, consequence may convey . example, agree terms obligate collect royalty conveying convey Program, way satisfy terms License refrain entirely conveying Program.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_13-use-with-the-gnu-affero-general-public-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"13. Use with the GNU Affero General Public License","title":"GNU General Public License","text":"Notwithstanding provision License, permission link combine covered work work licensed version 3 GNU Affero General Public License single combined work, convey resulting work. terms License continue apply part covered work, special requirements GNU Affero General Public License, section 13, concerning interaction network apply combination .","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_14-revised-versions-of-this-license","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"14. Revised Versions of this License","title":"GNU General Public License","text":"Free Software Foundation may publish revised /new versions GNU General Public License time time. new versions similar spirit present version, may differ detail address new problems concerns. version given distinguishing version number. Program specifies certain numbered version GNU General Public License “later version” applies , option following terms conditions either numbered version later version published Free Software Foundation. Program specify version number GNU General Public License, may choose version ever published Free Software Foundation. Program specifies proxy can decide future versions GNU General Public License can used, proxy’s public statement acceptance version permanently authorizes choose version Program. Later license versions may give additional different permissions. However, additional obligations imposed author copyright holder result choosing follow later version.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_15-disclaimer-of-warranty","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"15. Disclaimer of Warranty","title":"GNU General Public License","text":"WARRANTY PROGRAM, EXTENT PERMITTED APPLICABLE LAW. EXCEPT OTHERWISE STATED WRITING COPYRIGHT HOLDERS /PARTIES PROVIDE PROGRAM “” WITHOUT WARRANTY KIND, EITHER EXPRESSED IMPLIED, INCLUDING, LIMITED , IMPLIED WARRANTIES MERCHANTABILITY FITNESS PARTICULAR PURPOSE. ENTIRE RISK QUALITY PERFORMANCE PROGRAM . PROGRAM PROVE DEFECTIVE, ASSUME COST NECESSARY SERVICING, REPAIR CORRECTION.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_16-limitation-of-liability","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"16. Limitation of Liability","title":"GNU General Public License","text":"EVENT UNLESS REQUIRED APPLICABLE LAW AGREED WRITING COPYRIGHT HOLDER, PARTY MODIFIES /CONVEYS PROGRAM PERMITTED , LIABLE DAMAGES, INCLUDING GENERAL, SPECIAL, INCIDENTAL CONSEQUENTIAL DAMAGES ARISING USE INABILITY USE PROGRAM (INCLUDING LIMITED LOSS DATA DATA RENDERED INACCURATE LOSSES SUSTAINED THIRD PARTIES FAILURE PROGRAM OPERATE PROGRAMS), EVEN HOLDER PARTY ADVISED POSSIBILITY DAMAGES.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"id_17-interpretation-of-sections-15-and-16","dir":"","previous_headings":"TERMS AND CONDITIONS","what":"17. Interpretation of Sections 15 and 16","title":"GNU General Public License","text":"disclaimer warranty limitation liability provided given local legal effect according terms, reviewing courts shall apply local law closely approximates absolute waiver civil liability connection Program, unless warranty assumption liability accompanies copy Program return fee. END TERMS CONDITIONS","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/LICENSE.html","id":"how-to-apply-these-terms-to-your-new-programs","dir":"","previous_headings":"","what":"How to Apply These Terms to Your New Programs","title":"GNU General Public License","text":"develop new program, want greatest possible use public, best way achieve make free software everyone can redistribute change terms. , attach following notices program. safest attach start source file effectively state exclusion warranty; file least “copyright” line pointer full notice found. Also add information contact electronic paper mail. program terminal interaction, make output short notice like starts interactive mode: hypothetical commands show w show c show appropriate parts General Public License. course, program’s commands might different; GUI interface, use “box”. also get employer (work programmer) school, , sign “copyright disclaimer” program, necessary. information , apply follow GNU GPL, see <http://www.gnu.org/licenses/>. GNU General Public License permit incorporating program proprietary programs. program subroutine library, may consider useful permit linking proprietary applications library. want , use GNU Lesser General Public License instead License. first, please read <http://www.gnu.org/philosophy/--lgpl.html>.","code":"<one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. <program> Copyright (C) <year> <name of author> This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free software, and you are welcome to redistribute it under certain conditions; type 'show c' for details."},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"environment-setup","dir":"Articles","previous_headings":"","what":"Environment Setup","title":"Developers Guide","text":"contribute project, ’s recommended local copy GPCERF Github account. result, please fork project. open terminal (Gitbash Windows, Anaconda prompt, …) run following command (brackets included): haven’t already, generate SSH key. Learn . Now, can modify codebase track changes. Consider creating new branch work codebase. Refer following instructions git branching.","code":"git clone git@github.com:[your user name]/GPCERF.git"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"git-branching-model","dir":"Articles","previous_headings":"","what":"Git Branching Model","title":"Developers Guide","text":"can choose branch name personal repository, maintaining consistency understanding ’s working crucial. project, follow convention proposed Vincent Driessen successful Git branching model post. summary branches: main: main branch hosts released software packages. project maintainers write access master branch. develop: develop branch serves primary branch, source code HEAD always reflecting latest delivered development changes next release. feature: start new feature branch add new features software. naming convention iss[issue_number]_short_description. example, need add unittest one functions package issue number 12, iss12_add_unittest can valid git branch name. start issue number go back take look issue details necessary. Although feature branches temporary, naming convention helps developers understand situation working codebase. working features open issue , please open issue assign . can also make comment working . hotfix: hotfix branches used fixing bug released package. fixing bug, third digit version number incremented one. example, 2.3.5 –> 2.3.6. branches prefixed hotfix followed upcoming version number (e.g., case, hotfix_2.3.6) release: Release branches support preparation new production release.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"where-to-submit-pull-requests","dir":"Articles","previous_headings":"","what":"Where to submit pull requests?","title":"Developers Guide","text":"Submit pull requests base repository: NSAPH-Software/GPCERF base: develop branch.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"pull-request-checklist","dir":"Articles","previous_headings":"","what":"Pull request checklist","title":"Developers Guide","text":"Please run devtools::document(), devtools::load_all() final modifications. Make sure modified code passes checks tests (can run devtools::check() RStudio) PR pass CI merging. Add line(s) modification NEWS.md file. adding new features, please make sure appropriate documentation added updated. Please clean white spaces. Read .","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"reporting-bugs","dir":"Articles","previous_headings":"","what":"Reporting bugs","title":"Developers Guide","text":"Please report potential bugs creating new issue sending us email. Please include following information bug report: brief description , expected happen, happened. OS using whether using personal computer HPC cluster. version package installed.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"style-guide","dir":"Articles","previous_headings":"","what":"Style Guide","title":"Developers Guide","text":"project, follow tidyverse style guide.","code":""},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"names","dir":"Articles","previous_headings":"Style Guide > Summary","what":"Names","title":"Developers Guide","text":"File names snake_case ends .R (e.g., create_matching.R) variable names small letter separate _ need (e.g., delta_n) Function names follow snake_case style (e.g., generate_data) Function names follow verb+output convention (e.g., compute_resid)","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"spaces-and-indentation","dir":"Articles","previous_headings":"Style Guide > Summary","what":"Spaces and Indentation","title":"Developers Guide","text":"Indentations two spaces (use tab) Place space around binary operators (e.g., x + y) Place space comma Place space # commenting avoid multiple ### put space opening closing parenthesis Place space () used , , .","code":"#Acceptable: z <- x + y #Not recommended: z<-x+y # (no space) z<- x+y z<-x +y #Acceptable: a <- matrix(c(1:100), nrow = 5) #Not recommended: a <- matrix(c(1:100),nrow = 5) # (no space after comma) a <- matrix( c(1:100), nrow = 5 ) # (extra space after and before parentheses) a<-matrix(c(1:100), nrow = 5) # (no space around unary operator <- ) #Acceptable: # This is a comment #Not recommended: #This is a comment # This is a comment (more than one space after #) ## This is a comment (multiple #) ### This is a comment (multiple # and more than one space) #Acceptable: x <- (z + y) #Not recommended: x <- ( z + y ) # (unnecessary space) x <- (z + y ) x <- ( z + y) #Acceptible if (x > 2) { print(x) } # Not recommended if(x > 2){ print(x) }"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"other-notes","dir":"Articles","previous_headings":"Style Guide > Summary","what":"Other notes","title":"Developers Guide","text":"Maximum line length 80 character Use explicit returns Use explicit tags documentation (e.g., @title, @description, …)","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"notes-on-superlearner","dir":"Articles","previous_headings":"","what":"Notes on SuperLearner","title":"Developers Guide","text":"package create customized wrapper SuperLearner internal libraries. Please read Notes SL Wrappers details.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Developers-Guide.html","id":"logger","dir":"Articles","previous_headings":"","what":"Logger","title":"Developers Guide","text":"Use logger examine internal process. default, level set “INFO”, writing messages “GPCERF.log” file. change log file location level, use update_logger function.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Full-Gaussian-Processes.html","id":"generate-synthetic-data","dir":"Articles","previous_headings":"","what":"Generate Synthetic Data","title":"Standard Gaussian Processes","text":"first generate synthetic dataset six covariates, one continuous exposure one outcome. consider two types conditional distributions (normal student’s t) exposure given covariates. details synthetic data generation, see document. use function tru_R derive actual ERF population w=seq(0,20,0.1).","code":"set.seed(134) # Generate dataset with a normally distributed exposure given covariates data_sim_normal <- generate_synthetic_data(sample_size = 400, outcome_sd = 10, gps_spec = 1) # Generate dataset with a t-distributed with 2df exposure given covariates data_sim_t <- generate_synthetic_data(sample_size = 400, outcome_sd = 10, gps_spec = 2) tru_R <- function(w, sim_data) { design_mt <- model.matrix(~cf1 + cf2 + cf3 + cf4 + cf5 + cf6 - 1, data = sim_data) mean(apply(design_mt, 1, function(x) { -10 - sum(c(2, 2, 3, -1, 2, 2) * x) - w * (0.1 - 0.1 * x[1] + 0.1 * x[4] + 0.1 * x[5] + 0.1 * x[3] ^ 2) + 0.13 ^ 2 * w ^ 3 })) } plot_fun <- function(object, ...) { # extract data tmp_data <- data.frame(w_vals = object$posterior$w, mean_vals = object$posterior$mean, sd_vals = object$posterior$sd) g1 <- ggplot2::ggplot(tmp_data) + ggplot2::geom_ribbon(ggplot2::aes(.data$w_vals, y = .data$mean_vals, ymin = .data$mean_vals - 1.96 * .data$sd_vals, ymax = .data$mean_vals + 1.96 * .data$sd_vals), fill = \"blue\", alpha = 0.25) + ggplot2::geom_line(ggplot2::aes(.data$w_vals, .data$mean_vals), color = \"blue\", size = 1) + ggplot2::theme_bw() + ggplot2::ggtitle(\"Estimated CERF (gp) with credible band (1.96sd)\") + ggplot2::xlab(\"Exposure level\") + ggplot2::ylab(\"Population average counterfactual outcome\") return(g1) } erf_tru_normal <- sapply(seq(0, 20, 0.1), function(w) tru_R(w, data_sim_normal)) erf_tru_t <- sapply(seq(0, 20, 0.1), function(w) tru_R(w, data_sim_t))"},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Full-Gaussian-Processes.html","id":"train-gps-model","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"Train GPS Model","title":"Standard Gaussian Processes","text":"GPCERF first convert covariate values single composite score (GPS) use fit Gaussian processes. use GPS estimation function CasaulGPS (see ) get GPS model maps covariates GPS. use estimate_cerf_gp estimate ERF exposure w. estimate ERF w = seq(0,20,0.1). estimated ERF well pointwise 95% credible band visualized call plot. also plot actual ERF top estimated ERF.","code":"gps_m_normal <- estimate_gps(cov_mt = data_sim_normal[, -(1:2)], w_all = data_sim_normal$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) #> Loading required package: nnls gps_m_t <- estimate_gps(cov_mt = data_sim_t[, -(1:2)], w_all = data_sim_t$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Full-Gaussian-Processes.html","id":"normally-distributed-exposure","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"Normally Distributed Exposure","title":"Standard Gaussian Processes","text":"can see estimated curve follows true ERF closely 95% credible band completely covers true ERF.","code":"w_all <- seq(0, 20, 0.1) gp_res_normal <- estimate_cerf_gp(data_sim_normal, w_all, gps_m_normal, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, tune_app = \"all\"), nthread = 1) plot_fun(gp_res_normal) + geom_line(data = data.frame(w = w_all, y = erf_tru_normal), aes(x = w, y = y, color = \"True\"), size = 1.5) #> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. #> ℹ Please use `linewidth` instead. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was #> generated."},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Full-Gaussian-Processes.html","id":"t-distributed-exposure","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"T-distributed Exposure","title":"Standard Gaussian Processes","text":"results look similar case exposure normally distributed. difference might exposure t-distributed, estimated curve tends less smooth.","code":"gp_res_t <- estimate_cerf_gp(data_sim_t, w_all, gps_m_t, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, tune_app = \"all\"), nthread = 1) plot_fun(gp_res_t) + geom_line(data = data.frame(w = w_all, y = erf_tru_t), aes(x = w, y = y, color = \"True\"), size = 1.5)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/GPCERF.html","id":"installation","dir":"Articles","previous_headings":"","what":"Installation","title":"GPCERF","text":"","code":"library(\"devtools\") install_github(\"NSAPH-Software/GPCERF\", ref = \"main\") library(\"GPCERF\")"},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/GPCERF.html","id":"estimating-gps-values","dir":"Articles","previous_headings":"Usage","what":"Estimating GPS values","title":"GPCERF","text":"Input parameters: cov_mt Covariate matrix containing covariates. row represents sample, column covariate.w_all vector observed exposure level.","code":"mydata <- generate_synthetic_data() gps_m <- estimate_gps(cov_mt = mydata[, c(\"cf1\", \"cf2\", \"cf3\", \"cf4\", \"cf5\", \"cf6\")], w_all = mydata$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) #> Loading required package: nnls"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/GPCERF.html","id":"estimating-exposure-response-using-gaussian-processes","dir":"Articles","previous_headings":"Usage","what":"Estimating exposure response using Gaussian Processes","title":"GPCERF","text":"Input parameters: data data.frame observation data. - Column 1: Outcome (Y) - Column 2: Exposure treatment (w) - Column 3~m: Confounders (C)w vector exposure level compute CERF.gps_m data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred) - Column 3: Standard deviation e_gps (e_gps_std)params list parameters required run process. - alpha: scaling factor GPS value. - beta: scaling factor exposure value. - g_sigma: scaling factor kernel function (gamma/sigma). - tune_app: tuning approach. Available approaches: - : try combinations hyperparameters. alpha, beta, g_sigma can vector parameters. nthread integer value represents number threads used shared memory system.kernel_fn kernel function. default value Gaussian kernel.","code":"set.seed(129) sim_data <- generate_synthetic_data(sample_size = 400, gps_spec = 3) # Estimate GPS function gps_m <- estimate_gps(cov_mt = sim_data[, -(1:2)], w_all = sim_data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = TRUE) # exposure values q1 <- stats::quantile(sim_data$treat, 0.05) q2 <- stats::quantile(sim_data$treat, 0.95) w_all <- seq(q1, q2, 1) params_lst <- list(alpha = c(0.05), beta = c(12), g_sigma = c(0.1), tune_app = \"all\") cerf_gp_obj <- estimate_cerf_gp(sim_data, w_all, gps_m, params = params_lst, outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) summary(cerf_gp_obj) #> GPCERF standard Gaussian grocess exposure response function object #> #> Optimal hyper parameters(#trial: 1): #> alpha = 0.05 beta = 12 g_sigma = 0.1 #> #> Optimal covariate balance: #> cf1 = 0.080 #> cf2 = 0.081 #> cf3 = 0.111 #> cf4 = 0.119 #> cf5 = 0.084 #> cf6 = 0.104 #> #> Original covariate balance: #> cf1 = 0.185 #> cf2 = 0.161 #> cf3 = 0.106 #> cf4 = 0.208 #> cf5 = 0.246 #> cf6 = 0.283 #> ----***---- plot(cerf_gp_obj)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/GPCERF.html","id":"estimating-exposure-response-using-nearest-neighbor-gaussian-processes","dir":"Articles","previous_headings":"Usage","what":"Estimating exposure response using nearest-neighbor Gaussian Processes","title":"GPCERF","text":"Input parameters: data data.frame observation data.w vector exposure level compute CERF.gps_m data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred) - Column 3: Standard deviation e_gps (e_gps_std)params list parameters required run process. - alpha: scaling factor GPS value. - beta: scaling factor exposure value. - g_sigma: scaling factor kernel function (gamma/sigma). - tune_app: tuning approach. Available approaches: - : try combinations hyperparameters. - n_neighbors: Number nearest neighbors one side. - block_size: Number samples included computation block. Mainly used balance speed memory requirement. Larger faster, requires memory. alpha, beta, g_sigma can vector parameters. outcome_col outcome column name data. treatment_col treatment column name data. covariates_col Covariates columns name data. nthread integer value represents number threads used shared memory system.kernel_fn kernel function. default value Gaussian kernel.","code":"set.seed(19) sim_data <- generate_synthetic_data(sample_size = 1000, gps_spec = 3) # Estimate GPS function gps_m <- estimate_gps(cov_mt = sim_data[, -(1:2)], w_all = sim_data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = TRUE) # exposure values q1 <- stats::quantile(sim_data$treat, 0.05) q2 <- stats::quantile(sim_data$treat, 0.95) w_all <- seq(q1, q2, 1) params_lst <- list(alpha = c(0.05), beta = c(12), g_sigma = c(0.1), tune_app = \"all\", n_neighbor = 20, block_size = 1e4) cerf_nngp_obj <- estimate_cerf_nngp(sim_data, w_all, gps_m, params = params_lst, outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) summary(cerf_nngp_obj) #> GPCERF nearest neighbore Gaussian process exposure response function object summary #> #> Optimal hyper parameters(#trial: 1): #> alpha = 0.05 beta = 12 g_sigma = 0.1 #> #> Optimal covariate balance: #> cf1 = 0.118 #> cf2 = 0.103 #> cf3 = 0.105 #> cf4 = 0.089 #> cf5 = 0.159 #> cf6 = 0.149 #> #> Original covariate balance: #> cf1 = 0.136 #> cf2 = 0.148 #> cf3 = 0.105 #> cf4 = 0.228 #> cf5 = 0.184 #> cf6 = 0.280 #> ----***---- plot(cerf_nngp_obj)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/GPCERF.html","id":"logging","dir":"Articles","previous_headings":"Usage","what":"Logging","title":"GPCERF","text":"GPCERF package logs internal activities screen GPCERF.log file. Users can change logging file name (path) logging threshold. logging mechanism different thresholds (see logger package). two important thresholds INFO DEBUG levels. former, default level, logs general information process. latter, activated, logs detailed information can used debugging purposes. log file located source file location appended.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Nearest-neighbor-Gaussian-Processes.html","id":"generate-synthetic-data","dir":"Articles","previous_headings":"","what":"Generate Synthetic Data","title":"Nearest-neighbor Gaussian Processes","text":"first generate synthetic dataset six covariates, one continuous exposure one outcome. consider two types conditional distributions (normal student’s t) exposure given covariates. details synthetic data generation, see document. use function tru_R derive actual ERF population w=seq(0,20,0.1).","code":"set.seed(1) # Generate dataset with a normally distributed exposure given covariates data_sim_normal <- generate_synthetic_data(sample_size = 500, outcome_sd = 10, gps_spec = 1) # Generate dataset with a t-distributed with 2df exposure given covariates data_sim_t <- generate_synthetic_data(sample_size = 500, outcome_sd = 10, gps_spec = 2) tru_R <- function(w, sim_data) { design_mt <- model.matrix(~cf1 + cf2 + cf3 + cf4 + cf5 + cf6 - 1, data = sim_data) mean(apply(design_mt, 1, function(x) { -10 - sum(c(2, 2, 3, -1, 2, 2) * x) - w * (0.1 - 0.1 * x[1] + 0.1 * x[4] + 0.1 * x[5] + 0.1 * x[3] ^ 2) + 0.13 ^ 2 * w ^ 3 })) } plot_fun <- function(object, ...) { tmp_data <- data.frame(w_vals = object$posterior$w, mean_vals = object$posterior$mean, sd_vals = object$posterior$sd) g1 <- ggplot2::ggplot(tmp_data) + ggplot2::geom_ribbon(ggplot2::aes(.data$w_vals, y = .data$mean_vals, ymin = .data$mean_vals - 1.96 * .data$sd_vals, ymax = .data$mean_vals + 1.96 * .data$sd_vals), fill = \"#FC4E07\", alpha = 0.25) + ggplot2::geom_line(ggplot2::aes(.data$w_vals, .data$mean_vals), color = \"#FC4E07\", size = 1) + ggplot2::theme_bw() + ggplot2::ggtitle(\"Estimated CERF (nngp) with credible band (1.96sd)\") + ggplot2::xlab(\"Exposure level\") + ggplot2::ylab(\"Population average counterfactual outcome\") return(g1) } erf_tru_normal <- sapply(seq(0, 20, 0.1), function(w) tru_R(w, data_sim_normal)) erf_tru_t <- sapply(seq(0, 20, 0.1), function(w) tru_R(w, data_sim_t))"},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Nearest-neighbor-Gaussian-Processes.html","id":"train-gps-model","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"Train GPS Model","title":"Nearest-neighbor Gaussian Processes","text":"GPCERF first convert covariate values single composite score (GPS) use fit Gaussian processes. use GPS estimation function CausalGPS (see ) get GPS model maps covariates GPS. use estimate_cerf_nngp estimate ERF exposure w. estimate ERF w = seq(0,20,0.1). estimated ERF well pointwise 95% credible band visualized call plot. also plot actual ERF top estimated ERF.","code":"gps_m_normal <- estimate_gps(cov_mt = data_sim_normal[, -(1:2)], w_all = data_sim_normal$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) #> Loading required package: nnls gps_m_t <- estimate_gps(cov_mt = data_sim_t[, -(1:2)], w_all = data_sim_t$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Nearest-neighbor-Gaussian-Processes.html","id":"normally-distributed-exposure","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"Normally Distributed Exposure","title":"Nearest-neighbor Gaussian Processes","text":"can see estimated curve follows true ERF closely 95% credible band completely covers true ERF. running time much smaller standard GP approach.","code":"w_all <- seq(0, 20, 0.1) nngp_res_normal <- estimate_cerf_nngp(data_sim_normal, w_all, gps_m_normal, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, n_neighbor = 20, block_size = 50, tune_app = \"all\"), outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) plot_fun(nngp_res_normal) + geom_line(data = data.frame(w = w_all, y = erf_tru_normal), aes(x = w, y = y, color = \"True\"), size = 1.5) #> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. #> ℹ Please use `linewidth` instead. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was #> generated."},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Nearest-neighbor-Gaussian-Processes.html","id":"t-distributed-exposure","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"T-distributed Exposure","title":"Nearest-neighbor Gaussian Processes","text":"results look similar case exposure normally distributed. difference might exposure t-distributed, estimated curve tends less smooth.","code":"nngp_res_t <- estimate_cerf_nngp(data_sim_t, w_all, gps_m_t, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, n_neighbor = 20, block_size = 50, tune_app = \"all\"), outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) plot_fun(nngp_res_t) + geom_line(data = data.frame(w = w_all, y = erf_tru_t), aes(x = w, y = y, color = \"True\"), size = 1.5)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Standard-Gaussian-Processes.html","id":"generate-synthetic-data","dir":"Articles","previous_headings":"","what":"Generate Synthetic Data","title":"Standard Gaussian Processes","text":"first generate synthetic dataset six covariates, one continuous exposure one outcome. consider two types conditional distributions (normal student’s t) exposure given covariates. details synthetic data generation, see document. use function tru_R derive actual ERF population w=seq(0,20,0.1).","code":"set.seed(134) # Generate dataset with a normally distributed exposure given covariates data_sim_normal <- generate_synthetic_data(sample_size = 400, outcome_sd = 10, gps_spec = 1) # Generate dataset with a t-distributed with 2df exposure given covariates data_sim_t <- generate_synthetic_data(sample_size = 400, outcome_sd = 10, gps_spec = 2) tru_R <- function(w, sim_data) { design_mt <- model.matrix(~cf1 + cf2 + cf3 + cf4 + cf5 + cf6 - 1, data = sim_data) mean(apply(design_mt, 1, function(x) { -10 - sum(c(2, 2, 3, -1, 2, 2) * x) - w * (0.1 - 0.1 * x[1] + 0.1 * x[4] + 0.1 * x[5] + 0.1 * x[3] ^ 2) + 0.13 ^ 2 * w ^ 3 })) } plot_fun <- function(object, ...) { # extract data tmp_data <- data.frame(w_vals = object$posterior$w, mean_vals = object$posterior$mean, sd_vals = object$posterior$sd) g1 <- ggplot2::ggplot(tmp_data) + ggplot2::geom_ribbon(ggplot2::aes(.data$w_vals, y = .data$mean_vals, ymin = .data$mean_vals - 1.96 * .data$sd_vals, ymax = .data$mean_vals + 1.96 * .data$sd_vals), fill = \"blue\", alpha = 0.25) + ggplot2::geom_line(ggplot2::aes(.data$w_vals, .data$mean_vals), color = \"blue\", size = 1) + ggplot2::theme_bw() + ggplot2::ggtitle(\"Estimated CERF (gp) with credible band (1.96sd)\") + ggplot2::xlab(\"Exposure level\") + ggplot2::ylab(\"Population average counterfactual outcome\") return(g1) } erf_tru_normal <- sapply(seq(0, 20, 0.1), function(w) tru_R(w, data_sim_normal)) erf_tru_t <- sapply(seq(0, 20, 0.1), function(w) tru_R(w, data_sim_t))"},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Standard-Gaussian-Processes.html","id":"train-gps-model","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"Train GPS Model","title":"Standard Gaussian Processes","text":"GPCERF first convert covariate values single composite score (GPS) use fit Gaussian processes. use GPS estimation function CausalGPS (see ) get GPS model maps covariates GPS. use estimate_cerf_gp estimate ERF exposure w. estimate ERF w = seq(0,20,0.1). estimated ERF well pointwise 95% credible band visualized call plot. also plot actual ERF top estimated ERF.","code":"gps_m_normal <- estimate_gps(cov_mt = data_sim_normal[, -(1:2)], w_all = data_sim_normal$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) #> Loading required package: nnls gps_m_t <- estimate_gps(cov_mt = data_sim_t[, -(1:2)], w_all = data_sim_t$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE)"},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Standard-Gaussian-Processes.html","id":"normally-distributed-exposure","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"Normally Distributed Exposure","title":"Standard Gaussian Processes","text":"can see estimated curve follows true ERF closely 95% credible band completely covers true ERF.","code":"w_all <- seq(0, 20, 0.1) gp_res_normal <- estimate_cerf_gp(data_sim_normal, w_all, gps_m_normal, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, tune_app = \"all\"), outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) plot_fun(gp_res_normal) + geom_line(data = data.frame(w = w_all, y = erf_tru_normal), aes(x = w, y = y, color = \"True\"), size = 1.5) #> Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0. #> ℹ Please use `linewidth` instead. #> This warning is displayed once every 8 hours. #> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was #> generated."},{"path":"https://NSAPH-Software.github.io/GPCERF/articles/Standard-Gaussian-Processes.html","id":"t-distributed-exposure","dir":"Articles","previous_headings":"Estimate ERF with standard Gaussian Processes","what":"T-distributed Exposure","title":"Standard Gaussian Processes","text":"results look similar case exposure normally distributed. difference might exposure t-distributed, estimated curve tends less smooth.","code":"gp_res_t <- estimate_cerf_gp(data_sim_t, w_all, gps_m_t, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, tune_app = \"all\"), outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) plot_fun(gp_res_t) + geom_line(data = data.frame(w = w_all, y = erf_tru_t), aes(x = w, y = y, color = \"True\"), size = 1.5)"},{"path":"https://NSAPH-Software.github.io/GPCERF/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Naeem Khoshnevis. Author, maintainer. HUIT Boyu Ren. Author. McLean Hospital Tanujit Dey. Contributor. HMS Danielle Braun. Author. HSPH","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Khoshnevis N, Ren B, Braun D (2023). GPCERF: Gaussian Processes Estimating Causal Exposure Response Curves. R package version 0.2.1, https://CRAN.R-project.org/package=GPCERF.","code":"@Manual{, title = {GPCERF: Gaussian Processes for Estimating Causal Exposure Response Curves}, author = {Naeem Khoshnevis and Boyu Ren and Danielle Braun}, year = {2023}, note = {R package version 0.2.1}, url = {https://CRAN.R-project.org/package=GPCERF}, }"},{"path":[]},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/index.html","id":"summary","dir":"","previous_headings":"","what":"Summary","title":"Gaussian Process (GP) approach for nonparametric modeling.","text":"Gaussian Process (GP) approach nonparametric modeling. Provides non-parametric Bayesian framework based Gaussian process priors estimating causal effects continuous exposure detecting change points causal exposure response curves using observational data.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/index.html","id":"references","dir":"","previous_headings":"","what":"References","title":"Gaussian Process (GP) approach for nonparametric modeling.","text":"Ren, B., Wu, X., Braun, D., Pillai, N. Dominici, F., 2021. Bayesian modeling exposure response curve via gaussian processes: Causal effects exposure air pollution health outcomes. arXiv preprint arXiv:2105.03454.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/GPCERF-package.html","id":null,"dir":"Reference","previous_headings":"","what":"The 'GPCERF' package. — GPCERF-package","title":"The 'GPCERF' package. — GPCERF-package","text":"Provides non-parametric Bayesian framework based Gaussian process priors estimating causal effects continuous exposure detecting change points causal exposure response curves using observational data.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/GPCERF-package.html","id":"references","dir":"Reference","previous_headings":"","what":"References","title":"The 'GPCERF' package. — GPCERF-package","text":"Ren, B., Wu, X., Braun, D., Pillai, N. Dominici, F., 2021. Bayesian modeling exposure response curve via gaussian processes: Causal effects exposure air pollution health outcomes. arXiv preprint arXiv:2105.03454.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/GPCERF-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"The 'GPCERF' package. — GPCERF-package","text":"Naeem Khoshnevis Boyu Ren Danielle Braun","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"A helper function for cerf_gp object — autoplot.cerf_gp","title":"A helper function for cerf_gp object — autoplot.cerf_gp","text":"helper function plot cerf_gp object using ggplot2 package.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A helper function for cerf_gp object — autoplot.cerf_gp","text":"","code":"# S3 method for cerf_gp autoplot(object, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A helper function for cerf_gp object — autoplot.cerf_gp","text":"object cerf_gp object. ... Additional arguments passed customize plot.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A helper function for cerf_gp object — autoplot.cerf_gp","text":"Returns ggplot object.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_nngp.html","id":null,"dir":"Reference","previous_headings":"","what":"A helper function for cerf_nngp object — autoplot.cerf_nngp","title":"A helper function for cerf_nngp object — autoplot.cerf_nngp","text":"helper function plot cerf_nngp object using ggplot2 package.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_nngp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"A helper function for cerf_nngp object — autoplot.cerf_nngp","text":"","code":"# S3 method for cerf_nngp autoplot(object, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_nngp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"A helper function for cerf_nngp object — autoplot.cerf_nngp","text":"object cerf_nngp object. ... Additional arguments passed customize plot.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/autoplot.cerf_nngp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"A helper function for cerf_nngp object — autoplot.cerf_nngp","text":"Returns ggplot object.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/calc_ac.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate covariate balance — calc_ac","title":"Calculate covariate balance — calc_ac","text":"Calculates weighted correlation list covariates exposure. covariance function GP defines weights.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/calc_ac.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate covariate balance — calc_ac","text":"","code":"calc_ac(w, X, weights)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/calc_ac.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate covariate balance — calc_ac","text":"w vector exposure values across subjects. X matrix covariate values. Subjects rows covariates columns. weights vector weights assigned subjects based trained GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/calc_ac.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate covariate balance — calc_ac","text":"vector correlations w column X.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate derivatives of CERF for nnGP — compute_deriv_nn","title":"Calculate derivatives of CERF for nnGP — compute_deriv_nn","text":"Calculates posterior mean derivative CERF given exposure level nnGP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate derivatives of CERF for nnGP — compute_deriv_nn","text":"","code":"compute_deriv_nn( w, w_obs, gps_m, y_obs, hyperparam, n_neighbor, block_size, kernel_fn = function(x) exp(-x), kernel_deriv_fn = function(x) -exp(-x) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate derivatives of CERF for nnGP — compute_deriv_nn","text":"w scalar exposure level interest. w_obs vector observed exposure levels samples. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FALSE y_obs vector observed outcome values. hyperparam vector hyper-parameters GP model. n_neighbor number nearest neighbors one side. block_size number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory. kernel_fn covariance function. input square Euclidean distance. kernel_deriv_fn partial derivative covariance function. input square Euclidean distance.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate derivatives of CERF for nnGP — compute_deriv_nn","text":"scalar estimated derivative CERF w nnGP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_weights_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate derivatives of CERF — compute_deriv_weights_gp","title":"Calculate derivatives of CERF — compute_deriv_weights_gp","text":"Calculates weights assigned observed outcome deriving posterior mean first derivative CERF given exposure level.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_weights_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate derivatives of CERF — compute_deriv_weights_gp","text":"","code":"compute_deriv_weights_gp( w, w_obs, gps_m, hyperparam, kernel_fn = function(x) exp(-x), kernel_deriv_fn = function(x) -exp(-x) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_weights_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate derivatives of CERF — compute_deriv_weights_gp","text":"w scalar exposure level interest. w_obs vector observed exposure levels samples. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FALSE hyperparam vector hyper-parameters GP model. kernel_fn covariance function. kernel_deriv_fn partial derivative covariance function.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_deriv_weights_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate derivatives of CERF — compute_deriv_weights_gp","text":"vector weights samples, based posterior mean derivative CERF exposure level interest calculated.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_inverse.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute matrix inverse for a covariate matrix — compute_inverse","title":"Compute matrix inverse for a covariate matrix — compute_inverse","text":"Computes inverse covariate matrix using Choleski decomposition.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_inverse.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute matrix inverse for a covariate matrix — compute_inverse","text":"","code":"compute_inverse(mtrx)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_inverse.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute matrix inverse for a covariate matrix — compute_inverse","text":"mtrx n * n covariate matrix","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_inverse.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute matrix inverse for a covariate matrix — compute_inverse","text":"matrix represent inverse input matrix.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_m_sigma.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute mean, credible interval, and covariate balance in standard Gaussian\nprocess (GP) — compute_m_sigma","title":"Compute mean, credible interval, and covariate balance in standard Gaussian\nprocess (GP) — compute_m_sigma","text":"Calculates induced covariate balance associated one hyper-parameter configuration standard GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_m_sigma.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute mean, credible interval, and covariate balance in standard Gaussian\nprocess (GP) — compute_m_sigma","text":"","code":"compute_m_sigma( hyperparam, outcome_data, treatment_data, covariates_data, w, gps_m, tuning, kernel_fn = function(x) exp(-x^2) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_m_sigma.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute mean, credible interval, and covariate balance in standard Gaussian\nprocess (GP) — compute_m_sigma","text":"hyperparam vector values hyper-parameters. First element: alpha Second element: beta Third element: g_sigma (gamma / sigma) outcome_data vector outcome data. treatment_data vector treatment data. covariates_data data frame covariates data. w vector exposure levels CERF estimated. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE tuning function used parameter tuning (default = TRUE) estimation (FALSE) kernel_fn covariance function GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_m_sigma.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute mean, credible interval, and covariate balance in standard Gaussian\nprocess (GP) — compute_m_sigma","text":"list containing two elements: vector absolute weighted correlation covariate exposure, metric covariate balance estimated CERF w_all based hyper-parameter values param.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_m_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate posterior means for nnGP model — compute_posterior_m_nn","title":"Calculate posterior means for nnGP model — compute_posterior_m_nn","text":"Calculates posterior mean point CERF based nnGP model. function also returns weights assigned nearest neighbors calculating posterior mean.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_m_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate posterior means for nnGP model — compute_posterior_m_nn","text":"","code":"compute_posterior_m_nn( hyperparam, w, gps_w, obs_ord, y_obs_ord, kernel_fn = function(x) exp(-x^2), n_neighbor = 10, block_size = 10000 )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_m_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate posterior means for nnGP model — compute_posterior_m_nn","text":"hyperparam set hyperparameters GP model. w scaler representing exposure level point interest CERF. gps_w GPS samples exposure levels set w. obs_ord matrix two columns. First column observed exposure levels samples; second GPS observed exposure levels. rows ascending order first column. y_obs_ord vector observed outcome values. vector ordered obs_ord. kernel_fn covariance function GP. n_neighbor number nearest neighbors one side. block_size Number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_m_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate posterior means for nnGP model — compute_posterior_m_nn","text":"TODO: first column selected index second column weight. two-column matrix. first column weights assigned nearest neighbor. second column corresponding observed outcome value. weight last row matrix NA observed outcome value estimated posterior mean CERF point w, weighted sum observed outcome values neighbors.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_sd_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate posterior standard deviations for nnGP model — compute_posterior_sd_nn","title":"Calculate posterior standard deviations for nnGP model — compute_posterior_sd_nn","text":"Calculates posterior standard deviation point CERF based nnGP model.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_sd_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate posterior standard deviations for nnGP model — compute_posterior_sd_nn","text":"","code":"compute_posterior_sd_nn( hyperparam, w, gps_w, obs_ord, sigma2, kernel_fn = function(x) exp(-x^2), n_neighbor = 10, block_size = 10000 )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_sd_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate posterior standard deviations for nnGP model — compute_posterior_sd_nn","text":"hyperparam values hyperparameters GP model. w exposure level point interest CERF. gps_w GPS samples exposure levels set w. obs_ord matrix two columns. first column observed exposure levels samples; second GPS observed exposure levels. rows ascending order first column. sigma2 scaler representing sigma^2. kernel_fn covariance function GP. n_neighbor Number nearest neighbors one side. block_size Number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_posterior_sd_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate posterior standard deviations for nnGP model — compute_posterior_sd_nn","text":"posterior standard deviation estimated CERF w.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Detect change-point in standard GP — compute_rl_deriv_gp","title":"Detect change-point in standard GP — compute_rl_deriv_gp","text":"Calculates posterior mean difference left- right-derivatives exposure level detection change points.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Detect change-point in standard GP — compute_rl_deriv_gp","text":"","code":"compute_rl_deriv_gp( w, w_obs, y_obs, gps_m, hyperparam, kernel_fn = function(x) exp(-x), kernel_deriv_fn = function(x) -exp(-x) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Detect change-point in standard GP — compute_rl_deriv_gp","text":"w scalar exposure level interest. w_obs vector observed exposure levels samples. y_obs vector observed outcome values samples. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE hyperparam vector hyper-parameters GP model. kernel_fn covariance function. kernel_deriv_fn partial derivative covariance function.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Detect change-point in standard GP — compute_rl_deriv_gp","text":"numeric value posterior mean difference two one-sided derivatives.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_gp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Detect change-point in standard GP — compute_rl_deriv_gp","text":"","code":"# \\donttest{ set.seed(847) data <- generate_synthetic_data(sample_size = 100) gps_m <- estimate_gps(cov_mt = data[,-(1:2)], w_all = data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) #> Loading required package: nnls wi <- 8.6 val <- compute_rl_deriv_gp(w = wi, w_obs = data$treat, y_obs = data$Y, gps_m = gps_m, hyperparam = c(1,1,2)) # }"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate right minus left derivatives for change-point detection in nnGP — compute_rl_deriv_nn","title":"Calculate right minus left derivatives for change-point detection in nnGP — compute_rl_deriv_nn","text":"Calculates posterior mean difference left- right-derivatives exposure level detection change points. nnGP approximation used.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate right minus left derivatives for change-point detection in nnGP — compute_rl_deriv_nn","text":"","code":"compute_rl_deriv_nn( w, w_obs, gps_m, y_obs, hyperparam, n_neighbor, block_size, kernel_fn = function(x) exp(-x), kernel_deriv_fn = function(x) -exp(-x) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate right minus left derivatives for change-point detection in nnGP — compute_rl_deriv_nn","text":"w scalar exposure level interest. w_obs vector observed exposure levels samples. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE y_obs vector observed outcome values. hyperparam vector hyper-parameters GP model. n_neighbor number nearest neighbors one side. block_size number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory. kernel_fn covariance function. input square Euclidean distance. kernel_deriv_fn partial derivative covariance function. input square Euclidean distance.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate right minus left derivatives for change-point detection in nnGP — compute_rl_deriv_nn","text":"numeric value posterior mean difference two one-sided derivatives.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_rl_deriv_nn.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Calculate right minus left derivatives for change-point detection in nnGP — compute_rl_deriv_nn","text":"","code":"# \\donttest{ set.seed(325) data <- generate_synthetic_data(sample_size = 200) gps_m <- estimate_gps(cov_mt = data[,-(1:2)], w_all = data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) wi <- 12.2 deriv_val <- compute_rl_deriv_nn(w = wi, w_obs = data$treat, gps_m = gps_m, y_obs = data$Y, hyperparam = c(0.2,0.4,1.2), n_neighbor = 20, block_size = 10) # }"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_sd_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute posterior credible interval — compute_sd_gp","title":"Compute posterior credible interval — compute_sd_gp","text":"Computes posterior credible interval requested exposure level.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_sd_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute posterior credible interval — compute_sd_gp","text":"","code":"compute_sd_gp( w, scaled_obs, hyperparam, sigma, gps_m, kernel_fn = function(x) exp(-x^2) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_sd_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute posterior credible interval — compute_sd_gp","text":"w scalar exposure level interest. scaled_obs matrix two columns. First column scaled GPS value samples (GPS * 1/sqrt(alpha)) Second column scaled exposure value samples (w * 1/sqrt(beta)) hyperparam vector hyper-parameters GP. First element: alpha Second element: beta Third element: gamma/sigma sigma scaler represents noise. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE kernel_fn covariance function GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_sd_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute posterior credible interval — compute_sd_gp","text":"Posterior credible interval (scaler) requested exposure level (w).","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_w_corr.html","id":null,"dir":"Reference","previous_headings":"","what":"Compute weighted covariate balance — compute_w_corr","title":"Compute weighted covariate balance — compute_w_corr","text":"Computes weighted covariate balance given data sets.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_w_corr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compute weighted covariate balance — compute_w_corr","text":"","code":"compute_w_corr(w, covariate, weight)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_w_corr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compute weighted covariate balance — compute_w_corr","text":"w vector observed continuous exposure variable. covariate data frame observed covariates variable. weight vector weights.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_w_corr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compute weighted covariate balance — compute_w_corr","text":"function returns list saved measure related covariate balance absolute_corr: absolute correlations pre-exposure covairates; mean_absolute_corr: average absolute correlations pre-exposure covairates.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_w_corr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Compute weighted covariate balance — compute_w_corr","text":"","code":"set.seed(639) n <- 100 mydata <- generate_synthetic_data(sample_size=100) year <- sample(x=c(\"2001\",\"2002\",\"2003\",\"2004\",\"2005\"),size = n, replace = TRUE) region <- sample(x=c(\"North\", \"South\", \"East\", \"West\"),size = n, replace = TRUE) mydata$year <- as.factor(year) mydata$region <- as.factor(region) mydata$cf5 <- as.factor(mydata$cf5) cor_val <- compute_w_corr(mydata[,2], mydata[, 3:length(mydata)], runif(n)) print(cor_val$mean_absolute_corr) #> [1] 0.1461331"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_weight_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Calculate weights for estimation of a point on CERF — compute_weight_gp","title":"Calculate weights for estimation of a point on CERF — compute_weight_gp","text":"Calculates weights observed outcomes used estimate posterior mean CERF given exposure level.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_weight_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Calculate weights for estimation of a point on CERF — compute_weight_gp","text":"","code":"compute_weight_gp( w, w_obs, scaled_obs, hyperparam, inv_sigma_obs, gps_m, est_sd = FALSE, kernel_fn = function(x) exp(-x^2) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_weight_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Calculate weights for estimation of a point on CERF — compute_weight_gp","text":"w scalar exposure level interest. w_obs vector observed exposure levels samples. scaled_obs matrix two columns. First column scaled GPS value samples (GPS * 1 / sqrt(alpha)) Second column scaled exposure value samples (w * 1/sqrt(beta)) hyperparam vector hyper-parameters GP. First element: alpha Second element: beta Third element: gamma/sigma inv_sigma_obs Inverse covariance matrix observed samples. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE est_sd posterior se computed (default=FALSE) kernel_fn covariance function GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/compute_weight_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Calculate weights for estimation of a point on CERF — compute_weight_gp","text":"list two elements, weight standard deviation.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","title":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","text":"Estimates conditional exposure response function (cerf) using Gaussian Process (gp). function tune best match (lowest covariate balance) provided set hyperparameters.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","text":"","code":"estimate_cerf_gp( data, w, gps_m, params, outcome_col, treatment_col, covariates_col, nthread = 1, kernel_fn = function(x) exp(-x^2) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","text":"data data.frame observation data. w vector exposure level compute CERF (please also see notes). gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE params list parameters required run process. parameters include: alpha: scaling factor GPS value. beta: scaling factor exposure value. g_sigma: scaling factor kernel function (gamma/sigma). tune_app: tuning approach. Available approaches: : try combinations hyperparameters. alpha, beta, g_sigma can vector parameters. outcome_col outcome column name data. treatment_col treatment column name data. covariates_col Covariates columns name data. nthread integer value represents number threads used internal packages. kernel_fn kernel function. default value Gaussian Kernel.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","text":"cerf_gp object includes following values: w, vector exposure levels. pst_mean, Computed mean w vector. pst_sd, Computed credible interval w vector.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_gp.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","text":"Please note w vector representing grid exposure levels CERF estimated. grid can include observed hypothetical values exposure variable. purpose defining grid provide structured set points across exposure spectrum estimating CERF. approach essential nonparametric models like Gaussian Processes (GPs), CERF evaluated specific points understand relationship exposure outcome variables across continuum. facilitates comprehensive analysis allowing practitioners examine effect varying exposure levels, including directly observed dataset.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_gp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the conditional exposure response function using Gaussian process — estimate_cerf_gp","text":"","code":"# \\donttest{ set.seed(129) data <- generate_synthetic_data(sample_size = 100, gps_spec = 3) # Estimate GPS function gps_m <- estimate_gps(cov_mt = data[,-(1:2)], w_all = data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) # exposure values w_all <- seq(0,10,1) cerf_gp_obj <- estimate_cerf_gp(data, w_all, gps_m, params = list(alpha = c(0.1), beta=0.2, g_sigma = 1, tune_app = \"all\"), outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) # }"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_nngp.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","title":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","text":"Estimates conditional exposure response function (cerf) using nearest neighbor (nn) Gaussian Process (gp). function tune best match (lowest covariate balance) provided set hyperparameters.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_nngp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","text":"","code":"estimate_cerf_nngp( data, w, gps_m, params, outcome_col, treatment_col, covariates_col, kernel_fn = function(x) exp(-x^2), nthread = 1 )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_nngp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","text":"data data.frame observation data. w vector exposure level compute CERF (please also see notes). gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE params list parameters required run process. parameters include: alpha: scaling factor GPS value. beta: scaling factor exposure value. g_sigma: scaling factor kernel function (gamma/sigma). tune_app: tuning approach. Available approaches: : try combinations hyperparameters. n_neighbor: Number nearest neighbors one side. block_size: Number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory. alpha, beta, g_sigma can vector parameters. outcome_col outcome column name data. treatment_col treatment column name data. covariates_col Covariates columns name data. kernel_fn kernel function. default value Gaussian Kernel. nthread integer value represents number threads used internal packages.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_nngp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","text":"cerf_nngp object includes following values: w, vector exposure levels. pst_mean, computed mean w vector. pst_sd, computed credible interval w vector.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_nngp.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","text":"Please note w vector representing grid exposure levels CERF estimated. grid can include observed hypothetical values exposure variable. purpose defining grid provide structured set points across exposure spectrum estimating CERF. approach essential nonparametric models like Gaussian Processes (GPs), CERF evaluated specific points understand relationship exposure outcome variables across continuum. facilitates comprehensive analysis allowing practitioners examine effect varying exposure levels, including directly observed dataset.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_cerf_nngp.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate the conditional exposure response function using nearest neighbor\nGaussian process — estimate_cerf_nngp","text":"","code":"# \\donttest{ set.seed(19) data <- generate_synthetic_data(sample_size = 120, gps_spec = 3) # Estimate GPS function gps_m <- estimate_gps(cov_mt = data[,-(1:2)], w_all = data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) # exposure values w.all <- seq(0,20,2) cerf_nngp_obj <- estimate_cerf_nngp(data, w.all, gps_m, params = list(alpha = c(0.1), beta = 0.2, g_sigma = 1, tune_app = \"all\", n_neighbor = 20, block_size = 1e4), outcome_col = \"Y\", treatment_col = \"treat\", covariates_col = paste0(\"cf\", seq(1,6)), nthread = 1) # }"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_gps.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate a model for generalized propensity score — estimate_gps","title":"Estimate a model for generalized propensity score — estimate_gps","text":"Estimates model generalized propensity score (GPS) using parametric approach.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_gps.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate a model for generalized propensity score — estimate_gps","text":"","code":"estimate_gps(cov_mt, w_all, sl_lib, dnorm_log)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_gps.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate a model for generalized propensity score — estimate_gps","text":"cov_mt covariate matrix containing covariates. row data sample column covariate. w_all vector observed exposure levels. sl_lib vector SuperLearner's package libraries. dnorm_log Logical, TRUE, probabilities p given log(p).","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_gps.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate a model for generalized propensity score — estimate_gps","text":"data.frame includes: vector estimated GPS observed exposure levels; vector estimated conditional means exposure levels covariates fixed observed values; estimated standard deviation exposure levels vector observed exposure levels.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_gps.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Estimate a model for generalized propensity score — estimate_gps","text":"","code":"# \\donttest{ data <- generate_synthetic_data(sample_size = 200) gps_m <- estimate_gps(cov_mt = data[,-(1:2)], w_all = data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) # }"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_mean_sd_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the CERF with the nnGP model — estimate_mean_sd_nn","title":"Estimate the CERF with the nnGP model — estimate_mean_sd_nn","text":"Estimates posterior mean conditional exposure response function specified exposure levels nnGP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_mean_sd_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the CERF with the nnGP model — estimate_mean_sd_nn","text":"","code":"estimate_mean_sd_nn( hyperparam, sigma2, w_obs, w, y_obs, gps_m, kernel_fn = function(x) exp(-x^2), n_neighbor = 50, block_size = 2000, nthread = 1 )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_mean_sd_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the CERF with the nnGP model — estimate_mean_sd_nn","text":"hyperparam set hyperparameters nnGP. sigma2 scaler representing sigma^2. w_obs vector observed exposure levels. w vector exposure levels CERF estimated. y_obs vector observed outcome values. gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE kernel_fn covariance function GP. n_neighbor number nearest neighbors one side. block_size number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory. nthread integer value represents number threads used internal packages.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_mean_sd_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the CERF with the nnGP model — estimate_mean_sd_nn","text":"vector returned value compute_posterior_sd_nn.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the standard deviation of the nugget term in standard Gaussian\nprocess — estimate_noise_gp","title":"Estimate the standard deviation of the nugget term in standard Gaussian\nprocess — estimate_noise_gp","text":"Estimates standard deviations nugget term standard GP calculating standard deviations residuals.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the standard deviation of the nugget term in standard Gaussian\nprocess — estimate_noise_gp","text":"","code":"estimate_noise_gp(data, sigma_obs, inv_sigma_obs)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the standard deviation of the nugget term in standard Gaussian\nprocess — estimate_noise_gp","text":"data vector outcome data. sigma_obs Covariance matrix observed covariates. inv_sigma_obs Inverse covariance matrix observed covariates.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the standard deviation of the nugget term in standard Gaussian\nprocess — estimate_noise_gp","text":"scalar estimated standard deviation nugget term standard GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Estimate the standard deviation (noise) of the nugget term in nnGP — estimate_noise_nn","title":"Estimate the standard deviation (noise) of the nugget term in nnGP — estimate_noise_nn","text":"Estimates standard deviations nugget term (noise) nnGP calculating standard deviations residuals.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Estimate the standard deviation (noise) of the nugget term in nnGP — estimate_noise_nn","text":"","code":"estimate_noise_nn( hyperparam, w_obs, GPS_obs, y_obs, n_neighbor, nthread, kernel_fn = function(x) exp(-x^2) )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Estimate the standard deviation (noise) of the nugget term in nnGP — estimate_noise_nn","text":"hyperparam vector hyper-parameter values. w_obs vector observed exposure levels. GPS_obs vector estimated GPS evaluated observed exposure levels. y_obs vector observed outcomes. n_neighbor number nearest neighbors one side. nthread number cores used estimation. kernel_fn covariance function GP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/estimate_noise_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Estimate the standard deviation (noise) of the nugget term in nnGP — estimate_noise_nn","text":"scalar estimated standard deviation nugget term nnGP.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/find_optimal_nn.html","id":null,"dir":"Reference","previous_headings":"","what":"Find the optimal hyper-parameter for the nearest neighbor Gaussian process — find_optimal_nn","title":"Find the optimal hyper-parameter for the nearest neighbor Gaussian process — find_optimal_nn","text":"Computes covariate balance combination provided hyper-parameters selects hyper-parameter values minimizes covariate balance.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/find_optimal_nn.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find the optimal hyper-parameter for the nearest neighbor Gaussian process — find_optimal_nn","text":"","code":"find_optimal_nn( w_obs, w, y_obs, gps_m, design_mt, hyperparams = expand.grid(seq(0.5, 4.5, 1), seq(0.5, 4.5, 1), seq(0.5, 4.5, 1)), kernel_fn = function(x) exp(-x^2), n_neighbor = 50, block_size = 2000, nthread = 1 )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/find_optimal_nn.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find the optimal hyper-parameter for the nearest neighbor Gaussian process — find_optimal_nn","text":"w_obs vector observed exposure levels. w vector exposure levels CERF estimated. y_obs vector observed outcomes gps_m S3 gps object including: gps: data.frame GPS vectors. - Column 1: GPS - Column 2: Prediction exposure covariate data sample (e_gps_pred). - Column 3: Standard deviation e_gps (e_gps_std) used_params: - dnorm_log: TRUE FLASE design_mt covariate matrix samples (intercept excluded). hyperparams matrix candidate values hyper-parameters, row contains set values hyper-parameters. kernel_fn covariance function GP. n_neighbor number nearest neighbors one side. block_size number samples included computation block. Mainly used balance speed memory requirement. Larger block_size faster, requires memory. nthread integer value represents number threads used internal packages.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/find_optimal_nn.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find the optimal hyper-parameter for the nearest neighbor Gaussian process — find_optimal_nn","text":"Estimated covariate balance scores grid hyper-parameter values considered hyperparams.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/generate_synthetic_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Generate synthetic data for the GPCERF package — generate_synthetic_data","title":"Generate synthetic data for the GPCERF package — generate_synthetic_data","text":"Generates synthetic data set based different GPS models covariates.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/generate_synthetic_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Generate synthetic data for the GPCERF package — generate_synthetic_data","text":"","code":"generate_synthetic_data( sample_size = 1000, outcome_sd = 10, gps_spec = 1, cova_spec = 1 )"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/generate_synthetic_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Generate synthetic data for the GPCERF package — generate_synthetic_data","text":"sample_size number data samples. outcome_sd Standard deviation used generate outcome synthetic data set. gps_spec numeric value (1-6) indicates GPS model used generate continuous exposure. cova_spec numeric value (1-2) modify covariates.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/generate_synthetic_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Generate synthetic data for the GPCERF package — generate_synthetic_data","text":"data frame synthetic data. Outcome labeled Y, exposure w, covariates cf1-6.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/generate_synthetic_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Generate synthetic data for the GPCERF package — generate_synthetic_data","text":"","code":"set.seed(351) data <- generate_synthetic_data(sample_size = 200)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/get_logger.html","id":null,"dir":"Reference","previous_headings":"","what":"Get logger settings — get_logger","title":"Get logger settings — get_logger","text":"Returns current logger settings.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/get_logger.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get logger settings — get_logger","text":"","code":"get_logger()"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/get_logger.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get logger settings — get_logger","text":"Returns list includes logger_file_path logger_level.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/get_logger.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get logger settings — get_logger","text":"","code":"set_logger(\"mylogger.log\", \"INFO\") log_meta <- get_logger()"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/log_system_info.html","id":null,"dir":"Reference","previous_headings":"","what":"Log system information — log_system_info","title":"Log system information — log_system_info","text":"Logs system related information log file.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/log_system_info.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Log system information — log_system_info","text":"","code":"log_system_info()"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/log_system_info.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Log system information — log_system_info","text":"return value. function called side effects.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Extend generic plot functions for cerf_gp class — plot.cerf_gp","title":"Extend generic plot functions for cerf_gp class — plot.cerf_gp","text":"wrapper function extend generic plot functions cerf_gp class.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extend generic plot functions for cerf_gp class — plot.cerf_gp","text":"","code":"# S3 method for cerf_gp plot(x, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extend generic plot functions for cerf_gp class — plot.cerf_gp","text":"x cerf_gp object. ... Additional arguments passed customize plot.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extend generic plot functions for cerf_gp class — plot.cerf_gp","text":"Returns ggplot2 object, invisibly. function called side effects.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_nngp.html","id":null,"dir":"Reference","previous_headings":"","what":"Extend generic plot functions for cerf_nngp class — plot.cerf_nngp","title":"Extend generic plot functions for cerf_nngp class — plot.cerf_nngp","text":"wrapper function extend generic plot functions cerf_nngp class.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_nngp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extend generic plot functions for cerf_nngp class — plot.cerf_nngp","text":"","code":"# S3 method for cerf_nngp plot(x, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_nngp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extend generic plot functions for cerf_nngp class — plot.cerf_nngp","text":"x cerf_nngp object. ... Additional arguments passed customize plot.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/plot.cerf_nngp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extend generic plot functions for cerf_nngp class — plot.cerf_nngp","text":"Returns ggplot2 object, invisibly. function called side effects.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"Extend print function for cerf_gp object — print.cerf_gp","title":"Extend print function for cerf_gp object — print.cerf_gp","text":"Extend print function cerf_gp object","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extend print function for cerf_gp object — print.cerf_gp","text":"","code":"# S3 method for cerf_gp print(x, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extend print function for cerf_gp object — print.cerf_gp","text":"x cerf_gp object. ... Additional arguments passed customize results.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extend print function for cerf_gp object — print.cerf_gp","text":"return value. function called side effects.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_nngp.html","id":null,"dir":"Reference","previous_headings":"","what":"Extend print function for cerf_nngp object — print.cerf_nngp","title":"Extend print function for cerf_nngp object — print.cerf_nngp","text":"Extend print function cerf_nngp object","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_nngp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Extend print function for cerf_nngp object — print.cerf_nngp","text":"","code":"# S3 method for cerf_nngp print(x, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_nngp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Extend print function for cerf_nngp object — print.cerf_nngp","text":"x cerf_nngp object. ... Additional arguments passed customize results.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/print.cerf_nngp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Extend print function for cerf_nngp object — print.cerf_nngp","text":"return value. function called side effects.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/set_logger.html","id":null,"dir":"Reference","previous_headings":"","what":"Set logger settings — set_logger","title":"Set logger settings — set_logger","text":"Updates logger settings, including log level location file.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/set_logger.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Set logger settings — set_logger","text":"","code":"set_logger(logger_file_path = \"GPCERF.log\", logger_level = \"INFO\")"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/set_logger.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Set logger settings — set_logger","text":"logger_file_path path (including file name) log messages. (Default: GPCERF.log) logger_level log level. Available levels include: TRACE DEBUG INFO (Default) SUCCESS WARN ERROR FATAL","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/set_logger.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Set logger settings — set_logger","text":"return value. function called side effects.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/set_logger.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Set logger settings — set_logger","text":"","code":"set_logger(\"mylogger.log\", \"INFO\")"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_gp.html","id":null,"dir":"Reference","previous_headings":"","what":"print summary of cerf_gp object — summary.cerf_gp","title":"print summary of cerf_gp object — summary.cerf_gp","text":"print summary cerf_gp object","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_gp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"print summary of cerf_gp object — summary.cerf_gp","text":"","code":"# S3 method for cerf_gp summary(object, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_gp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"print summary of cerf_gp object — summary.cerf_gp","text":"object cerf_gp object. ... Additional arguments passed customize results.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_gp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"print summary of cerf_gp object — summary.cerf_gp","text":"Returns summary data","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_nngp.html","id":null,"dir":"Reference","previous_headings":"","what":"print summary of cerf_nngp object — summary.cerf_nngp","title":"print summary of cerf_nngp object — summary.cerf_nngp","text":"print summary cerf_nngp object","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_nngp.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"print summary of cerf_nngp object — summary.cerf_nngp","text":"","code":"# S3 method for cerf_nngp summary(object, ...)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_nngp.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"print summary of cerf_nngp object — summary.cerf_nngp","text":"object cerf_nngp object. ... Additional arguments passed customize results.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/summary.cerf_nngp.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"print summary of cerf_nngp object — summary.cerf_nngp","text":"Returns summary data.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/train_GPS.html","id":null,"dir":"Reference","previous_headings":"","what":"Train a model for generalized propensity score — train_gps","title":"Train a model for generalized propensity score — train_gps","text":"Estimates conditional mean sd exposure level function covariates.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/train_GPS.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Train a model for generalized propensity score — train_gps","text":"","code":"train_gps(cov_mt, w_all, sl_lib, dnorm_log)"},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/train_GPS.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Train a model for generalized propensity score — train_gps","text":"cov_mt covariate matrix containing covariates. row data sample column covariate. w_all vector observed exposure levels. sl_lib vector SuperLearner's package libraries. dnorm_log Logical, TRUE, probabilities p given log(p).","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/train_GPS.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Train a model for generalized propensity score — train_gps","text":"data.frame includes: vector estimated GPS observed exposure levels; vector estimated conditional means exposure levels covariates fixed observed values; estimated standard deviation exposure levels","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/reference/train_GPS.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Train a model for generalized propensity score — train_gps","text":"","code":"# \\donttest{ data <- generate_synthetic_data(sample_size = 200) GPS_m <- train_gps(cov_mt = data[,-(1:2)], w_all = data$treat, sl_lib = c(\"SL.xgboost\"), dnorm_log = FALSE) # }"},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"changed-0-2-3","dir":"Changelog","previous_headings":"","what":"Changed","title":"GPCERF 0.2.3 (2024-03-02)","text":"estimate_cerf_nngp takes outcome_col, treatment_col, covariates_col names inputs. estimate_cerf_gp takes outcome_col, treatment_col, covariates_col names inputs.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"added-0-2-3","dir":"Changelog","previous_headings":"","what":"Added","title":"GPCERF 0.2.3 (2024-03-02)","text":"estimate_cerf_gp estimate_cerf_nngp notes selecting w.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"gpcerf-022-2024-02-16","dir":"Changelog","previous_headings":"","what":"GPCERF 0.2.2 (2024-02-16)","title":"GPCERF 0.2.2 (2024-02-16)","text":"CRAN release: 2024-02-16","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"changed-0-2-2","dir":"Changelog","previous_headings":"","what":"Changed","title":"GPCERF 0.2.2 (2024-02-16)","text":"n_thread -> nthread estimate_noise_nn documentation.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"gpcerf-021-2023-01-15","dir":"Changelog","previous_headings":"","what":"GPCERF 0.2.1 (2023-01-15)","title":"GPCERF 0.2.1 (2023-01-15)","text":"CRAN release: 2023-03-15","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"changed-0-2-1","dir":"Changelog","previous_headings":"","what":"Changed","title":"GPCERF 0.2.1 (2023-01-15)","text":"full GP –> standard GP plots exposure response function objects include covariate balance. formula longer need nn functions. estimate_gps now returns used exposure level, . train_gps –> estimate_gps nearest neighbor approach get expand input parameter (n_neighbor * expand –> n_neighbor). weighted covariate balance now computed using wCorr package.","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"gpcerf-020-2023-01-22","dir":"Changelog","previous_headings":"","what":"GPCERF 0.2.0 (2023-01-22)","title":"GPCERF 0.2.0 (2023-01-22)","text":"CRAN release: 2023-01-22","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"changed-0-2-0","dir":"Changelog","previous_headings":"","what":"Changed","title":"GPCERF 0.2.0 (2023-01-22)","text":"estimate_noise_nn now allows parallelization added argument nthread number CPUs used parallel. estimate_mean_sd_nn now computes posterior variance. find_optimal_nn now returns posterior mean covariate balance optimal hyper-parameter values. Add argument kernel_fn nn related functions allow user-defined kernel functions. Add argument formula nn related functions allow user-defined design matrix. find_optimal_nn becomes internal function. estimate_noise_gp estimate_noise_nn become internal functions. estimate_mean_sd_nn becomes internal function. compute_weight_gp becomes internal function. compute_w_corr accepts w confounders separately. also normalizes w internally. compute_posterior_sd_nn becomes internal function. compute_posterior_m_nn becomes internal function. compute_derive_weights_gp becomes internal function. compute_m_sigma becomes internal function. compute_inverse becomes internal function. compute_m_sigma, tuning option default value. train_gps default values. train_gps accepts vector SuperLearner package’s libraries. train_GPS -> train_gps","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"gpcerf-010-2022-07-02","dir":"Changelog","previous_headings":"","what":"GPCERF 0.1.0 (2022-07-02)","title":"GPCERF 0.1.0 (2022-07-02)","text":"CRAN release: 2022-07-02","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"changed-0-1-0","dir":"Changelog","previous_headings":"","what":"Changed","title":"GPCERF 0.1.0 (2022-07-02)","text":"nn_cp_calc -> compute_rl_deriv_nn deriv_nn_fast -> compute_deriv_nn get_nn_sd -> compute_posterior_sd_nn nn_sigma_est -> estimate_noise_nn idx.-> idx_select GPS.new -> GPS_w w.new -> w get.nn.fast -> compute_posterior_m_nn w.est -> w nn_balance -> best_nn_cb","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"added-0-1-0","dir":"Changelog","previous_headings":"","what":"Added","title":"GPCERF 0.1.0 (2022-07-02)","text":"Package website using pkgdown Logger functions compute_sd_gp function","code":""},{"path":[]},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"changed-0-0-1","dir":"Changelog","previous_headings":"","what":"Changed","title":"GPCERF 0.0.1 (2022-03-31)","text":"Removed examples internal functions w.obs -> w_obs inv.Sigma.obs -> inv_sigma_obs obs.use -> scaled_obs tune.fn -> compute_m_sigma GP.weights.test -> compute_weight_gp data.generate -> generate_synthetic_data","code":""},{"path":"https://NSAPH-Software.github.io/GPCERF/news/index.html","id":"added-0-0-1","dir":"Changelog","previous_headings":"","what":"Added","title":"GPCERF 0.0.1 (2022-03-31)","text":"estimate_noise function estimate_cerf_gp function compute_inverse function compute_w_corr function","code":""}] diff --git a/index.md b/index.md index aaf3bb3..8815003 100644 --- a/index.md +++ b/index.md @@ -5,7 +5,7 @@ [](https://github.com/NSAPH-Software/GPCERF/actions) [](https://app.codecov.io/gh/NSAPH-Software/GPCERF) [](http://www.r-pkg.org/pkg/gpcerf) -[](https://github.com/NSAPH-Software/GPCERF/issues) +[](https://github.com/NSAPH-Software/GPCERF/issues) <!-- badges: end --> diff --git a/man/compute_deriv_weights_gp.Rd b/man/compute_deriv_weights_gp.Rd index 44463da..bf4d552 100644 --- a/man/compute_deriv_weights_gp.Rd +++ b/man/compute_deriv_weights_gp.Rd @@ -25,7 +25,7 @@ gps: A data.frame of GPS vectors. (e_gps_pred). - Column 3: Standard deviation of e_gps (e_gps_std) used_params: -- dnorm_log: TRUE or FLASE} +- dnorm_log: TRUE or FALSE} \item{hyperparam}{A vector of hyper-parameters in the GP model.} diff --git a/paper/paper.bib b/paper/paper.bib index 88ba4f9..6acb1fa 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -1,19 +1,20 @@ -@Manual{R_2022, +@Manual{R_2023, title = {{R}: A Language and Environment for Statistical Computing}, author = {{R Core Team}}, organization = {R Foundation for Statistical Computing}, address = {Vienna, Austria}, - year = {2022}, + year = {2023}, url = {https://www.R-project.org/}, } -@misc{CausalGPS_R, - title={{CausalGPS}: An {R} Package for Causal Inference With Continuous Exposures}, - author={Naeem Khoshnevis and Xiao Wu and Danielle Braun}, - year={2023}, - eprint={2310.00561}, - archivePrefix={arXiv}, - primaryClass={stat.CO} +@Article{CausalGPS_R, + title={{CausalGPS}: An {R} Package for Causal Inference With Continuous Exposures}, + author={Naeem Khoshnevis and Xiao Wu and Danielle Braun}, + year={2023}, + eprint={2310.00561}, + archivePrefix={arXiv}, + primaryClass={stat.CO}, + doi = {10.48550/arXiv.2310.00561} } @Article{MatchIt_R, @@ -32,6 +33,7 @@ @Article{Ren_2021_bayesian title = {{Bayesian} Modeling for Exposure Response Curve via {Gaussian} Processes: Causal Effects of Exposure to Air Pollution on Health Outcomes}, author = {Ren, Boyu and Wu, Xiao and Braun, Danielle and Pillai, Natesh and Dominici, Francesca}, journal = {arXiv preprint arXiv:2105.03454}, + doi = {10.48550/arXiv.2105.03454}, year = {2021}, } @@ -80,8 +82,8 @@ @Manual{logger @Manual{gpcerf_cran, title = {{GPCERF}: {Gaussian} Processes for Estimating Causal Exposure Response Curves}, author = {Naeem Khoshnevis and Boyu Ren and Danielle Braun}, - year = {2023}, - note = {{R} package version 0.2.1}, + year = {2024}, + note = {{R} package version 0.2.3}, url = {https://CRAN.R-project.org/package=GPCERF}, } diff --git a/paper/paper.md b/paper/paper.md index a8422fc..a14530f 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -35,7 +35,7 @@ We present the GPCERF R package, which employs a novel Bayesian approach based o In the GPCERF R package we have introduced a novel Bayesian approach. This method utilizes Gaussian Processes (GPs) as a prior for counterfactual outcome surfaces, offering a flexible way to estimate the CERF with automatic uncertainty quantification. Additionally, it can incorporate prior information about the level of smoothness of the underlying causal ERF through specifically designed covariance functions. Popular R packages for estimating causal ERF, such as CausalGPS [@CausalGPS_R; @wu_2022], ipw [@ipw_paper], npcausal [@Kennedy2017npcausal] and CBPS [@CBPS_R; @Imai_2013; @Fong_2018], are primarily built on frequentist frameworks. To the best of the authors’ knowledge, however, Bayesian nonparametric alternatives are relatively scarce. causaldrf [@causaldrf_R] uses Bayesian Additive Regression Trees (BART) for flexible causal ERF estimation. BCEE [@bcee_R; @Talbot_2015; @Talbot_2022] applies a Bayesian model averaging approach for causal ERF estimation. bkmr [@bkmr_R; @Bobb_2014] employs a kernel-based Bayesian model, which is equivalent to a GP prior, to estimate the effect of multivariate exposure on the outcome of interest. However, since it does not explicitly address confounding in the observational data, the resulting estimate does not have causal interpretation. -While various R packages, like GauPro [@GauPro_2023], mlegp [@mlegp_2022], and GPfit [@GPfit_2019; @GPfit_paper_2015], offer Gaussian process regression capabilities, we chose not to use them. The primary reason is that these packages rely on traditional techniques for hyper parameter tuning, such as sampling from the hyper-parameters’ posterior distributions or maximizing the marginal likelihood function. Our approach, in contrast, aims to achieve optimal covariate balancing. By utilizing the posterior distributions of model parameters, we can automatically assess the uncertainty in our CERF estimates [for further details, see @Ren_2021_bayesian]. Since standard GPs are infamous for their scalability issues—particularly due to operations involving the inversion of covariance matrices—we adopt a nearest-neighbor GP (nnGP) [@Datta_2016] prior to ensure computationally efficient inference of the CERF in large-scale datasets. Refer to \autoref{fig:performance} and \autoref{fig:performance_nn} for comparisons of the wall clock time between standard GP and nnGP. +While various R packages, like GauPro [@GauPro_2023], mlegp [@mlegp_2022], and GPfit [@GPfit_2019; @GPfit_paper_2015], offer Gaussian process regression capabilities, we chose not to use them. The primary reason is that these packages rely on traditional techniques for hyper parameter tuning, such as sampling from the hyper-parameters’ posterior distributions or maximizing the marginal likelihood function. Our approach, in contrast, aims to achieve optimal covariate balancing. By utilizing the posterior distributions of model parameters, we can automatically assess the uncertainty in our CERF estimates [for further details, see @Ren_2021_bayesian]. Since standard GPs are infamous for their scalability issues—particularly due to operations involving the inversion of covariance matrices—we adopt a nearest-neighbor GP (nnGP) [@Datta_2016] prior to ensure computationally efficient inference of the CERF in large-scale datasets. The \nameref{performance} section presents comparisons of the wall clock times between standard GP and nnGP. # Overview @@ -53,7 +53,7 @@ The primary goal in GPCERF is to find appropriate values for the hyper-parameter Both GP and nnGP approaches involve two primary steps - tuning and estimation. GPCERF conducts a grid search on the range of provided $\alpha$, $\beta$, and $\gamma/\sigma$. The kernel function is also selected if the user provides multiple candidates. During the tuning step, covariate balance is minimized by choosing the optimal hyperparameters. -The scaling parameter $\alpha$ and $\beta$ determine how much information the estimation will draw from the two coordinates: GPS score ($s(W, X)$) and exposure level ($W$). A large scaling parameter suggests that varying the corresponding coordinates is only associated with a minor change in the outcome, that is, this coordinate does not contribute too much to the variation of the outcome. The signal-to-noise ratio parameter $\gamma/\sigma$ encodes how different observed data is from pure noise. A large $\gamma/\sigma$ indicates strong associations between the outcome and the coordinates of GP while a small $\gamma/\sigma$ suggests the observed outcome is likely to be drawn from a random process that is independent of the coordinates. In the setting of observational studies and under the no unobserved confounding assumption, which GPCERF is specifically designed for, both the exposure level and the GPS score encode important information for the estimation of CERF. As a result, the range of their scaling parameter should be comparable and the covariate balance will determine which coordinate is more important (smaller scaling factor). The range should also cover both ends of the importance from extremely important to nearly irrelevant. We choose to achieve this by considering the range on the $log_{10}$ scale with equally spaced candidate values. The range of also follows the same strategy when the prior belief about the strength of causal effect of the exposure is weak. +The scaling parameter $\alpha$ and $\beta$ determine how much information the estimation will draw from the two coordinates: GPS score ($s(W, X)$) and exposure level ($W$). A large scaling parameter suggests that varying the corresponding coordinates is only associated with a minor change in the outcome, that is, this coordinate does not contribute too much to the variation of the outcome. The signal-to-noise ratio parameter $\gamma/\sigma$ encodes how different observed data is from pure noise. A large $\gamma/\sigma$ indicates strong associations between the outcome and the coordinates of GP while a small $\gamma/\sigma$ suggests the observed outcome is likely to be drawn from a random process that is independent of the coordinates. In the setting of observational studies and under the no unobserved confounding assumption, which GPCERF is specifically designed for, both the exposure level and the GPS score encode important information for the estimation of CERF. As a result, the range of their scaling parameter should be comparable and the covariate balance will determine which coordinate is more important (smaller scaling factor). The range should also cover both ends of the importance from extremely important to nearly irrelevant. We choose to achieve this by considering the range on the $log_{10}$ scale with equally spaced candidate values. The range of $\gamma/\sigma$ also follows the same strategy when the prior belief about the strength of causal effect of the exposure is weak. In the estimation step, the optimal parameters are used to estimate the posterior mean and standard deviation of $R(w)$ at a set of exposure values of interest. The outcome data is not used during the tuning step, separating the design and analysis phases. @Ren_2021_bayesian discusses the implemented approaches in detail. In the following we provide an example for running the package for each implemented models. @@ -237,20 +237,21 @@ Original covariate balance: { width=100% } # Performance analyses of standard and nearest neighbor GP models +\label{performance} The time complexity of the standard Gaussian Process (GP) model is $O(n^3)$, while for the nearest neighbor GP (nnGP) model, it is $O(n * m ^ 3)$, where $m$ is the number of neighbors. An in-depth discussion on achieving these complexities is outside the scope of this paper. Readers interested in further details can refer to @Ren_2021_bayesian. This section focuses on comparing the wall clock time of standard GP and nnGP models in calculating the Conditional Exposure Response Function (CERF) at a specific exposure level, $w$. We set the hyper-parameters to values at $\alpha = \beta = \gamma/\sigma = 1$. \autoref{fig:performance} shows the comparison of standard GP model with nnGP utilizing 50 nearest neighbors. Due to the differing parallelization architectures of the standard GP and nnGP in our package, we conducted this benchmark on a single core. The sample size was varied from 3,000 to 10,000, a range where nnGP begins to demonstrate notable efficiency over the standard GP. We repeat the process 20 times with different seed values. We plotted wall clock time against sample size for both methods. To enhance the visualization of the increasing rate of wall clock time, we applied a log transformation to both axes. For this specific set of analyses the estimated slope of 3.09 (ideally 3) for standard GP aligns with its $O(n^3)$ time complexity. According to the results, a sample size of 10,000 data samples is not large enough to establish a meaningful relationship for the time complexity of the nnGP model effectively. -{ width=80% } +{ width=80% } \autoref{fig:performance_nn} compares the performance of the nnGP model across three nearest neighbor categories: 50, 100, and 200, using a data sample sequence ranging from 5,000 to 100,000 with intervals of 5,000. For each category, different sets of runs demonstrate a linear relationship, consistent with an $O(n)$ time complexity, assuming that $m^3$ remains constant for varying sample sizes within each category. -{ width=80% } +{ width=80% } # Software related features We have implemented several features to enhance the package performance and usability. By utilizing an internal `parallel` package, the software is capable of scaling up in a shared memory system. Additionally, we have implemented a logging infrastructure that tracks the software's internal progress and provides users and developers with detailed information on processed runs [@logger]. We have also activated continuous integration (CI) through GitHub actions, which runs unit tests and checks the code quality for any submitted pull request. The majority of the codebase is tested at least once. To ensure efficient development, we follow a successful git branching model [@driessen_2010] and use the tidyverse styling guide. -The software is available on CRAN [@gpcerf_cran] and is primarily written in R [@R_2022]. However, some of the core computations are written in C++ using the `Rcpp` package [@rcpp_1; @rcpp_2; @rcpp_3]. +The software is available on CRAN [@gpcerf_cran] and is primarily written in R [@R_2023]. However, some of the core computations are written in C++ using the `Rcpp` package [@rcpp_1; @rcpp_2; @rcpp_3]. All analyses were conducted using R Statistical Software [v4.2.3; @R_2023]. # Acknowledgement