Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: updates following Rust compilation #231

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions R/R/bridgestan.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ StanModel <- R6::R6Class("StanModel",
},
#' @description
#' Returns a vector of constrained parameters given the unconstrained parameters.
#' See also `StanModel$param_unconstrain()`, the inverse of this function.
#' See also [StanModel$param_unconstrain()], the inverse of this function.
#' @param theta_unc The vector of unconstrained parameters.
#' @param include_tp Whether to also output the transformed parameters of the model.
#' @param include_gq Whether to also output the generated quantities of the model.
#' @param rng The random number generator to use if `include_gq` is `TRUE`. See `StanModel$new_rng()`.
#' @param rng The random number generator to use if `include_gq` is `TRUE`. See [StanModel$new_rng()].
#' @return The constrained parameters of the model.
param_constrain = function(theta_unc, include_tp = FALSE, include_gq = FALSE, rng) {
if (missing(rng)) {
Expand Down Expand Up @@ -184,7 +184,7 @@ StanModel <- R6::R6Class("StanModel",
vars$theta
},
#' @description
#' Create a new persistent PRNG object for use in `param_constrain()`.
#' Create a new persistent PRNG object for use in [param_constrain()].
#' @param seed The seed for the PRNG.
#' @return A `StanRNG` object.
new_rng = function(seed) {
Expand All @@ -194,9 +194,9 @@ StanModel <- R6::R6Class("StanModel",
#' Returns a vector of unconstrained parameters give the constrained parameters.
#'
#' It is assumed that these will be in the same order as internally represented by
#' the model (e.g., in the same order as `StanModel$param_names()`).
#' If structured input is needed, use `StanModel$param_unconstrain_json()`.
#' See also `StanModel$param_constrain()`, the inverse of this function.
#' the model (e.g., in the same order as [StanModel$param_names()]).
#' If structured input is needed, use [StanModel$param_unconstrain_json()].
#' See also [StanModel$param_constrain()], the inverse of this function.
#' @param theta The vector of constrained parameters.
#' @return The unconstrained parameters of the model.
param_unconstrain = function(theta) {
Expand Down Expand Up @@ -353,7 +353,7 @@ handle_error <- function(lib_name, err_msg, err_ptr, function_name) {

#' StanRNG
#'
#' RNG object for use with `StanModel$param_constrain()`
#' RNG object for use with [StanModel$param_constrain()]
#' @field ptr The pointer to the RNG object.
#' @keywords internal
StanRNG <- R6::R6Class("StanRNG",
Expand Down
2 changes: 1 addition & 1 deletion R/R/compile.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set_bridgestan_path <- function(path) {
#' a matching version of BridgeStan to a folder called
#' `.bridgestan` in the user's home directory.
#'
#' @seealso [set_bridgestan_path]
#' @seealso [set_bridgestan_path()]
get_bridgestan_path <- function() {
# try to get from environment
path <- Sys.getenv("BRIDGESTAN", unset = "")
Expand Down
12 changes: 6 additions & 6 deletions R/man/StanModel.Rd

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

2 changes: 1 addition & 1 deletion R/man/StanRNG.Rd

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

2 changes: 1 addition & 1 deletion R/man/get_bridgestan_path.Rd

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

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ We are aware of the following projects using BridgeStan.
## Research using BridgeStan

If you use BridgeStan in your research, please consider citing [our JOSS paper](https://joss.theoj.org/papers/10.21105/joss.05236)
and letting us know so we list your project here.
and letting us know so we can list your project here.

- [*Verified Density Compilation for a Probabilistic Programming Language*](https://doi.org/10.1145/3591245)
- [*Variational Inference with Gaussian Score Matching*](https://arxiv.org/pdf/2307.07849.pdf)
Expand Down
3 changes: 2 additions & 1 deletion docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Downloading BridgeStan

.. note::
The :doc:`Julia <languages/julia>`, :doc:`Python <languages/python>`, and :doc:`R <languages/r>`
interfaces will download the source for you the first time you compile a model.
interfaces will download the source for you the first time you compile a model, and the :doc:`Rust <languages/rust>`
interface has an optional feature to download the source upon request.
This section is optional for users primarily interested in those interfaces.


Expand Down
16 changes: 8 additions & 8 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

Welcome to BridgeStan's documentation!
======================================
BridgeStan -- efficient, in-memory access to the methods of a Stan model
========================================================================

BridgeStan provides efficient in-memory access through Python, Julia,
R, and Rust to the methods of a `Stan <https://mc-stan.org>`__ model, including
log densities, gradients, Hessians, and constraining and unconstraining
transforms.
BridgeStan is a library (with :doc:`bindings <languages>` available in Python,
Julia, R, and Rust) that grants access to the methods of a `Stan <https://mc-stan.org>`__
model, including log densities, gradients, Hessians, and constraining and
unconstraining transforms.

The motivation is developing inference algorithms in
higher-level languages for arbitrary Stan models, such as those in
This allows researchers and library authors to develop inference algorithms in
higher-level languages and apply them to arbitrary Stan models, such as those in
`posteriordb <https://github.com/stan-dev/posteriordb>`__.


Expand Down
10 changes: 5 additions & 5 deletions docs/languages.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ written in C.

All language interfaces expose the same core functionality from the
:doc:`C API <./languages/c-api>`.
Additional "quality of life" features such as the ability to download
BridgeStan's source code automatically or compile models from inside the language
(rather than manually calling :command:`make`) are available on a best-effort basis.
If you are missing these features in your favorite language, we would welcome a
`contribution <https://github.com/roualdes/bridgestan/blob/main/CONTRIBUTING.md>`__!


Additional "quality of life" features are available on a best-effort basis.
If BridgeStan's bindings to your favorite language are missing one of these features, we welcome
`contributions <https://github.com/roualdes/bridgestan/blob/main/CONTRIBUTING.md>`__!

.. toctree::
:maxdepth: 2
Expand Down
Loading
Loading