Skip to content

Commit

Permalink
More R doc
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian committed Apr 22, 2024
1 parent 1525a66 commit e3a4b43
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 18 deletions.
1 change: 1 addition & 0 deletions clients/R/R/tinystan.R
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ laplace_sampler.tinystan_model = function(model, mode, data = "", num_draws = 10


#' Get and free the error message stored at the C++ pointer
#' @noRd
#' @keywords internal
handle_error <- function(return_code, lib_name, err_ptr) {
if (return_code != 0) {
Expand Down
16 changes: 10 additions & 6 deletions clients/R/R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
#' @export
HMCMetric <- list(UNIT = 0, DENSE = 1, DIAGONAL = 2)

HMC_SAMPLER_VARIABLES = c("lp__", "accept_stat__", "stepsize__", "treedepth__", "n_leapfrog__",
"divergent__", "energy__")

PATHFINDER_VARIABLES = c("lp_approx__", "lp__")

#' @export
OptimizationAlgorithm <- list(NEWTON = 0, BFGS = 1, LBFGS = 2)

OPTIMIZATION_VARIABLES = c("lp__")

LAPLACE_VARIABLES = c("log_p__", "log_g__")

#' @title Enumeration `HMCMetric`
#' @description Choices of metric for HMC. Can select from `$UNIT`, `$DENSE`, and `$DIAGONAL`.
#' @export
HMCMetric <- list(UNIT = 0, DENSE = 1, DIAGONAL = 2)

#' @title Enumeration `OptimizationAlgorithm`
#' @description Choices of optimization algorithm. Can select from `$NEWTON`, `$BFGS`, and `$LBFGS`.
#' @export
OptimizationAlgorithm <- list(NEWTON = 0, BFGS = 1, LBFGS = 2)
16 changes: 16 additions & 0 deletions clients/R/man/HMCMetric.Rd

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

16 changes: 16 additions & 0 deletions clients/R/man/OptimizationAlgorithm.Rd

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

12 changes: 0 additions & 12 deletions clients/R/man/handle_error.Rd

This file was deleted.

0 comments on commit e3a4b43

Please sign in to comment.