Skip to content

Commit

Permalink
examples expanded
Browse files Browse the repository at this point in the history
  • Loading branch information
markean committed Jan 22, 2024
1 parent 6efea35 commit c0ca487
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 20 deletions.
11 changes: 5 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
Package: retel
Type: Package
Title: Regularized Exponentially Tilted Empirical Likelihood
Version: 0.0.0.9704
Version: 0.0.0.9705
Authors@R: c(
person("Eunseop", "Kim", email = "markean@pm.me",
role = c("aut", "cre")),
role = c("aut", "cph", "cre")),
person("Steven", "MacEachern", role = c("ctb", "ths")),
person("Mario", "Peruggia", role = c("ctb", "ths"))
)
Description: Implements regularized exponentially tilted empirical likelihood
for Bayesian inference. Details of the methods are given in Kim, MacEachern,
and Peruggia (2023) <doi:10.48550/arXiv.2312.17015>. This work was supported
by the U.S. National Science Foundation under Grants No. SES-1921523 and
DMS-2015552.
methods. Details of the methods are given in Kim, MacEachern, and Peruggia
(2023) <doi:10.48550/arXiv.2312.17015>. This work was supported by the U.S.
National Science Foundation under Grants No. SES-1921523 and DMS-2015552.
License: GPL (>= 3)
URL: https://github.com/markean/retel
BugReports: https://github.com/markean/retel/issues
Expand Down
13 changes: 10 additions & 3 deletions R/etel.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,20 @@
#' "Bayesian Exponentially Tilted Empirical Likelihood."
#' \emph{Biometrika}, 92, 31--46.
#' @examples
#' # Generate data
#' set.seed(63456)
#' f <- function(x, par) {
#' x <- rnorm(100)
#'
#' # Define an estimating function (ex. mean)
#' fn <- function(x, par) {
#' x - par
#' }
#' x <- rnorm(100)
#'
#' # Set parameter value
#' par <- 0
#' etel(f, x, par)
#'
#' # Call the etel function
#' etel(fn, x, par)
#' @export
etel <- function(fn, x, par, opts = NULL) {
assert_function(fn, args = c("x", "par"), ordered = TRUE, nargs = 2L)
Expand Down
15 changes: 12 additions & 3 deletions R/retel.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,25 @@
#' "Regularized Exponentially Tilted Empirical Likelihood for Bayesian
#' Inference." \doi{10.48550/arXiv.2312.17015}.
#' @examples
#' # Generate data
#' set.seed(63456)
#' f <- function(x, par) {
#' x <- rnorm(100)
#'
#' # Define an estimating function (ex. mean)
#' fn <- function(x, par) {
#' x - par
#' }
#' x <- rnorm(100)
#'
#' # Set parameter value
#' par <- 0
#'
#' # Set regularization parameters
#' mu <- 0
#' Sigma <- 1
#' tau <- 1
#' retel(f, x, par, mu, Sigma, tau)
#'
#' # Call the retel function
#' retel(fn, x, par, mu, Sigma, tau)
#' @export
retel <- function(fn, x, par, mu, Sigma, tau, type = "full", opts = NULL) {
assert_function(fn, args = c("x", "par"), ordered = TRUE, nargs = 2L)
Expand Down
13 changes: 10 additions & 3 deletions man/etel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/retel-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions man/retel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c0ca487

Please sign in to comment.