From c3d39c47fa15c79b5de8b707eed6a0ff42100a26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul-Christian=20B=C3=BCrkner?= Date: Wed, 5 Jan 2022 14:58:24 +0100 Subject: [PATCH] rebuild website --- docs/404.html | 147 ++-- docs/LICENSE-text.html | 129 +-- docs/LICENSE.html | 135 +--- docs/articles/index.html | 143 +--- docs/articles/posterior.html | 720 ++++++++--------- docs/articles/rvar.html | 513 ++++++------ docs/authors.html | 233 +++--- docs/index.html | 270 +++---- docs/news/index.html | 225 ++---- docs/pkgdown.css | 83 +- docs/pkgdown.js | 4 +- docs/pkgdown.yml | 6 +- docs/pull_request_template.html | 147 +--- docs/reference/Rplot002.png | Bin 10038 -> 9894 bytes docs/reference/as_rvar.html | 281 +++---- docs/reference/autocorrelation.html | 157 ++-- docs/reference/autocovariance.html | 157 ++-- docs/reference/bind_draws.html | 225 ++---- docs/reference/chol.rvar.html | 169 ++-- docs/reference/diagnostics.html | 159 +--- docs/reference/draws-index.html | 300 +++---- docs/reference/draws.html | 246 +++--- docs/reference/draws_array.html | 421 +++++----- docs/reference/draws_df.html | 436 +++++----- docs/reference/draws_list.html | 441 +++++------ docs/reference/draws_matrix.html | 327 ++++---- docs/reference/draws_of.html | 291 +++---- docs/reference/draws_rvars.html | 321 +++----- docs/reference/draws_summary.html | 534 ++++++------- docs/reference/ess_basic.html | 274 +++---- docs/reference/ess_bulk.html | 258 +++--- docs/reference/ess_mean.html | 218 ++--- docs/reference/ess_quantile.html | 274 +++---- docs/reference/ess_sd.html | 252 +++--- docs/reference/ess_tail.html | 258 +++--- docs/reference/example_draws.html | 260 +++--- docs/reference/extract_variable.html | 202 ++--- docs/reference/extract_variable_matrix.html | 209 ++--- docs/reference/index.html | 454 +++-------- docs/reference/is_rvar.html | 166 ++-- docs/reference/mcse_mean.html | 249 +++--- docs/reference/mcse_quantile.html | 270 +++---- docs/reference/mcse_sd.html | 252 +++--- docs/reference/merge_chains.html | 233 ++---- docs/reference/mutate_variables.html | 283 +++---- docs/reference/order_draws.html | 250 +++--- docs/reference/posterior-package.html | 180 ++--- docs/reference/print.draws_array.html | 320 +++----- docs/reference/print.draws_df.html | 254 +++--- docs/reference/print.draws_list.html | 296 +++---- docs/reference/print.draws_matrix.html | 254 +++--- docs/reference/print.draws_rvars.html | 248 ++---- docs/reference/print.rvar.html | 320 +++----- docs/reference/quantile2.html | 221 ++---- docs/reference/r_scale.html | 157 ++-- docs/reference/rdo.html | 248 +++--- docs/reference/reexports.html | 143 +--- docs/reference/rename_variables.html | 228 ++---- docs/reference/repair_draws.html | 384 ++++----- docs/reference/resample_draws.html | 307 +++----- docs/reference/reserved_variables.html | 231 ++---- docs/reference/rfun.html | 251 +++--- docs/reference/rhat.html | 254 +++--- docs/reference/rhat_basic.html | 270 +++---- docs/reference/rstar-1.png | Bin 27621 -> 27232 bytes docs/reference/rstar-2.png | Bin 30392 -> 29928 bytes docs/reference/rstar.html | 351 ++++----- docs/reference/rvar-dist.html | 308 +++----- docs/reference/rvar-matmult.html | 253 +++--- docs/reference/rvar-summaries-over-draws.html | 356 ++++----- .../rvar-summaries-within-draws.html | 291 +++---- docs/reference/rvar.html | 324 +++----- docs/reference/rvar_apply.html | 264 +++---- docs/reference/rvar_is_finite.html | 228 ++---- docs/reference/rvar_rng.html | 251 +++--- docs/reference/split_chains.html | 191 ++--- docs/reference/sub-.draws_array.html | 163 ++-- docs/reference/sub-.draws_matrix.html | 163 ++-- docs/reference/subset_draws.html | 745 ++++++++---------- docs/reference/thin_draws.html | 197 ++--- docs/reference/u_scale.html | 165 ++-- docs/reference/weight_draws.html | 273 +++---- docs/reference/weights.draws.html | 253 +++--- docs/reference/z_scale.html | 165 ++-- docs/sitemap.xml | 67 +- 85 files changed, 7977 insertions(+), 13179 deletions(-) diff --git a/docs/404.html b/docs/404.html index aff051f5..40429660 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,66 +1,27 @@ - - - - + + + + - Page not found (404) • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - -
-
- + +
+ + + - - -
+
+
-
- +
+ + - - diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 1b98c632..f8e4cd43 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -1,66 +1,12 @@ - - - - - - - -License • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -License • posterior - - + + - - -
-
- -
- -
+
+
-
- +
- - + + diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 6d8ee1b0..bc62804d 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -1,66 +1,12 @@ - - - - - - - -NA • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -NA • posterior - - + + - - -
-
- -
- -
+
+
-
- +
- - + + diff --git a/docs/articles/index.html b/docs/articles/index.html index 56f12f8d..947e957d 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,66 +1,12 @@ - - - - - - - -Articles • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Articles • posterior - - - - + + -
-
- -
- -
+

rvar: The Random Variable Datatype

-

An overview of a new datatype introduced by posterior

+

An overview of a new datatype introduced by posterior

-
-
rvar: The Random Variable Datatype
-
-
-
+
rvar: The Random Variable Datatype
+
+
-
- +
- - + + diff --git a/docs/articles/posterior.html b/docs/articles/posterior.html index a2832224..37255419 100644 --- a/docs/articles/posterior.html +++ b/docs/articles/posterior.html @@ -19,6 +19,8 @@ + +
+
-
-

-Introduction

+
+

Introduction +

The posterior R package is intended to provide useful tools for both users and developers of packages for fitting Bayesian models or working with output from Bayesian models. The primary goals of the package are to:

  • Efficiently convert between many different useful formats of draws (samples) from posterior or prior distributions.
  • @@ -143,72 +145,72 @@

  • Provide lightweight implementations of state of the art posterior inference diagnostics.
-
-

-Installation

+
+

Installation +

You can install the latest official release version via

-install.packages("posterior")
+install.packages("posterior")

or the latest development version from GitHub via

 # install.packages("remotes")
-remotes::install_github("stan-dev/posterior")
+remotes::install_github("stan-dev/posterior")
-
-

-Example

+
+

Example +

-
## This is posterior version 1.1.0
-
## 
-## Attaching package: 'posterior'
-
## The following objects are masked from 'package:stats':
-## 
-##     mad, sd, var
+library("posterior")
+
## This is posterior version 1.2.0
+
## 
+## Attaching package: 'posterior'
+
## The following objects are masked from 'package:stats':
+## 
+##     mad, sd, var

To demonstrate how to work with the posterior package, throughout the rest of this vignette we will use example posterior draws obtained from the eight schools hierarchical meta-analysis model described in Gelman et al. (2013). The variables are an estimate per school (theta[1] through theta[8]) as well as an overall mean (mu) and standard deviation across schools (tau).

 eight_schools_array <- example_draws("eight_schools")
-print(eight_schools_array, max_variables = 3)
-
## # A draws_array: 100 iterations, 4 chains, and 10 variables
-## , , variable = mu
-## 
-##          chain
-## iteration   1    2     3   4
-##         1 2.0  3.0  1.79 6.5
-##         2 1.5  8.2  5.99 9.1
-##         3 5.8 -1.2  2.56 0.2
-##         4 6.8 10.9  2.79 3.7
-##         5 1.8  9.8 -0.03 5.5
-## 
-## , , variable = tau
-## 
-##          chain
-## iteration   1    2    3   4
-##         1 2.8 2.80  8.7 3.8
-##         2 7.0 2.76  2.9 6.8
-##         3 9.7 0.57  8.4 5.3
-##         4 4.8 2.45  4.4 1.6
-##         5 2.8 2.80 11.0 3.0
-## 
-## , , variable = theta[1]
-## 
-##          chain
-## iteration     1     2    3     4
-##         1  3.96  6.26 13.3  5.78
-##         2  0.12  9.32  6.3  2.09
-##         3 21.25 -0.97 10.6 15.72
-##         4 14.70 12.45  5.4  2.69
-##         5  5.96  9.75  8.2 -0.91
-## 
-## # ... with 95 more iterations, and 7 more variables
+print(eight_schools_array, max_variables = 3)
+
## # A draws_array: 100 iterations, 4 chains, and 10 variables
+## , , variable = mu
+## 
+##          chain
+## iteration   1    2     3   4
+##         1 2.0  3.0  1.79 6.5
+##         2 1.5  8.2  5.99 9.1
+##         3 5.8 -1.2  2.56 0.2
+##         4 6.8 10.9  2.79 3.7
+##         5 1.8  9.8 -0.03 5.5
+## 
+## , , variable = tau
+## 
+##          chain
+## iteration   1    2    3   4
+##         1 2.8 2.80  8.7 3.8
+##         2 7.0 2.76  2.9 6.8
+##         3 9.7 0.57  8.4 5.3
+##         4 4.8 2.45  4.4 1.6
+##         5 2.8 2.80 11.0 3.0
+## 
+## , , variable = theta[1]
+## 
+##          chain
+## iteration     1     2    3     4
+##         1  3.96  6.26 13.3  5.78
+##         2  0.12  9.32  6.3  2.09
+##         3 21.25 -0.97 10.6 15.72
+##         4 14.70 12.45  5.4  2.69
+##         5  5.96  9.75  8.2 -0.91
+## 
+## # ... with 95 more iterations, and 7 more variables

The structure of this object is explained in the next section.

-
-

-Draws formats

-
-

-Available formats

+
+

Draws formats +

+
+

Available formats +

Because different formats are preferable in different situations, posterior supports multiple formats and easy conversion between them. The currently supported formats are:

  • @@ -225,378 +227,378 @@

    These formats are essentially base R object classes and can be used as such. For example, a draws_matrix object is just a matrix with a little more consistency (e.g., no dropping of dimensions with one level when indexing) and additional methods. The exception to this is the draws_rvars format, which contains rvar objects that behave somewhat like arrays but are really a unique data type. See the separate vignette on the rvar and draws_rvars data types for details.

    The draws for our example come as a draws_array object with 100 iterations, 4 chains, and 10 variables:

    -str(eight_schools_array)
    -
    ##  'draws_array' num [1:100, 1:4, 1:10] 2.01 1.46 5.81 6.85 1.81 ...
    -##  - attr(*, "dimnames")=List of 3
    -##   ..$ iteration: chr [1:100] "1" "2" "3" "4" ...
    -##   ..$ chain    : chr [1:4] "1" "2" "3" "4"
    -##   ..$ variable : chr [1:10] "mu" "tau" "theta[1]" "theta[2]" ...
    +str(eight_schools_array)

+
##  'draws_array' num [1:100, 1:4, 1:10] 2.01 1.46 5.81 6.85 1.81 ...
+##  - attr(*, "dimnames")=List of 3
+##   ..$ iteration: chr [1:100] "1" "2" "3" "4" ...
+##   ..$ chain    : chr [1:4] "1" "2" "3" "4"
+##   ..$ variable : chr [1:10] "mu" "tau" "theta[1]" "theta[2]" ...
-
-

-Converting between formats

+
+

Converting between formats +

Each of the formats has a method as_draws_<format> (e.g., as_draws_list()) for creating an object of the class from any of the other formats. As a demonstration we can convert the example draws_array to a draws_df, a data frame with additional meta information. To convert to a draws_df we use as_draws_df().

 eight_schools_df <- as_draws_df(eight_schools_array)
-str(eight_schools_df)
-
## draws_df [400 x 13] (S3: draws_df/draws/tbl_df/tbl/data.frame)
-##  $ mu        : num [1:400] 2.01 1.46 5.81 6.85 1.81 ...
-##  $ tau       : num [1:400] 2.77 6.98 9.68 4.79 2.85 ...
-##  $ theta[1]  : num [1:400] 3.962 0.124 21.251 14.7 5.96 ...
-##  $ theta[2]  : num [1:400] 0.271 -0.069 14.931 8.586 1.156 ...
-##  $ theta[3]  : num [1:400] -0.743 0.952 1.829 2.675 3.109 ...
-##  $ theta[4]  : num [1:400] 2.1 7.28 1.38 4.39 1.99 ...
-##  $ theta[5]  : num [1:400] 0.923 -0.062 0.531 4.758 0.769 ...
-##  $ theta[6]  : num [1:400] 1.65 11.26 7.16 8.1 4.66 ...
-##  $ theta[7]  : num [1:400] 3.32 9.62 14.8 9.49 1.21 ...
-##  $ theta[8]  : num [1:400] 4.85 -8.64 -1.74 5.28 -4.54 ...
-##  $ .chain    : int [1:400] 1 1 1 1 1 1 1 1 1 1 ...
-##  $ .iteration: int [1:400] 1 2 3 4 5 6 7 8 9 10 ...
-##  $ .draw     : int [1:400] 1 2 3 4 5 6 7 8 9 10 ...
+str(eight_schools_df)
+
## draws_df [400 × 13] (S3: draws_df/draws/tbl_df/tbl/data.frame)
+##  $ mu        : num [1:400] 2.01 1.46 5.81 6.85 1.81 ...
+##  $ tau       : num [1:400] 2.77 6.98 9.68 4.79 2.85 ...
+##  $ theta[1]  : num [1:400] 3.962 0.124 21.251 14.7 5.96 ...
+##  $ theta[2]  : num [1:400] 0.271 -0.069 14.931 8.586 1.156 ...
+##  $ theta[3]  : num [1:400] -0.743 0.952 1.829 2.675 3.109 ...
+##  $ theta[4]  : num [1:400] 2.1 7.28 1.38 4.39 1.99 ...
+##  $ theta[5]  : num [1:400] 0.923 -0.062 0.531 4.758 0.769 ...
+##  $ theta[6]  : num [1:400] 1.65 11.26 7.16 8.1 4.66 ...
+##  $ theta[7]  : num [1:400] 3.32 9.62 14.8 9.49 1.21 ...
+##  $ theta[8]  : num [1:400] 4.85 -8.64 -1.74 5.28 -4.54 ...
+##  $ .chain    : int [1:400] 1 1 1 1 1 1 1 1 1 1 ...
+##  $ .iteration: int [1:400] 1 2 3 4 5 6 7 8 9 10 ...
+##  $ .draw     : int [1:400] 1 2 3 4 5 6 7 8 9 10 ...
-print(eight_schools_df)
-
## # A draws_df: 100 iterations, 4 chains, and 10 variables
-##      mu tau theta[1] theta[2] theta[3] theta[4] theta[5] theta[6]
-## 1  2.01 2.8     3.96    0.271    -0.74      2.1    0.923      1.7
-## 2  1.46 7.0     0.12   -0.069     0.95      7.3   -0.062     11.3
-## 3  5.81 9.7    21.25   14.931     1.83      1.4    0.531      7.2
-## 4  6.85 4.8    14.70    8.586     2.67      4.4    4.758      8.1
-## 5  1.81 2.8     5.96    1.156     3.11      2.0    0.769      4.7
-## 6  3.84 4.1     5.76    9.909    -1.00      5.3    5.889     -1.7
-## 7  5.47 4.0     4.03    4.151    10.15      6.6    3.741     -2.2
-## 8  1.20 1.5    -0.28    1.846     0.47      4.3    1.467      3.3
-## 9  0.15 3.9     1.81    0.661     0.86      4.5   -1.025      1.1
-## 10 7.17 1.8     6.08    8.102     7.68      5.6    7.106      8.5
-## # ... with 390 more draws, and 2 more variables
-## # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
+print(eight_schools_df)
+
## # A draws_df: 100 iterations, 4 chains, and 10 variables
+##      mu tau theta[1] theta[2] theta[3] theta[4] theta[5] theta[6]
+## 1  2.01 2.8     3.96    0.271    -0.74      2.1    0.923      1.7
+## 2  1.46 7.0     0.12   -0.069     0.95      7.3   -0.062     11.3
+## 3  5.81 9.7    21.25   14.931     1.83      1.4    0.531      7.2
+## 4  6.85 4.8    14.70    8.586     2.67      4.4    4.758      8.1
+## 5  1.81 2.8     5.96    1.156     3.11      2.0    0.769      4.7
+## 6  3.84 4.1     5.76    9.909    -1.00      5.3    5.889     -1.7
+## 7  5.47 4.0     4.03    4.151    10.15      6.6    3.741     -2.2
+## 8  1.20 1.5    -0.28    1.846     0.47      4.3    1.467      3.3
+## 9  0.15 3.9     1.81    0.661     0.86      4.5   -1.025      1.1
+## 10 7.17 1.8     6.08    8.102     7.68      5.6    7.106      8.5
+## # ... with 390 more draws, and 2 more variables
+## # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
-
-

-Converting regular R objects to draws formats

+
+

Converting regular R objects to draws formats +

The example draws already come in a format natively supported by posterior, but we can of course also import the draws from other sources like common base R objects.

-
-

-Example: create draws_matrix from a matrix

+
+

Example: create draws_matrix from a matrix +

In addition to converting other draws objects to the draws_matrix format, the as_draws_matrix() function will convert a regular matrix to a draws_matrix.

-x <- matrix(rnorm(50), nrow = 10, ncol = 5)
-colnames(x) <- paste0("V", 1:5)
+x <- matrix(rnorm(50), nrow = 10, ncol = 5)
+colnames(x) <- paste0("V", 1:5)
 x <- as_draws_matrix(x)
-print(x)
-
## # A draws_matrix: 10 iterations, 1 chains, and 5 variables
-##     variable
-## draw      V1    V2     V3     V4     V5
-##   1   0.0083 -0.49  0.332 -0.146 -2.620
-##   2  -0.3062  0.64 -1.615  1.530  0.515
-##   3   0.8980 -0.93  0.551  0.329 -2.058
-##   4   0.7022  0.23 -0.915  0.766  1.172
-##   5  -0.1158  0.34 -1.672  0.260 -0.377
-##   6  -0.0322  0.79 -1.476 -0.046  0.404
-##   7  -0.8983 -0.27  0.714  0.396 -0.163
-##   8   0.4117 -1.66 -0.291  0.050 -0.037
-##   9  -0.5325 -0.43  0.072 -0.076  0.434
-##   10  0.1424  0.63  2.272  1.018 -0.184
+print(x)
+
## # A draws_matrix: 10 iterations, 1 chains, and 5 variables
+##     variable
+## draw    V1    V2    V3     V4     V5
+##   1   1.19  0.78 -1.06  1.718  1.388
+##   2   0.87 -2.14  0.66 -1.266  0.433
+##   3   0.51  0.89  0.55  0.944  1.664
+##   4  -0.39 -0.11 -0.91 -0.731  0.019
+##   5  -1.99  0.73 -0.52 -0.624 -0.837
+##   6   1.88 -0.40 -0.48 -0.439 -2.127
+##   7  -0.16  0.26 -0.44 -1.472  0.526
+##   8  -0.49  0.35 -0.23 -0.914  1.483
+##   9   1.27  0.79  0.82 -0.013 -0.354
+##   10 -0.16 -0.19  1.13  1.490  1.152

Because the matrix was converted to a draws_matrix, all of the methods for working with draws objects described in subsequent sections of this vignette will now be available.

Instead of as_draws_matrix() we also could have just used as_draws(), which attempts to find the closest available format to the input object. In this case the result would be a draws_matrix object either way.

-
-

-Example: create draws_matrix from multiple vectors

+
+

Example: create draws_matrix from multiple vectors +

In addition to the as_draws_matrix() converter function there is also a draws_matrix() constructor function that can be used to create draws matrix from multiple vectors.

-x <- draws_matrix(alpha = rnorm(50), beta = rnorm(50))
-print(x)
-
## # A draws_matrix: 50 iterations, 1 chains, and 2 variables
-##     variable
-## draw  alpha   beta
-##   1  -0.468  0.812
-##   2  -0.411  0.915
-##   3   0.102 -0.556
-##   4   0.728 -2.211
-##   5   0.880  0.934
-##   6  -0.254  0.836
-##   7  -0.588 -0.055
-##   8  -0.846 -0.313
-##   9  -1.359  1.838
-##   10  0.049 -1.340
-## # ... with 40 more draws
+x <- draws_matrix(alpha = rnorm(50), beta = rnorm(50)) +print(x)
+
## # A draws_matrix: 50 iterations, 1 chains, and 2 variables
+##     variable
+## draw alpha   beta
+##   1  -0.23  0.517
+##   2  -0.80  1.570
+##   3   1.26  1.398
+##   4   0.74  0.537
+##   5   1.22 -0.850
+##   6   1.24  0.365
+##   7   1.11 -1.503
+##   8  -2.94 -0.209
+##   9   0.55  0.610
+##   10  0.32 -0.066
+## # ... with 40 more draws

Analogous functions exist for the other draws formats and are used similarly.

-
-

-Manipulating draws objects

+
+

Manipulating draws objects +

The posterior package provides many methods for manipulating draws objects in useful ways. In this section we demonstrate several of the most commonly used methods. These methods, like the other methods in posterior, are available for every supported draws format.

-
-

-Subsetting

+
+

Subsetting +

Subsetting draws objects can be done according to various aspects of the draws (iterations, chains, or variables). The posterior package provides a convenient interface for this purpose via subset_draws(). For example, here is the code to extract the first five iterations of the first two chains of the variable mu.

 sub_df <- subset_draws(eight_schools_df, variable = "mu", chain = 1:2, iteration = 1:5)
-str(sub_df)
-
## draws_df [10 x 4] (S3: draws_df/draws/tbl_df/tbl/data.frame)
-##  $ mu        : num [1:10] 2.01 1.46 5.81 6.85 1.81 ...
-##  $ .chain    : int [1:10] 1 1 1 1 1 2 2 2 2 2
-##  $ .iteration: int [1:10] 1 2 3 4 5 1 2 3 4 5
-##  $ .draw     : int [1:10] 1 2 3 4 5 6 7 8 9 10
+str(sub_df)
+
## draws_df [10 × 4] (S3: draws_df/draws/tbl_df/tbl/data.frame)
+##  $ mu        : num [1:10] 2.01 1.46 5.81 6.85 1.81 ...
+##  $ .chain    : int [1:10] 1 1 1 1 1 2 2 2 2 2
+##  $ .iteration: int [1:10] 1 2 3 4 5 1 2 3 4 5
+##  $ .draw     : int [1:10] 1 2 3 4 5 6 7 8 9 10

The same call to subset_draws() can be used regardless of the draws format. For example, here is the same code except replacing the draws_df object with the draws_array object.

 sub_arr <- subset_draws(eight_schools_array, variable = "mu", chain = 1:2, iteration = 1:5)
-str(sub_arr)
-
##  'draws_array' num [1:5, 1:2, 1] 2.01 1.46 5.81 6.85 1.81 ...
-##  - attr(*, "dimnames")=List of 3
-##   ..$ iteration: chr [1:5] "1" "2" "3" "4" ...
-##   ..$ chain    : chr [1:2] "1" "2"
-##   ..$ variable : chr "mu"
+str(sub_arr)
+
##  'draws_array' num [1:5, 1:2, 1] 2.01 1.46 5.81 6.85 1.81 ...
+##  - attr(*, "dimnames")=List of 3
+##   ..$ iteration: chr [1:5] "1" "2" "3" "4" ...
+##   ..$ chain    : chr [1:2] "1" "2"
+##   ..$ variable : chr "mu"

We can check that these two calls to subset_draws() (the first with the data frame, the second with the array) produce the same result.

-identical(sub_df, as_draws_df(sub_arr))
-identical(as_draws_array(sub_df), sub_arr)
-
## [1] TRUE
-## [1] TRUE
+identical(sub_df, as_draws_df(sub_arr)) +identical(as_draws_array(sub_df), sub_arr)
+
## [1] TRUE
+## [1] TRUE

It is also possible to use standard R subsetting syntax with draws objects. The following is equivalent to the use of subset_draws() with the array above.

 eight_schools_array[1:5, 1:2, "mu"]
-
## # A draws_array: 5 iterations, 2 chains, and 1 variables
-## , , variable = mu
-## 
-##          chain
-## iteration   1    2
-##         1 2.0  3.0
-##         2 1.5  8.2
-##         3 5.8 -1.2
-##         4 6.8 10.9
-##         5 1.8  9.8
+
## # A draws_array: 5 iterations, 2 chains, and 1 variables
+## , , variable = mu
+## 
+##          chain
+## iteration   1    2
+##         1 2.0  3.0
+##         2 1.5  8.2
+##         3 5.8 -1.2
+##         4 6.8 10.9
+##         5 1.8  9.8

The major difference between how posterior behaves when indexing and how base R behaves is that posterior will not drop dimensions with only one level. That is, even though there is only one variable left after subsetting, the result of the subsetting above is still a draws_array and not a draws_matrix.

-
-

-Mutating (transformations of variables)

+
+

Mutating (transformations of variables) +

The magic of having obtained draws from the joint posterior (or prior) distribution of a set of variables is that these draws can also be used to obtain draws from any other variable that is a function of the original variables. That is, if we are interested in the posterior distribution of, say, phi = (mu + tau)^2 all we have to do is to perform the transformation for each of the individual draws to obtain draws from the posterior distribution of the transformed variable. This procedure is handled by mutate_variables().

 x <- mutate_variables(eight_schools_df, phi = (mu + tau)^2)
-x <- subset_draws(x, c("mu", "tau", "phi"))
-print(x)
-
## # A draws_df: 100 iterations, 4 chains, and 3 variables
-##      mu tau   phi
-## 1  2.01 2.8  22.8
-## 2  1.46 7.0  71.2
-## 3  5.81 9.7 240.0
-## 4  6.85 4.8 135.4
-## 5  1.81 2.8  21.7
-## 6  3.84 4.1  62.8
-## 7  5.47 4.0  88.8
-## 8  1.20 1.5   7.1
-## 9  0.15 3.9  16.6
-## 10 7.17 1.8  79.9
-## # ... with 390 more draws
-## # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
+x <- subset_draws(x, c("mu", "tau", "phi")) +print(x)
+
## # A draws_df: 100 iterations, 4 chains, and 3 variables
+##      mu tau   phi
+## 1  2.01 2.8  22.8
+## 2  1.46 7.0  71.2
+## 3  5.81 9.7 240.0
+## 4  6.85 4.8 135.4
+## 5  1.81 2.8  21.7
+## 6  3.84 4.1  62.8
+## 7  5.47 4.0  88.8
+## 8  1.20 1.5   7.1
+## 9  0.15 3.9  16.6
+## 10 7.17 1.8  79.9
+## # ... with 390 more draws
+## # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
-
-

-Renaming

+
+

Renaming +

To rename variables use rename_variables(). Here we rename the scalar mu to mean and the vector theta to alpha.

 # mu is a scalar, theta is a vector
 x <- rename_variables(eight_schools_df, mean = mu, alpha = theta)
 variables(x)
-
##  [1] "mean"     "tau"      "alpha[1]" "alpha[2]" "alpha[3]" "alpha[4]"
-##  [7] "alpha[5]" "alpha[6]" "alpha[7]" "alpha[8]"
+
##  [1] "mean"     "tau"      "alpha[1]" "alpha[2]" "alpha[3]" "alpha[4]"
+##  [7] "alpha[5]" "alpha[6]" "alpha[7]" "alpha[8]"

In the call to rename_variables() above, mu and theta can be quoted or unquoted.

It is also possible to rename individual elements of non-scalar parameters, for example we can rename just the first element of alpha:

 x <- rename_variables(x, a1 = `alpha[1]`)
 variables(x)
-
##  [1] "mean"     "tau"      "a1"       "alpha[2]" "alpha[3]" "alpha[4]"
-##  [7] "alpha[5]" "alpha[6]" "alpha[7]" "alpha[8]"
+
##  [1] "mean"     "tau"      "a1"       "alpha[2]" "alpha[3]" "alpha[4]"
+##  [7] "alpha[5]" "alpha[6]" "alpha[7]" "alpha[8]"
-
-

-Binding

+
+

Binding +

The bind_draws() method can be used to combine draws objects along different dimensions. As an example, suppose we have several different draws_matrix objects:

-x1 <- draws_matrix(alpha = rnorm(5), beta = rnorm(5))
-x2 <- draws_matrix(alpha = rnorm(5), beta = rnorm(5))
-x3 <- draws_matrix(theta = rexp(5))
+x1 <- draws_matrix(alpha = rnorm(5), beta = rnorm(5)) +x2 <- draws_matrix(alpha = rnorm(5), beta = rnorm(5)) +x3 <- draws_matrix(theta = rexp(5))

We can bind x1 and x3 together along the 'variable' dimension to get a single draws_matrix with the variables from both x1 and x3:

 x4 <- bind_draws(x1, x3, along = "variable")
-print(x4)
-
## # A draws_matrix: 5 iterations, 1 chains, and 3 variables
-##     variable
-## draw  alpha  beta  theta
-##    1 -1.935  0.84 0.0058
-##    2  0.684 -1.26 1.5981
-##    3  1.364 -0.46 0.6236
-##    4  0.377  0.35 4.5714
-##    5 -0.049  0.34 0.7098
+print(x4)
+
## # A draws_matrix: 5 iterations, 1 chains, and 3 variables
+##     variable
+## draw alpha  beta theta
+##    1  1.37  1.82  0.68
+##    2 -0.75  0.25  0.26
+##    3  0.28  1.12  1.28
+##    4 -1.49 -1.61  0.25
+##    5  0.95  1.56  0.12

Because x1 and x2 have the same variables, we can bind them along the 'draw' dimension to create a single draws_matrix with more draws:

 x5 <- bind_draws(x1, x2, along = "draw")
-print(x5)
-
## # A draws_matrix: 10 iterations, 1 chains, and 2 variables
-##     variable
-## draw  alpha   beta
-##   1  -1.935  0.843
-##   2   0.684 -1.256
-##   3   1.364 -0.458
-##   4   0.377  0.346
-##   5  -0.049  0.338
-##   6  -0.369  1.240
-##   7   1.238  1.425
-##   8  -1.691 -0.297
-##   9   1.265 -0.935
-##   10  0.884  0.087
+print(x5)
+
## # A draws_matrix: 10 iterations, 1 chains, and 2 variables
+##     variable
+## draw  alpha  beta
+##   1   1.367  1.82
+##   2  -0.748  0.25
+##   3   0.283  1.12
+##   4  -1.491 -1.61
+##   5   0.947  1.56
+##   6   0.882 -0.38
+##   7  -0.888 -0.13
+##   8   0.032  1.06
+##   9  -0.333 -1.86
+##   10 -0.938  0.17

As with all posterior methods, bind_draws() can be used with all draws formats and depending on the format different dimensions are available to bind on. For example, we can bind draws_array objects together by iteration, chain, or variable, but a 2-D draws_matrix with the chains combined can only by bound by draw and variable.

-
-

-Summaries and diagnostics

-
-

-summarise_draws() basic usage

+
+

Summaries and diagnostics +

+
+

summarise_draws() basic usage +

Computing summaries of posterior or prior draws and convergence diagnostics for posterior draws are some of the most common tasks when working with Bayesian models fit using Markov Chain Monte Carlo (MCMC) methods. The posterior package provides a flexible interface for this purpose via summarise_draws() (or summarize_draws()), which can be passed any of the formats supported by the package.

 # summarise_draws or summarize_draws
 summarise_draws(eight_schools_df)
-
## # A tibble: 10 x 10
-##    variable  mean median    sd   mad      q5   q95  rhat ess_bulk ess_tail
-##    <chr>    <dbl>  <dbl> <dbl> <dbl>   <dbl> <dbl> <dbl>    <dbl>    <dbl>
-##  1 mu        4.18   4.16  3.40  3.57  -0.854  9.39  1.02     558.     322.
-##  2 tau       4.16   3.07  3.58  2.89   0.309 11.0   1.01     246.     202.
-##  3 theta[1]  6.75   5.97  6.30  4.87  -1.23  18.9   1.01     400.     254.
-##  4 theta[2]  5.25   5.13  4.63  4.25  -1.97  12.5   1.02     564.     372.
-##  5 theta[3]  3.04   3.99  6.80  4.94 -10.3   11.9   1.01     312.     205.
-##  6 theta[4]  4.86   4.99  4.92  4.51  -3.57  12.2   1.02     695.     252.
-##  7 theta[5]  3.22   3.72  5.08  4.38  -5.93  10.8   1.01     523.     306.
-##  8 theta[6]  3.99   4.14  5.16  4.81  -4.32  11.5   1.02     548.     205.
-##  9 theta[7]  6.50   5.90  5.26  4.54  -1.19  15.4   1.00     434.     308.
-## 10 theta[8]  4.57   4.64  5.25  4.89  -3.79  12.2   1.02     355.     146.
+
## # A tibble: 10 × 10
+##    variable  mean median    sd   mad      q5   q95  rhat ess_bulk ess_tail
+##    <chr>    <dbl>  <dbl> <dbl> <dbl>   <dbl> <dbl> <dbl>    <dbl>    <dbl>
+##  1 mu        4.18   4.16  3.40  3.57  -0.854  9.39  1.02     558.     322.
+##  2 tau       4.16   3.07  3.58  2.89   0.309 11.0   1.01     246.     202.
+##  3 theta[1]  6.75   5.97  6.30  4.87  -1.23  18.9   1.01     400.     254.
+##  4 theta[2]  5.25   5.13  4.63  4.25  -1.97  12.5   1.02     564.     372.
+##  5 theta[3]  3.04   3.99  6.80  4.94 -10.3   11.9   1.01     312.     205.
+##  6 theta[4]  4.86   4.99  4.92  4.51  -3.57  12.2   1.02     695.     252.
+##  7 theta[5]  3.22   3.72  5.08  4.38  -5.93  10.8   1.01     523.     306.
+##  8 theta[6]  3.99   4.14  5.16  4.81  -4.32  11.5   1.02     548.     205.
+##  9 theta[7]  6.50   5.90  5.26  4.54  -1.19  15.4   1.00     434.     308.
+## 10 theta[8]  4.57   4.64  5.25  4.89  -3.79  12.2   1.02     355.     146.

The result is a data frame with one row per variable and one column per summary statistic or convergence diagnostic. The summaries rhat, ess_bulk, and ess_tail are described in Vehtari et al. (2020). We can choose which summaries to compute by passing additional arguments, either functions or names of functions. For instance, if we only wanted the mean and its corresponding Monte Carlo Standard Error (MCSE) we could use either of these options:

 # the function mcse_mean is provided by the posterior package
 s1 <- summarise_draws(eight_schools_df, "mean", "mcse_mean") 
 s2 <- summarise_draws(eight_schools_df, mean, mcse_mean) 
-identical(s1, s2)
-
## [1] TRUE
+identical(s1, s2)
+
## [1] TRUE
-print(s1)
-
## # A tibble: 10 x 3
-##    variable  mean mcse_mean
-##    <chr>    <dbl>     <dbl>
-##  1 mu        4.18     0.150
-##  2 tau       4.16     0.213
-##  3 theta[1]  6.75     0.319
-##  4 theta[2]  5.25     0.202
-##  5 theta[3]  3.04     0.447
-##  6 theta[4]  4.86     0.189
-##  7 theta[5]  3.22     0.232
-##  8 theta[6]  3.99     0.222
-##  9 theta[7]  6.50     0.250
-## 10 theta[8]  4.57     0.273
+print(s1)
+
## # A tibble: 10 × 3
+##    variable  mean mcse_mean
+##    <chr>    <dbl>     <dbl>
+##  1 mu        4.18     0.150
+##  2 tau       4.16     0.213
+##  3 theta[1]  6.75     0.319
+##  4 theta[2]  5.25     0.202
+##  5 theta[3]  3.04     0.447
+##  6 theta[4]  4.86     0.189
+##  7 theta[5]  3.22     0.232
+##  8 theta[6]  3.99     0.222
+##  9 theta[7]  6.50     0.250
+## 10 theta[8]  4.57     0.273
-
-

-Changing column names

+
+

Changing column names +

The column names in the output can be changed by providing the functions as name-value pairs, where the name is the name to use in the output and the value is a function name or definition. For example, here we change the names mean and sd to posterior_mean and posterior_sd.

 summarise_draws(eight_schools_df, posterior_mean = mean, posterior_sd = sd)
-
## # A tibble: 10 x 3
-##    variable posterior_mean posterior_sd
-##    <chr>             <dbl>        <dbl>
-##  1 mu                 4.18         3.40
-##  2 tau                4.16         3.58
-##  3 theta[1]           6.75         6.30
-##  4 theta[2]           5.25         4.63
-##  5 theta[3]           3.04         6.80
-##  6 theta[4]           4.86         4.92
-##  7 theta[5]           3.22         5.08
-##  8 theta[6]           3.99         5.16
-##  9 theta[7]           6.50         5.26
-## 10 theta[8]           4.57         5.25
+
## # A tibble: 10 × 3
+##    variable posterior_mean posterior_sd
+##    <chr>             <dbl>        <dbl>
+##  1 mu                 4.18         3.40
+##  2 tau                4.16         3.58
+##  3 theta[1]           6.75         6.30
+##  4 theta[2]           5.25         4.63
+##  5 theta[3]           3.04         6.80
+##  6 theta[4]           4.86         4.92
+##  7 theta[5]           3.22         5.08
+##  8 theta[6]           3.99         5.16
+##  9 theta[7]           6.50         5.26
+## 10 theta[8]           4.57         5.25
-
-

-Using custom functions

+
+

Using custom functions +

For a function to work with summarise_draws(), it needs to take a vector or matrix of numeric values and return a single numeric value or a named vector of numeric values. Additional arguments to the function can be specified in a list passed to the .args argument.

 weighted_mean <- function(x, wts) {
-  sum(x * wts)/sum(wts)
+  sum(x * wts)/sum(wts)
 }
 summarise_draws(
   eight_schools_df, 
   weighted_mean, 
-  .args = list(wts = rexp(ndraws(eight_schools_df)))
+  .args = list(wts = rexp(ndraws(eight_schools_df)))
 )
-
## # A tibble: 10 x 2
-##    variable weighted_mean
-##    <chr>            <dbl>
-##  1 mu                4.24
-##  2 tau               4.14
-##  3 theta[1]          6.80
-##  4 theta[2]          5.26
-##  5 theta[3]          3.53
-##  6 theta[4]          4.83
-##  7 theta[5]          3.40
-##  8 theta[6]          3.77
-##  9 theta[7]          6.42
-## 10 theta[8]          4.20
+
## # A tibble: 10 × 2
+##    variable weighted_mean
+##    <chr>            <dbl>
+##  1 mu                3.97
+##  2 tau               3.89
+##  3 theta[1]          6.62
+##  4 theta[2]          5.03
+##  5 theta[3]          2.58
+##  6 theta[4]          4.61
+##  7 theta[5]          3.17
+##  8 theta[6]          3.98
+##  9 theta[7]          6.07
+## 10 theta[8]          4.14
-
-

-Specifying functions using lambda-like syntax

-

It is also possible to specify a summary function using a one-sided formula that follows the conventions supported by rlang::as_function(). For example, the function

+
+

Specifying functions using lambda-like syntax +

+

It is also possible to specify a summary function using a one-sided formula that follows the conventions supported by rlang::as_function(). For example, the function

-function(x) quantile(x, probs = c(0.4, 0.6))
+function(x) quantile(x, probs = c(0.4, 0.6))

can be simplified to

 # for multiple arguments `.x` and `.y` can be used, see ?rlang::as_function
-~quantile(., probs = c(0.4, 0.6))
+~quantile(., probs = c(0.4, 0.6))

Both can be used with summarise_draws() and produce the same output:

-summarise_draws(eight_schools_df, function(x) quantile(x, probs = c(0.4, 0.6)))
-
## # A tibble: 10 x 3
-##    variable `40%` `60%`
-##    <chr>    <dbl> <dbl>
-##  1 mu        3.41  5.35
-##  2 tau       2.47  3.96
-##  3 theta[1]  4.95  7.01
-##  4 theta[2]  4.32  6.13
-##  5 theta[3]  2.54  5.33
-##  6 theta[4]  3.78  6.11
-##  7 theta[5]  2.69  4.69
-##  8 theta[6]  2.92  5.47
-##  9 theta[7]  4.81  7.33
-## 10 theta[8]  3.50  5.92
+summarise_draws(eight_schools_df, function(x) quantile(x, probs = c(0.4, 0.6)))
+
## # A tibble: 10 × 3
+##    variable `40%` `60%`
+##    <chr>    <dbl> <dbl>
+##  1 mu        3.41  5.35
+##  2 tau       2.47  3.96
+##  3 theta[1]  4.95  7.01
+##  4 theta[2]  4.32  6.13
+##  5 theta[3]  2.54  5.33
+##  6 theta[4]  3.78  6.11
+##  7 theta[5]  2.69  4.69
+##  8 theta[6]  2.92  5.47
+##  9 theta[7]  4.81  7.33
+## 10 theta[8]  3.50  5.92
-summarise_draws(eight_schools_df, ~quantile(.x, probs = c(0.4, 0.6)))
-
## # A tibble: 10 x 3
-##    variable `40%` `60%`
-##    <chr>    <dbl> <dbl>
-##  1 mu        3.41  5.35
-##  2 tau       2.47  3.96
-##  3 theta[1]  4.95  7.01
-##  4 theta[2]  4.32  6.13
-##  5 theta[3]  2.54  5.33
-##  6 theta[4]  3.78  6.11
-##  7 theta[5]  2.69  4.69
-##  8 theta[6]  2.92  5.47
-##  9 theta[7]  4.81  7.33
-## 10 theta[8]  3.50  5.92
-

See help("as_function", "rlang") for details on specifying these functions.

+summarise_draws(eight_schools_df, ~quantile(.x, probs = c(0.4, 0.6)))
+
## # A tibble: 10 × 3
+##    variable `40%` `60%`
+##    <chr>    <dbl> <dbl>
+##  1 mu        3.41  5.35
+##  2 tau       2.47  3.96
+##  3 theta[1]  4.95  7.01
+##  4 theta[2]  4.32  6.13
+##  5 theta[3]  2.54  5.33
+##  6 theta[4]  3.78  6.11
+##  7 theta[5]  2.69  4.69
+##  8 theta[6]  2.92  5.47
+##  9 theta[7]  4.81  7.33
+## 10 theta[8]  3.50  5.92
+

See help("as_function", "rlang") for details on specifying these functions.

-
-

-Other diagnostics

+
+

Other diagnostics +

In addition to the default diagnostic functions used by summarise_draws() (rhat(), ess_bulk(), ess_tail()), posterior also provides additional diagnostics like effective sample sizes and Monte Carlo standard errors for quantiles and standard deviations, an experimental new diagnostic called R*, and others. For a list of available diagnostics and links to their individual help pages see help("diagnostics", "posterior").

-

If you have suggestions for additional diagnostics that should be implemented in posterior, please open an issue at https://github.com/stan-dev/posterior/issues.

+

If you have suggestions for additional diagnostics that should be implemented in posterior, please open an issue at https://github.com/stan-dev/posterior/issues.

-
-

-Other methods for working with draws objects

+
+

Other methods for working with draws objects +

In addition to the methods demonstrated in this vignette, posterior has various other methods available for working with draws objects. The following is a (potentially incomplete) list.

@@ -646,11 +648,11 @@

-

If you have suggestions for additional methods that would be useful for working with draws objects, please open an issue at https://github.com/stan-dev/posterior/issues.

+

If you have suggestions for additional methods that would be useful for working with draws objects, please open an issue at https://github.com/stan-dev/posterior/issues.

-
-

-References

+
+

References +

Gelman A., Carlin J. B., Stern H. S., David B. Dunson D. B., Aki Vehtari A., & Rubin D. B. (2013). Bayesian Data Analysis, Third Edition. Chapman and Hall/CRC.

Vehtari A., Gelman A., Simpson D., Carpenter B., & Bürkner P. C. (2020). Rank-normalization, folding, and localization: An improved Rhat for assessing convergence of MCMC. Bayesian Analysis.

@@ -667,11 +669,13 @@

-

Site built with pkgdown 1.6.1.

+

+

Site built with pkgdown 2.0.1.

@@ -680,5 +684,7 @@

+ + diff --git a/docs/articles/rvar.html b/docs/articles/rvar.html index 44dcd4e0..822d6222 100644 --- a/docs/articles/rvar.html +++ b/docs/articles/rvar.html @@ -19,6 +19,8 @@ + +
+
-
-

-Introduction

+
+

Introduction +

This vignette describes the rvar() datatype, a multidimensional, sample-based representation of random variables designed to act as much like base R arrays as possible (e.g., by supporting many math operators and functions). This format is also the basis of the draws_rvars() format.

-

The rvar() datatype is inspired by the rv package and Kerman and Gelman (2007), though with a slightly different backing format (multidimensional arrays). It is also designed to interoperate with vectorized distributions in the distributional package, to be able to be used inside data.frame()s and tibble()s, and to be used with distribution visualizations in the ggdist package.

+

The rvar() datatype is inspired by the rv package and Kerman and Gelman (2007), though with a slightly different backing format (multidimensional arrays). It is also designed to interoperate with vectorized distributions in the distributional package, to be able to be used inside data.frame()s and tibble()s, and to be used with distribution visualizations in the ggdist package.

-
-

-The rvars datatype

+
+

The rvars datatype +

The rvar() datatype is a wrapper around a multidimensional array where the first dimension is the number of draws in the random variable. The most direct way to create a random variable is to pass such an array to the rvar() function.

For example, to create a “scalar” rvar, one would pass a one-dimensional array or a vector whose length (here 4000) is the desired number of draws:

-x <- rvar(rnorm(4000, mean = 1, sd = 1))
+x <- rvar(rnorm(4000, mean = 1, sd = 1))
 x
-
## rvar<4000>[1] mean ± sd:
-## [1] 1 ± 1
+
## rvar<4000>[1] mean ± sd:
+## [1] 1 ± 1

The default display of an rvar shows the mean and standard deviation of each element of the array.

We can create random vectors by adding an additional dimension beyond just the draws dimension to the input array:

 n <- 4   # length of output vector
-x <- rvar(array(rnorm(4000*n, mean = 1, sd = 1), dim = c(4000, n)))
+x <- rvar(array(rnorm(4000*n, mean = 1, sd = 1), dim = c(4000, n)))
 x
-
## rvar<4000>[4] mean ± sd:
-## [1] 1.01 ± 0.99  1.02 ± 0.99  0.98 ± 1.00  0.99 ± 1.02
+
## rvar<4000>[4] mean ± sd:
+## [1] 1.01 ± 0.99  1.02 ± 0.99  0.98 ± 1.00  0.99 ± 1.02

Or we can create a random matrix:

 rows <- 4
 cols <- 3
-x <- rvar(array(rnorm(4000 * rows * cols, mean = 1, sd = 1), dim = c(4000, rows, cols)))
+x <- rvar(array(rnorm(4000 * rows * cols, mean = 1, sd = 1), dim = c(4000, rows, cols)))
 x
-
## rvar<4000>[4,3] mean ± sd:
-##      [,1]         [,2]         [,3]        
-## [1,] 1.00 ± 0.98  1.00 ± 1.00  0.97 ± 1.00 
-## [2,] 1.00 ± 1.01  1.01 ± 1.02  0.99 ± 0.99 
-## [3,] 1.02 ± 1.01  0.99 ± 1.00  1.00 ± 0.99 
-## [4,] 1.01 ± 1.01  1.02 ± 1.00  1.00 ± 1.01
+
## rvar<4000>[4,3] mean ± sd:
+##      [,1]         [,2]         [,3]        
+## [1,] 1.00 ± 0.98  1.00 ± 1.00  0.97 ± 1.00 
+## [2,] 1.00 ± 1.01  1.01 ± 1.02  0.99 ± 0.99 
+## [3,] 1.02 ± 1.01  0.99 ± 1.00  1.00 ± 0.99 
+## [4,] 1.01 ± 1.01  1.02 ± 1.00  1.00 ± 1.01

Or any array up to an arbitrary number of dimensions. The array backing an rvar can be accessed (and modified, with caution) via draws_of():

-
##  num [1:4000, 1:4, 1:3] -0.6879 0.0448 0.3519 1.261 -0.2197 ...
-##  - attr(*, "dimnames")=List of 3
-##   ..$ : chr [1:4000] "1" "2" "3" "4" ...
-##   ..$ : NULL
-##   ..$ : NULL
+str(draws_of(x))
+
##  num [1:4000, 1:4, 1:3] -0.6879 0.0448 0.3519 1.261 -0.2197 ...
+##  - attr(*, "dimnames")=List of 3
+##   ..$ : chr [1:4000] "1" "2" "3" "4" ...
+##   ..$ : NULL
+##   ..$ : NULL

While the above examples assume all draws come from a single chain, rvars can also contain samples from multiple chains. For example, if your array of draws has iterations as the first dimension and chains as the second dimension, you can use with_chains = TRUE to create an rvar that includes chain information:

 iterations <- 1000
 chains <- 4
 rows <- 4
 cols <- 3
-x_array <- array(
-  rnorm(iterations * chains * rows * cols, mean = 1, sd = 1),
-  dim = c(iterations, chains, rows, cols)
+x_array <- array(
+  rnorm(iterations * chains * rows * cols, mean = 1, sd = 1),
+  dim = c(iterations, chains, rows, cols)
 )
 x <- rvar(x_array, with_chains = TRUE)
 x
-
## rvar<1000,4>[4,3] mean ± sd:
-##      [,1]         [,2]         [,3]        
-## [1,] 0.97 ± 1.00  1.00 ± 0.99  1.02 ± 0.99 
-## [2,] 1.02 ± 1.00  0.99 ± 1.01  1.01 ± 0.99 
-## [3,] 1.00 ± 1.00  1.00 ± 1.00  1.01 ± 1.00 
-## [4,] 1.03 ± 0.99  1.05 ± 1.00  0.98 ± 1.00
+
## rvar<1000,4>[4,3] mean ± sd:
+##      [,1]         [,2]         [,3]        
+## [1,] 0.97 ± 1.00  1.00 ± 0.99  1.02 ± 0.99 
+## [2,] 1.02 ± 1.00  0.99 ± 1.01  1.01 ± 0.99 
+## [3,] 1.00 ± 1.00  1.00 ± 1.00  1.01 ± 1.00 
+## [4,] 1.03 ± 0.99  1.05 ± 1.00  0.98 ± 1.00

Manual construction and modification of rvars in this way is not always recommended unless you need it for performance reasons: several other higher-level interfaces to constructing and manipulating rvars are described below.

-
-

-The draws_rvars datatype

+
+

The draws_rvars datatype +

The draws_rvars() datatype, like all draws datatypes in posterior, contains multiple variables in a joint sample from some distribution (e.g. a posterior or prior distribution).

You can construct draws_rvars() objects directly using the draws_rvars() function. The input rvars must have the same number of chains and iterations, but can otherwise have different shapes:

-d <- draws_rvars(x = x, y = rvar(rnorm(iterations * chains), nchains = 4))
+d <- draws_rvars(x = x, y = rvar(rnorm(iterations * chains), nchains = 4))
 d
-
## # A draws_rvars: 1000 iterations, 4 chains, and 2 variables
-## $x: rvar<1000,4>[4,3] mean ± sd:
-##      [,1]         [,2]         [,3]        
-## [1,] 0.97 ± 1.00  1.00 ± 0.99  1.02 ± 0.99 
-## [2,] 1.02 ± 1.00  0.99 ± 1.01  1.01 ± 0.99 
-## [3,] 1.00 ± 1.00  1.00 ± 1.00  1.01 ± 1.00 
-## [4,] 1.03 ± 0.99  1.05 ± 1.00  0.98 ± 1.00 
-## 
-## $y: rvar<1000,4>[1] mean ± sd:
-## [1] 0.0034 ± 1
-

Existing objects can also be converted to the draws_rvars() format using as_draws_rvars(). Below is the example_draws("multi_normal") dataset converted into the draws_rvars() format. This dataset has 100 iterations from 4 chains from the posterior of a a 3-dimensional multivariate normal model. The mu variable is a mean vector of length 3 and the Sigma variable is a \(3 \times 3\) covariance matrix:

+
## # A draws_rvars: 1000 iterations, 4 chains, and 2 variables
+## $x: rvar<1000,4>[4,3] mean ± sd:
+##      [,1]         [,2]         [,3]        
+## [1,] 0.97 ± 1.00  1.00 ± 0.99  1.02 ± 0.99 
+## [2,] 1.02 ± 1.00  0.99 ± 1.01  1.01 ± 0.99 
+## [3,] 1.00 ± 1.00  1.00 ± 1.00  1.01 ± 1.00 
+## [4,] 1.03 ± 0.99  1.05 ± 1.00  0.98 ± 1.00 
+## 
+## $y: rvar<1000,4>[1] mean ± sd:
+## [1] 0.0034 ± 1
+

Existing objects can also be converted to the draws_rvars() format using as_draws_rvars(). Below is the example_draws("multi_normal") dataset converted into the draws_rvars() format. This dataset has 100 iterations from 4 chains from the posterior of a a 3-dimensional multivariate normal model. The mu variable is a mean vector of length 3 and the Sigma variable is a \(3 \times 3\) covariance matrix:

 post <- as_draws_rvars(example_draws("multi_normal"))
 post
-
## # A draws_rvars: 100 iterations, 4 chains, and 2 variables
-## $mu: rvar<100,4>[3] mean ± sd:
-## [1] 0.051 ± 0.11  0.111 ± 0.20  0.186 ± 0.31 
-## 
-## $Sigma: rvar<100,4>[3,3] mean ± sd:
-##      [,1]          [,2]          [,3]         
-## [1,]  1.28 ± 0.17   0.53 ± 0.20  -0.40 ± 0.28 
-## [2,]  0.53 ± 0.20   3.67 ± 0.45  -2.10 ± 0.48 
-## [3,] -0.40 ± 0.28  -2.10 ± 0.48   8.12 ± 0.95
+
## # A draws_rvars: 100 iterations, 4 chains, and 2 variables
+## $mu: rvar<100,4>[3] mean ± sd:
+## [1] 0.051 ± 0.11  0.111 ± 0.20  0.186 ± 0.31 
+## 
+## $Sigma: rvar<100,4>[3,3] mean ± sd:
+##      [,1]          [,2]          [,3]         
+## [1,]  1.28 ± 0.17   0.53 ± 0.20  -0.40 ± 0.28 
+## [2,]  0.53 ± 0.20   3.67 ± 0.45  -2.10 ± 0.48 
+## [3,] -0.40 ± 0.28  -2.10 ± 0.48   8.12 ± 0.95

The draws_rvars() datatype works much the same way that other draws formats do; see the main package vignette at vignette("posterior") for an introduction to draws objects. One difference is that draws_rvars counts variables differently, because it allows variables to be multidimensional. For example, the post object above contains two variables, mu and Sigma:

 variables(post)
-
## [1] "mu"    "Sigma"
+
## [1] "mu"    "Sigma"

But converted to a draws_list(), it contains one variable for each combination of the dimensions of its variables:

-
##  [1] "mu[1]"      "mu[2]"      "mu[3]"      "Sigma[1,1]" "Sigma[2,1]"
-##  [6] "Sigma[3,1]" "Sigma[1,2]" "Sigma[2,2]" "Sigma[3,2]" "Sigma[1,3]"
-## [11] "Sigma[2,3]" "Sigma[3,3]"
+
##  [1] "mu[1]"      "mu[2]"      "mu[3]"      "Sigma[1,1]" "Sigma[2,1]"
+##  [6] "Sigma[3,1]" "Sigma[1,2]" "Sigma[2,2]" "Sigma[3,2]" "Sigma[1,3]"
+## [11] "Sigma[2,3]" "Sigma[3,3]"
-
-

-Math with rvars

-

The rvar() datatype implements most math operations, including basic arithmetic, functions in the Math and Summary groups, like log() and exp() (see help("groupGeneric") for a list), and more. Binary operators can be performed between multiple rvars or between rvars and numerics. A simple example:

+
+

Math with rvars +

+

The rvar() datatype implements most math operations, including basic arithmetic, functions in the Math and Summary groups, like log() and exp() (see help("groupGeneric") for a list), and more. Binary operators can be performed between multiple rvars or between rvars and numerics. A simple example:

 mu <- post$mu
 Sigma <- post$Sigma
 
 mu + 1
-
## rvar<100,4>[3] mean ± sd:
-## [1] 1.1 ± 0.11  1.1 ± 0.20  1.2 ± 0.31
-

Matrix multiplication is also implemented (using a tensor product under the hood). Because the normal matrix multiplication operator in R (%*%) cannot be properly implemented for S3 datatypes, rvar uses %**% instead. A trivial example:

+
## rvar<100,4>[3] mean ± sd:
+## [1] 1.1 ± 0.11  1.1 ± 0.20  1.2 ± 0.31
+

Matrix multiplication is also implemented (using a tensor product under the hood). Because the normal matrix multiplication operator in R (%*%) cannot be properly implemented for S3 datatypes, rvar uses %**% instead. A trivial example:

-Sigma %**% diag(1:3)
-
## rvar<100,4>[3,3] mean ± sd:
-##      [,1]          [,2]          [,3]         
-## [1,]  1.28 ± 0.17   1.05 ± 0.40  -1.21 ± 0.85 
-## [2,]  0.53 ± 0.20   7.33 ± 0.89  -6.30 ± 1.44 
-## [3,] -0.40 ± 0.28  -4.20 ± 0.96  24.35 ± 2.84
+Sigma %**% diag(1:3)
+
## rvar<100,4>[3,3] mean ± sd:
+##      [,1]          [,2]          [,3]         
+## [1,]  1.28 ± 0.17   1.05 ± 0.40  -1.21 ± 0.85 
+## [2,]  0.53 ± 0.20   7.33 ± 0.89  -6.30 ± 1.44 
+## [3,] -0.40 ± 0.28  -4.20 ± 0.96  24.35 ± 2.84

The set of mathematical functions and operators supported by rvars includes:

@@ -272,113 +274,113 @@

- + - +
Arithmetic operators -+, -, *, /, ^, %%, %/% ++, -, *, /, ^, %%, %/%
Logical operators -&, |, ! +&, |, !
Comparison operators -==, !=, <, <=, >=, > +==, !=, <, <=, >=, >
Matrix multiplication%**%%**%
Basic functions -abs(), sign()
sqrt()
floor(), ceiling(), trunc(), round(), signif() +abs(), sign()
sqrt()
floor(), ceiling(), trunc(), round(), signif()
Logarithms and exponentials -exp(), expm1()
log(), log10(), log2(), log1p() +exp(), expm1()
log(), log10(), log2(), log1p()
Trigonometric functions -cos(), sin(), tan()
cospi(), sinpi(), tanpi()
acos(), asin(), atan() +cos(), sin(), tan()
cospi(), sinpi(), tanpi()
acos(), asin(), atan()
Hyperbolic functions -cosh(), sinh(), tanh()
acosh(), asinh(), atanh() +cosh(), sinh(), tanh()
acosh(), asinh(), atanh()
Special functions -lgamma(), gamma(), digamma(), trigamma() +lgamma(), gamma(), digamma(), trigamma()
Cumulative functions -cumsum(), cumprod(), cummax(), cummin() +cumsum(), cumprod(), cummax(), cummin()
Array transposition -t(), aperm() +t(), aperm()
Matrix decompositionchol()chol()
-
-

-Expectations and summary functions

-

The E() function is an alias of mean(), producing means within each cell of an rvar. For example, given mu:

+
+

Expectations and summary functions +

+

The E() function is an alias of mean(), producing means within each cell of an rvar. For example, given mu:

 mu
-
## rvar<100,4>[3] mean ± sd:
-## [1] 0.051 ± 0.11  0.111 ± 0.20  0.186 ± 0.31
+
## rvar<100,4>[3] mean ± sd:
+## [1] 0.051 ± 0.11  0.111 ± 0.20  0.186 ± 0.31

We can get the expectation of each cell of mu:

 E(mu)
-
## [1] 0.05139284 0.11132363 0.18581977
-

Expectations of logical expressions are probabilities, and can be computed either with E() / mean() or with Pr(). Pr() is provided as notational sugar, but also checks that the input is a logical variable before taking the mean:

+
## [1] 0.05139284 0.11132363 0.18581977
+

Expectations of logical expressions are probabilities, and can be computed either with E() / mean() or with Pr(). Pr() is provided as notational sugar, but also checks that the input is a logical variable before taking the mean:

 Pr(mu > 0)
-
## [1] 0.6600 0.6900 0.7025
+
## [1] 0.6600 0.6900 0.7025

More generally, the rvar data type provides two types of summary functions:

  1. Summary functions that mimic base-R vector summary functions, except applied to rvar vectors. These apply their summaries over elements of the input vectors within each draw, generally returning an rvar of length 1. These functions are prefixed with rvar_ as a reminder that they return rvars. Here is an example of rvar_mean():

    -
    ## rvar<100,4>[1] mean ± sd:
    -## [1] 0.12 ± 0.11
    +
    ## rvar<100,4>[1] mean ± sd:
    +## [1] 0.12 ± 0.11
  2. -

    Summary functions that summarise within elements of input vectors and over draws. These summary functions generally return base arrays (numeric or logical) of the same shape as the input rvar, and are especially useful for diagnostic summaries. These summary functions are not prefixed with rvar_ as they do not return rvars. Here is an example of mean():

    +

    Summary functions that summarise within elements of input vectors and over draws. These summary functions generally return base arrays (numeric or logical) of the same shape as the input rvar, and are especially useful for diagnostic summaries. These summary functions are not prefixed with rvar_ as they do not return rvars. Here is an example of mean():

    -mean(mu)
    -
    ## [1] 0.05139284 0.11132363 0.18581977
    +mean(mu)
+
## [1] 0.05139284 0.11132363 0.18581977

You should expect the same values from these functions (though in a different shape) when you use them with summarise_draws(), for example:

 summarise_draws(mu, mean)
-
## # A tibble: 3 x 2
-##   variable   mean
-##   <chr>     <dbl>
-## 1 mu[1]    0.0514
-## 2 mu[2]    0.111 
-## 3 mu[3]    0.186
+
## # A tibble: 3 × 2
+##   variable   mean
+##   <chr>     <dbl>
+## 1 mu[1]    0.0514
+## 2 mu[2]    0.111 
+## 3 mu[3]    0.186

Here is a table of both types of summary functions:

@@ -416,7 +418,7 @@

rvar_median()
rvar_sum(), rvar_prod()
rvar_min(), rvar_max() -median()
sum(), prod()
min(), max() +median()
sum(), prod()
min(), max() @@ -425,7 +427,7 @@

rvar_mean()
N/A -mean(), E()
Pr(): enforces that input is logical +mean(), E()
Pr(): enforces that input is logical @@ -434,7 +436,7 @@

rvar_sd()
rvar_var()
rvar_mad() -sd()
var(), variance()
mad() +sd()
var(), variance()
mad() @@ -443,7 +445,7 @@

rvar_range()
Note: length(res) == 2 -range()
Note: dim(res) == c(2, dim(x)) +range()
Note: dim(res) == c(2, dim(x)) @@ -452,7 +454,7 @@

rvar_quantile()
Note: length(res) == length(probs) -quantile()
Note: dim(res) == c(length(probs), dim(x)) +quantile()
Note: dim(res) == c(length(probs), dim(x)) @@ -461,7 +463,7 @@

rvar_all(), rvar_any() -all(), any() +all(), any() @@ -469,7 +471,7 @@

rvar_is_finite()
rvar_is_infinite()
rvar_is_nan()
rvar_is_na()
Note: dim(res) == dim(x). These functions act within draws but do not summarise over elements. -is.finite()
is.infinite()
is.nan()
is.na()
Note: res[i] == TRUE if x[i] has any draws matching predicate (except for is.finite(), where all draws in x[i] must match) +is.finite()
is.infinite()
is.nan()
is.na()
Note: res[i] == TRUE if x[i] has any draws matching predicate (except for is.finite(), where all draws in x[i] must match) Diagnostics @@ -481,24 +483,24 @@

-
-

-Constants

+
+

Constants +

Constant rvars can be constructed by converting numeric vectors or arrays into rvars using as_rvar(), which will return an rvar with one draw and the same dimensions as its input:

 const <- as_rvar(1:3)
 const
-
## rvar<1>[3] mean ± sd:
-## [1] 1 ± NA  2 ± NA  3 ± NA
+
## rvar<1>[3] mean ± sd:
+## [1] 1 ± NA  2 ± NA  3 ± NA

While normally rvars must have the same number of draws to be used in the same expression, rvars with one draw are treated like constants, and can be combined with other rvars:

 mu + const
-
## rvar<100,4>[3] mean ± sd:
-## [1] 1.1 ± 0.11  2.1 ± 0.20  3.2 ± 0.31
+
## rvar<100,4>[3] mean ± sd:
+## [1] 1.1 ± 0.11  2.1 ± 0.20  3.2 ± 0.31
-
-

-Using existing R functions and expressions with rvars

+
+

Using existing R functions and expressions with rvars +

While rvars attempt to emulate as much of the functionality of base R arrays as possible, there are situations in which an existing R function may not work directly with an rvar. There are several approaches to solving this problem.

For example, say you wish to generate samples from the following expression for \(\mu\), \(\sigma\), and \(x\):

\[ @@ -509,11 +511,10 @@

\end{align} \]

There are three different approaches you might take to doing this: converting existing R functions with rfun(), executing expressions of random variables with rdo(), or evaluating random number generator functions using rvar_rng().

-
-

-Converting functions with rfun() +
+

Converting functions with rfun()

-

The rfun() wrapper converts an existing R function into a new function that rvars can be passed to it as arguments, and which will return rvars. We can use rfun() to convert the base rnorm() and rgamma() random number generating functions into functions that accept and return rvars:

+

The rfun() wrapper converts an existing R function into a new function that rvars can be passed to it as arguments, and which will return rvars. We can use rfun() to convert the base rnorm() and rgamma() random number generating functions into functions that accept and return rvars:

 rvar_norm <- rfun(rnorm)
 rvar_gamma <- rfun(rgamma)
@@ -523,41 +524,39 @@

sigma <- rvar_gamma(1, shape = 1, rate = 1) x <- rvar_norm(4, mu, sigma) x

-
## rvar<4000>[4] mean ± sd:
-## [1] 0.99 ± 1.7  1.98 ± 1.7  2.99 ± 1.8  4.01 ± 1.7
+
## rvar<4000>[4] mean ± sd:
+## [1] 0.99 ± 1.7  1.98 ± 1.7  2.99 ± 1.8  4.01 ± 1.7

While rfun()-converted functions work well for prototyping, they will generally speaking be slower than functions designed specifically for rvars. Thus, you may find you need to adopt other strategies (like rvar_rng(), described below; or re-writing functions to support rvar directly using math operators and/or the draws_of() function).

-
-

-Evaluating expressions with rdo() +
+

Evaluating expressions with rdo()

An alternative to rfun() is to use rdo(), which can be passed nearly-arbitrary R expressions. The expression will be executed multiple times to construct an rvar. E.g., we can write an expression for mu like in the above example:

-mu <- rdo(rnorm(4, mean = 1:4, sd = 1))
+mu <- rdo(rnorm(4, mean = 1:4, sd = 1))
 mu
-
## rvar<4000>[4] mean ± sd:
-## [1] 1 ± 1.01  2 ± 1.01  3 ± 0.99  4 ± 1.02
+
## rvar<4000>[4] mean ± sd:
+## [1] 1 ± 1.01  2 ± 1.01  3 ± 0.99  4 ± 1.02

We can also control the number of draws using the ndraws argument:

-mu <- rdo(rnorm(4, mean = 1:4, sd = 1), ndraws = 1000)
+mu <- rdo(rnorm(4, mean = 1:4, sd = 1), ndraws = 1000)
 mu
-
## rvar<1000>[4] mean ± sd:
-## [1] 0.98 ± 0.98  2.03 ± 1.03  2.98 ± 0.98  4.03 ± 1.02
+
## rvar<1000>[4] mean ± sd:
+## [1] 0.98 ± 0.98  2.03 ± 1.03  2.98 ± 0.98  4.03 ± 1.02

rdo() expressions can also contain other rvars, so long as all rvars in the expression have the same number of draws. Thus, we can re-write the example above that used rfun() as follows:

-mu <- rdo(rnorm(4, mean = 1:4, sd = 1))
-sigma <- rdo(rgamma(1, shape = 1, rate = 1))
-x <- rdo(rnorm(4, mu, sigma))
+mu <- rdo(rnorm(4, mean = 1:4, sd = 1))
+sigma <- rdo(rgamma(1, shape = 1, rate = 1))
+x <- rdo(rnorm(4, mu, sigma))
 x
-
## rvar<4000>[4] mean ± sd:
-## [1] 1 ± 1.7  2 ± 1.7  3 ± 1.7  4 ± 1.7
+
## rvar<4000>[4] mean ± sd:
+## [1] 1 ± 1.7  2 ± 1.7  3 ± 1.7  4 ± 1.7

Like rfun(), rdo() is not necessarily fast, so you may find it more useful for prototyping than production code.

-
-

-Evaluating random number generators with rvar_rng() +
+

Evaluating random number generators with rvar_rng()

-

rvar_rng() is an alternative to rfun()/rdo() designed specifically to work with random number generating functions that follow the typical API of such functions in base R. Such functions, like rnorm(), rgamma(), rbinom(), etc all following this interface:

+

rvar_rng() is an alternative to rfun()/rdo() designed specifically to work with random number generating functions that follow the typical API of such functions in base R. Such functions, like rnorm(), rgamma(), rbinom(), etc all following this interface:

  • They have a first argument, n, giving the number of draws to take from the distribution.
  • Their arguments for distribution parameters (mean, sd, shape, rate, etc.) are vectorized.
  • @@ -569,127 +568,127 @@

    sigma <- rvar_rng(rgamma, 1, shape = 1, rate = 1) x <- rvar_rng(rnorm, 4, mu, sigma) x

-
## rvar<4000>[4] mean ± sd:
-## [1] 1 ± 1.7  2 ± 1.8  3 ± 1.7  4 ± 1.7
+
## rvar<4000>[4] mean ± sd:
+## [1] 1 ± 1.7  2 ± 1.8  3 ± 1.7  4 ± 1.7

In contrast to the rfun() and rdo() examples above, rvar_rng() takes advantage of the existing vectorization of the underlying random number generating function to execute quickly.

-
-

-Broadcasting

+
+

Broadcasting +

Broadcasting for rvars does not follow R’s vector recycling rules. Instead, when two variables with different dimensions are being used with basic arithmetic functions, dimensions are added until both variables have the same number of dimensions. If two variables \(x\) and \(y\) differ on the length of dimension \(d\), they can be broadcast to the same size so long as one of the variables has dimension \(d\) of size 1. Then that variable will be broadcast up to the same size as the other variable along that dimension. If two variables disagree on the size of a dimension and neither has size 1, it is an error.

For example, consider this random matrix:

-X <- rdo(rnorm(12, 1:12), dim = c(4,3))
+X <- rdo(rnorm(12, 1:12), dim = c(4,3))
 X
-
## rvar<4000>[4,3] mean ± sd:
-##      [,1]       [,2]       [,3]      
-## [1,]  1 ± 0.99   5 ± 1.00   9 ± 1.02 
-## [2,]  2 ± 1.01   6 ± 0.99  10 ± 1.01 
-## [3,]  3 ± 1.00   7 ± 1.01  11 ± 1.00 
-## [4,]  4 ± 1.01   8 ± 1.02  12 ± 1.01
+
## rvar<4000>[4,3] mean ± sd:
+##      [,1]       [,2]       [,3]      
+## [1,]  1 ± 0.99   5 ± 1.00   9 ± 1.02 
+## [2,]  2 ± 1.01   6 ± 0.99  10 ± 1.01 
+## [3,]  3 ± 1.00   7 ± 1.01  11 ± 1.00 
+## [4,]  4 ± 1.01   8 ± 1.02  12 ± 1.01

And this vector of length 3:

-y <- rdo(rnorm(3, 3:1))
+y <- rdo(rnorm(3, 3:1))
 y
-
## rvar<4000>[3] mean ± sd:
-## [1] 3 ± 1  2 ± 1  1 ± 1
+
## rvar<4000>[3] mean ± sd:
+## [1] 3 ± 1  2 ± 1  1 ± 1

If we attempt to add X and y, it will produce an error as vectors are by default treated as column vectors, and y has length 3 while columns of X have length 4:

 X + y
-
## Error: Cannot broadcast array of shape [4000,3,1] to array of shape [4000,4,3]:
-## All dimensions must be 1 or equal.
+
## Error: Cannot broadcast array of shape [4000,3,1] to array of shape [4000,4,3]:
+## All dimensions must be 1 or equal.

By contrast, R arrays of the same shape will simply recycle y until it is the same length as X (regardless of the dimensions). Thus will produce a result, though likely not the intended result:

-mean(X) + mean(y)
-
##          [,1]     [,2]     [,3]
-## [1,] 4.010833 6.970957 10.01651
-## [2,] 3.972172 7.033491 12.97111
-## [3,] 4.019509 9.979396 12.97034
-## [4,] 6.990685 9.978003 13.01769
+mean(X) + mean(y)
+
##          [,1]     [,2]     [,3]
+## [1,] 4.010833 6.970957 10.01651
+## [2,] 3.972172 7.033491 12.97111
+## [3,] 4.019509 9.979396 12.97034
+## [4,] 6.990685 9.978003 13.01769

On the other hand, if y were a row vector…

-row_y = t(y)
+row_y = t(y)
 row_y
-
## rvar<4000>[1,3] mean ± sd:
-##      [,1]   [,2]   [,3]  
-## [1,] 3 ± 1  2 ± 1  1 ± 1
+
## rvar<4000>[1,3] mean ± sd:
+##      [,1]   [,2]   [,3]  
+## [1,] 3 ± 1  2 ± 1  1 ± 1

…it would have the same number of columns as X and contain only one row, so it can be broadcast along rows of X:

 X + row_y
-
## rvar<4000>[4,3] mean ± sd:
-##      [,1]      [,2]      [,3]     
-## [1,]  4 ± 1.4   7 ± 1.4  10 ± 1.4 
-## [2,]  5 ± 1.4   8 ± 1.4  11 ± 1.4 
-## [3,]  6 ± 1.4   9 ± 1.4  12 ± 1.4 
-## [4,]  7 ± 1.4  10 ± 1.5  13 ± 1.4
+
## rvar<4000>[4,3] mean ± sd:
+##      [,1]      [,2]      [,3]     
+## [1,]  4 ± 1.4   7 ± 1.4  10 ± 1.4 
+## [2,]  5 ± 1.4   8 ± 1.4  11 ± 1.4 
+## [3,]  6 ± 1.4   9 ± 1.4  12 ± 1.4 
+## [4,]  7 ± 1.4  10 ± 1.5  13 ± 1.4
-
-

-Applying functions over rvars

-

The rvar data type supplies an implementation of as.list(), which should give compatibility with the base R family of functions for applying functions over arrays: apply(), lapply(), vapply(), sapply(), etc. You can also manually use as.list() to convert an rvar into a list along its first dimension, which may be necessary for compatibility with some functions (like purrr:map()).

+
+

Applying functions over rvars +

+

The rvar data type supplies an implementation of as.list(), which should give compatibility with the base R family of functions for applying functions over arrays: apply(), lapply(), vapply(), sapply(), etc. You can also manually use as.list() to convert an rvar into a list along its first dimension, which may be necessary for compatibility with some functions (like purrr:map()).

For example, given this multidimensional rvar

-set.seed(3456)
+set.seed(3456)
 x <- rvar_rng(rnorm, 24, mean = 1:24)
-dim(x) <- c(2,3,4)
+dim(x) <- c(2,3,4)
 x
-
## rvar<4000>[2,3,4] mean ± sd:
-## , , 1
-## 
-##      [,1]       [,2]       [,3]      
-## [1,]  1 ± 1.00   3 ± 0.98   5 ± 1.00 
-## [2,]  2 ± 1.00   4 ± 1.00   6 ± 1.01 
-## 
-## , , 2
-## 
-##      [,1]       [,2]       [,3]      
-## [1,]  7 ± 1.00   9 ± 1.00  11 ± 1.03 
-## [2,]  8 ± 0.98  10 ± 0.99  12 ± 1.00 
-## 
-## , , 3
-## 
-##      [,1]       [,2]       [,3]      
-## [1,] 13 ± 1.00  15 ± 1.00  17 ± 0.99 
-## [2,] 14 ± 1.01  16 ± 1.00  18 ± 1.00 
-## 
-## , , 4
-## 
-##      [,1]       [,2]       [,3]      
-## [1,] 19 ± 0.99  21 ± 0.99  23 ± 0.99 
-## [2,] 20 ± 1.00  22 ± 1.00  24 ± 1.00
-

… you can apply functions along the margins using apply() (here, a silly example):

+
## rvar<4000>[2,3,4] mean ± sd:
+## , , 1
+## 
+##      [,1]       [,2]       [,3]      
+## [1,]  1 ± 1.00   3 ± 0.98   5 ± 1.00 
+## [2,]  2 ± 1.00   4 ± 1.00   6 ± 1.01 
+## 
+## , , 2
+## 
+##      [,1]       [,2]       [,3]      
+## [1,]  7 ± 1.00   9 ± 1.00  11 ± 1.03 
+## [2,]  8 ± 0.98  10 ± 0.99  12 ± 1.00 
+## 
+## , , 3
+## 
+##      [,1]       [,2]       [,3]      
+## [1,] 13 ± 1.00  15 ± 1.00  17 ± 0.99 
+## [2,] 14 ± 1.01  16 ± 1.00  18 ± 1.00 
+## 
+## , , 4
+## 
+##      [,1]       [,2]       [,3]      
+## [1,] 19 ± 0.99  21 ± 0.99  23 ± 0.99 
+## [2,] 20 ± 1.00  22 ± 1.00  24 ± 1.00
+

… you can apply functions along the margins using apply() (here, a silly example):

-apply(x, c(1,2), length)
-
##      [,1] [,2] [,3]
-## [1,]    4    4    4
-## [2,]    4    4    4
-

One exception is that while apply() will work with an rvar input if your function returns base data types (like numerics), it will not give you simplified rvar arrays if your function returns an rvar. Thus, we supply the rvar_apply() function, which takes in either base arrays or rvar arrays and returns rvar arrays, and which also uses the rvar broadcasting rules to combine the results of the applied function.

+apply(x, c(1,2), length)
+
##      [,1] [,2] [,3]
+## [1,]    4    4    4
+## [2,]    4    4    4
+

One exception is that while apply() will work with an rvar input if your function returns base data types (like numerics), it will not give you simplified rvar arrays if your function returns an rvar. Thus, we supply the rvar_apply() function, which takes in either base arrays or rvar arrays and returns rvar arrays, and which also uses the rvar broadcasting rules to combine the results of the applied function.

For example, you can use rvar_apply() with rvar_mean() to compute the distributions of means along one margin of an array:

 rvar_apply(x, 1, rvar_mean)
-
## rvar<4000>[2] mean ± sd:
-## [1] 12 ± 0.29  13 ± 0.29
+
## rvar<4000>[2] mean ± sd:
+## [1] 12 ± 0.29  13 ± 0.29

Or along multiple dimensions:

-rvar_apply(x, c(2,3), rvar_mean)
-
## rvar<4000>[3,4] mean ± sd:
-##      [,1]         [,2]         [,3]         [,4]        
-## [1,]  1.5 ± 0.70   7.5 ± 0.69  13.5 ± 0.71  19.5 ± 0.70 
-## [2,]  3.5 ± 0.70   9.5 ± 0.71  15.5 ± 0.72  21.5 ± 0.70 
-## [3,]  5.5 ± 0.71  11.5 ± 0.72  17.5 ± 0.71  23.5 ± 0.70
+rvar_apply(x, c(2,3), rvar_mean)
+
## rvar<4000>[3,4] mean ± sd:
+##      [,1]         [,2]         [,3]         [,4]        
+## [1,]  1.5 ± 0.70   7.5 ± 0.69  13.5 ± 0.71  19.5 ± 0.70 
+## [2,]  3.5 ± 0.70   9.5 ± 0.71  15.5 ± 0.72  21.5 ± 0.70 
+## [3,]  5.5 ± 0.71  11.5 ± 0.72  17.5 ± 0.71  23.5 ± 0.70

-
-

-Using rvars in data frames and in ggplot2

-

rvars can be used as columns in data.frame() or tibble() objects:

+
+

Using rvars in data frames and in ggplot2 +

+

rvars can be used as columns in data.frame() or tibble() objects:

-data.frame(x = c("a","b","c"), y)
-
##   x                    y
-## 1 a 2.997187 ± 1.0017769
-## 2 b 1.983319 ± 0.9998891
-## 3 c 1.028725 ± 1.0021676
-

This makes them convenient for adding predictions to a data frame alongside the data used to generate the predictions. rvars can then be visualized with ggplot2 using the stat_dist_... family of geometries in the ggdist package.

+data.frame(x = c("a","b","c"), y)
+
##   x                    y
+## 1 a 2.997187 ± 1.0017769
+## 2 b 1.983319 ± 0.9998891
+## 3 c 1.028725 ± 1.0021676
+

This makes them convenient for adding predictions to a data frame alongside the data used to generate the predictions. rvars can then be visualized with ggplot2 using the stat_dist_... family of geometries in the ggdist package.

@@ -704,11 +703,13 @@

-

Site built with pkgdown 1.6.1.

+

+

Site built with pkgdown 2.0.1.

@@ -717,5 +718,7 @@

+ + diff --git a/docs/authors.html b/docs/authors.html index 154ebd17..4b5cde65 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,66 +1,12 @@ - - - - - - - -Citation and Authors • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Authors and Citation • posterior - - - - + + -
-
- -
- -
+
-
-
- +
- - + + diff --git a/docs/index.html b/docs/index.html index 333bf5d3..b1738309 100644 --- a/docs/index.html +++ b/docs/index.html @@ -29,6 +29,8 @@ + +
-
- - - + + diff --git a/docs/reference/draws_array.html b/docs/reference/draws_array.html index 48ee5486..20f30b01 100644 --- a/docs/reference/draws_array.html +++ b/docs/reference/draws_array.html @@ -1,71 +1,16 @@ - - - - - - - -The draws_array format — draws_array • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The draws_array format — draws_array • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
@@ -179,189 +115,190 @@

The draws_array format

See Details.

-
as_draws_array(x, ...)
+    
+
as_draws_array(x, ...)
 
-# S3 method for default
-as_draws_array(x, ...)
+# S3 method for default
+as_draws_array(x, ...)
 
-# S3 method for draws_array
-as_draws_array(x, ...)
+# S3 method for draws_array
+as_draws_array(x, ...)
 
-# S3 method for draws_matrix
-as_draws_array(x, ...)
+# S3 method for draws_matrix
+as_draws_array(x, ...)
 
-# S3 method for draws_df
-as_draws_array(x, ...)
+# S3 method for draws_df
+as_draws_array(x, ...)
 
-# S3 method for draws_list
-as_draws_array(x, ...)
+# S3 method for draws_list
+as_draws_array(x, ...)
 
-# S3 method for draws_rvars
-as_draws_array(x, ...)
+# S3 method for draws_rvars
+as_draws_array(x, ...)
 
-# S3 method for mcmc
-as_draws_array(x, ...)
+# S3 method for mcmc
+as_draws_array(x, ...)
 
-# S3 method for mcmc.list
-as_draws_array(x, ...)
+# S3 method for mcmc.list
+as_draws_array(x, ...)
 
-draws_array(..., .nchains = 1)
+draws_array(..., .nchains = 1)
 
-is_draws_array(x)
+is_draws_array(x)
+
-

Arguments

- - - - - - - - - - - - - - -
x

An object to convert to a draws_array object.

...

For as_draws_array(): +

+

Arguments

+
x
+

An object to convert to a draws_array object.

+
...
+

For as_draws_array(): Arguments passed to individual methods (if applicable). For draws_array(): Named -arguments containing numeric vectors each defining a separate variable.

.nchains

(positive integer) The number of chains. The default is 1.

- -

Value

- +arguments containing numeric vectors each defining a separate variable.

+
.nchains
+

(positive integer) The number of chains. The default is 1.

+
+
+

Value

A draws_array object, which has classes -c("draws_array", "draws", "array").

-

Details

- +c("draws_array", "draws", "array").

+
+
+

Details

Objects of class "draws_array" are 3-D arrays with dimensions "iteration", "chain", and "variable". See Examples.

-

See also

- -

Other formats: -draws_df(), -draws_list(), -draws_matrix(), -draws_rvars(), -draws

+
+
+

See also

+

Other formats: +draws_df(), +draws_list(), +draws_matrix(), +draws_rvars(), +draws

+
-

Examples

-
x1 <- as_draws_array(example_draws()) -class(x1) -
#> [1] "draws_array" "draws" "array"
print(x1) -
#> # A draws_array: 100 iterations, 4 chains, and 10 variables -#> , , variable = mu -#> -#> chain -#> iteration 1 2 3 4 -#> 1 2.0 3.0 1.79 6.5 -#> 2 1.5 8.2 5.99 9.1 -#> 3 5.8 -1.2 2.56 0.2 -#> 4 6.8 10.9 2.79 3.7 -#> 5 1.8 9.8 -0.03 5.5 -#> -#> , , variable = tau -#> -#> chain -#> iteration 1 2 3 4 -#> 1 2.8 2.80 8.7 3.8 -#> 2 7.0 2.76 2.9 6.8 -#> 3 9.7 0.57 8.4 5.3 -#> 4 4.8 2.45 4.4 1.6 -#> 5 2.8 2.80 11.0 3.0 -#> -#> , , variable = theta[1] -#> -#> chain -#> iteration 1 2 3 4 -#> 1 3.96 6.26 13.3 5.78 -#> 2 0.12 9.32 6.3 2.09 -#> 3 21.25 -0.97 10.6 15.72 -#> 4 14.70 12.45 5.4 2.69 -#> 5 5.96 9.75 8.2 -0.91 -#> -#> , , variable = theta[2] -#> -#> chain -#> iteration 1 2 3 4 -#> 1 0.271 1.0 2.1 5.0 -#> 2 -0.069 9.4 7.3 8.2 -#> 3 14.931 -1.2 5.7 6.0 -#> 4 8.586 12.5 2.8 2.7 -#> 5 1.156 11.9 3.2 3.2 -#> -#> # ... with 95 more iterations, and 6 more variables
str(x1) -
#> 'draws_array' num [1:100, 1:4, 1:10] 2.01 1.46 5.81 6.85 1.81 ... -#> - attr(*, "dimnames")=List of 3 -#> ..$ iteration: chr [1:100] "1" "2" "3" "4" ... -#> ..$ chain : chr [1:4] "1" "2" "3" "4" -#> ..$ variable : chr [1:10] "mu" "tau" "theta[1]" "theta[2]" ...
-x2 <- draws_array(a = rnorm(10), b = rnorm(10), c = 1) -class(x2) -
#> [1] "draws_array" "draws" "array"
print(x2) -
#> # A draws_array: 10 iterations, 1 chains, and 3 variables -#> , , variable = a -#> -#> chain -#> iteration 1 -#> 1 -2.27 -#> 2 2.68 -#> 3 -0.36 -#> 4 0.21 -#> 5 1.07 -#> -#> , , variable = b -#> -#> chain -#> iteration 1 -#> 1 1.07 -#> 2 0.13 -#> 3 0.49 -#> 4 -1.70 -#> 5 -1.47 -#> -#> , , variable = c -#> -#> chain -#> iteration 1 -#> 1 1 -#> 2 1 -#> 3 1 -#> 4 1 -#> 5 1 -#> -#> # ... with 5 more iterations
str(x2) -
#> 'draws_array' num [1:10, 1, 1:3] -2.274 2.683 -0.361 0.213 1.074 ... -#> - attr(*, "dimnames")=List of 3 -#> ..$ iteration: chr [1:10] "1" "2" "3" "4" ... -#> ..$ chain : chr "1" -#> ..$ variable : chr [1:3] "a" "b" "c"
+
+

Examples

+
x1 <- as_draws_array(example_draws())
+class(x1)
+#> [1] "draws_array" "draws"       "array"      
+print(x1)
+#> # A draws_array: 100 iterations, 4 chains, and 10 variables
+#> , , variable = mu
+#> 
+#>          chain
+#> iteration   1    2     3   4
+#>         1 2.0  3.0  1.79 6.5
+#>         2 1.5  8.2  5.99 9.1
+#>         3 5.8 -1.2  2.56 0.2
+#>         4 6.8 10.9  2.79 3.7
+#>         5 1.8  9.8 -0.03 5.5
+#> 
+#> , , variable = tau
+#> 
+#>          chain
+#> iteration   1    2    3   4
+#>         1 2.8 2.80  8.7 3.8
+#>         2 7.0 2.76  2.9 6.8
+#>         3 9.7 0.57  8.4 5.3
+#>         4 4.8 2.45  4.4 1.6
+#>         5 2.8 2.80 11.0 3.0
+#> 
+#> , , variable = theta[1]
+#> 
+#>          chain
+#> iteration     1     2    3     4
+#>         1  3.96  6.26 13.3  5.78
+#>         2  0.12  9.32  6.3  2.09
+#>         3 21.25 -0.97 10.6 15.72
+#>         4 14.70 12.45  5.4  2.69
+#>         5  5.96  9.75  8.2 -0.91
+#> 
+#> , , variable = theta[2]
+#> 
+#>          chain
+#> iteration      1    2   3   4
+#>         1  0.271  1.0 2.1 5.0
+#>         2 -0.069  9.4 7.3 8.2
+#>         3 14.931 -1.2 5.7 6.0
+#>         4  8.586 12.5 2.8 2.7
+#>         5  1.156 11.9 3.2 3.2
+#> 
+#> # ... with 95 more iterations, and 6 more variables
+str(x1)
+#>  'draws_array' num [1:100, 1:4, 1:10] 2.01 1.46 5.81 6.85 1.81 ...
+#>  - attr(*, "dimnames")=List of 3
+#>   ..$ iteration: chr [1:100] "1" "2" "3" "4" ...
+#>   ..$ chain    : chr [1:4] "1" "2" "3" "4"
+#>   ..$ variable : chr [1:10] "mu" "tau" "theta[1]" "theta[2]" ...
+
+x2 <- draws_array(a = rnorm(10), b = rnorm(10), c = 1)
+class(x2)
+#> [1] "draws_array" "draws"       "array"      
+print(x2)
+#> # A draws_array: 10 iterations, 1 chains, and 3 variables
+#> , , variable = a
+#> 
+#>          chain
+#> iteration     1
+#>         1 -0.85
+#>         2 -0.18
+#>         3 -0.28
+#>         4 -1.60
+#>         5  0.71
+#> 
+#> , , variable = b
+#> 
+#>          chain
+#> iteration     1
+#>         1  1.94
+#>         2 -0.45
+#>         3 -0.13
+#>         4 -3.07
+#>         5 -0.44
+#> 
+#> , , variable = c
+#> 
+#>          chain
+#> iteration 1
+#>         1 1
+#>         2 1
+#>         3 1
+#>         4 1
+#>         5 1
+#> 
+#> # ... with 5 more iterations
+str(x2)
+#>  'draws_array' num [1:10, 1, 1:3] -0.846 -0.178 -0.278 -1.601 0.711 ...
+#>  - attr(*, "dimnames")=List of 3
+#>   ..$ iteration: chr [1:10] "1" "2" "3" "4" ...
+#>   ..$ chain    : chr "1"
+#>   ..$ variable : chr [1:3] "a" "b" "c"
+
+
+
-
- +
- - + + diff --git a/docs/reference/draws_df.html b/docs/reference/draws_df.html index 734745d7..d62deee5 100644 --- a/docs/reference/draws_df.html +++ b/docs/reference/draws_df.html @@ -1,71 +1,16 @@ - - - - - - - -The draws_df format — draws_df • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The draws_df format — draws_df • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
@@ -179,66 +115,61 @@

The draws_df format

See Details.

-
as_draws_df(x, ...)
+    
+
as_draws_df(x, ...)
 
-# S3 method for default
-as_draws_df(x, ...)
+# S3 method for default
+as_draws_df(x, ...)
 
-# S3 method for data.frame
-as_draws_df(x, ...)
+# S3 method for data.frame
+as_draws_df(x, ...)
 
-# S3 method for draws_df
-as_draws_df(x, ...)
+# S3 method for draws_df
+as_draws_df(x, ...)
 
-# S3 method for draws_matrix
-as_draws_df(x, ...)
+# S3 method for draws_matrix
+as_draws_df(x, ...)
 
-# S3 method for draws_array
-as_draws_df(x, ...)
+# S3 method for draws_array
+as_draws_df(x, ...)
 
-# S3 method for draws_list
-as_draws_df(x, ...)
+# S3 method for draws_list
+as_draws_df(x, ...)
 
-# S3 method for draws_rvars
-as_draws_df(x, ...)
+# S3 method for draws_rvars
+as_draws_df(x, ...)
 
-# S3 method for mcmc
-as_draws_df(x, ...)
+# S3 method for mcmc
+as_draws_df(x, ...)
 
-# S3 method for mcmc.list
-as_draws_df(x, ...)
+# S3 method for mcmc.list
+as_draws_df(x, ...)
 
-draws_df(..., .nchains = 1)
+draws_df(..., .nchains = 1)
 
-is_draws_df(x)
+is_draws_df(x)
+
-

Arguments

- - - - - - - - - - - - - - -
x

An object to convert to a draws_df object.

...

For as_draws_df(): +

+

Arguments

+
x
+

An object to convert to a draws_df object.

+
...
+

For as_draws_df(): Arguments passed to individual methods (if applicable). For draws_df(): Named -arguments containing numeric vectors each defining a separate variable.

.nchains

(positive integer) The number of chains. The default is 1.

- -

Value

- +arguments containing numeric vectors each defining a separate variable.

+
.nchains
+

(positive integer) The number of chains. The default is 1.

+
+
+

Value

A draws_df object, which has classes -c("draws_df", "draws", class(tibble::tibble())).

-

Details

- -

Objects of class "draws_df" are tibble data +c("draws_df", "draws", class(tibble::tibble())).

+
+
+

Details

+

Objects of class "draws_df" are tibble data frames. They have one column per variable as well as additional metadata columns ".iteration", ".chain", and ".draw". The difference between the ".iteration" and ".draw" columns is that the former is relative to @@ -247,134 +178,143 @@

Details

If a data.frame-like object is supplied to as_draws_df that contains columns named ".iteration" or ".chain", they will be treated as iteration and chain indices, respectively. See Examples.

-

See also

- -

Other formats: -draws_array(), -draws_list(), -draws_matrix(), -draws_rvars(), -draws

+
+
+

See also

+

Other formats: +draws_array(), +draws_list(), +draws_matrix(), +draws_rvars(), +draws

+
-

Examples

-
x1 <- as_draws_df(example_draws()) -class(x1) -
#> [1] "draws_df" "draws" "tbl_df" "tbl" "data.frame"
print(x1) -
#> # A draws_df: 100 iterations, 4 chains, and 10 variables -#> mu tau theta[1] theta[2] theta[3] theta[4] theta[5] theta[6] -#> 1 2.01 2.8 3.96 0.271 -0.74 2.1 0.923 1.7 -#> 2 1.46 7.0 0.12 -0.069 0.95 7.3 -0.062 11.3 -#> 3 5.81 9.7 21.25 14.931 1.83 1.4 0.531 7.2 -#> 4 6.85 4.8 14.70 8.586 2.67 4.4 4.758 8.1 -#> 5 1.81 2.8 5.96 1.156 3.11 2.0 0.769 4.7 -#> 6 3.84 4.1 5.76 9.909 -1.00 5.3 5.889 -1.7 -#> 7 5.47 4.0 4.03 4.151 10.15 6.6 3.741 -2.2 -#> 8 1.20 1.5 -0.28 1.846 0.47 4.3 1.467 3.3 -#> 9 0.15 3.9 1.81 0.661 0.86 4.5 -1.025 1.1 -#> 10 7.17 1.8 6.08 8.102 7.68 5.6 7.106 8.5 -#> # ... with 390 more draws, and 2 more variables -#> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
str(x1) -
#> draws_df [400 x 13] (S3: draws_df/draws/tbl_df/tbl/data.frame) -#> $ mu : num [1:400] 2.01 1.46 5.81 6.85 1.81 ... -#> $ tau : num [1:400] 2.77 6.98 9.68 4.79 2.85 ... -#> $ theta[1] : num [1:400] 3.962 0.124 21.251 14.7 5.96 ... -#> $ theta[2] : num [1:400] 0.271 -0.069 14.931 8.586 1.156 ... -#> $ theta[3] : num [1:400] -0.743 0.952 1.829 2.675 3.109 ... -#> $ theta[4] : num [1:400] 2.1 7.28 1.38 4.39 1.99 ... -#> $ theta[5] : num [1:400] 0.923 -0.062 0.531 4.758 0.769 ... -#> $ theta[6] : num [1:400] 1.65 11.26 7.16 8.1 4.66 ... -#> $ theta[7] : num [1:400] 3.32 9.62 14.8 9.49 1.21 ... -#> $ theta[8] : num [1:400] 4.85 -8.64 -1.74 5.28 -4.54 ... -#> $ .chain : int [1:400] 1 1 1 1 1 1 1 1 1 1 ... -#> $ .iteration: int [1:400] 1 2 3 4 5 6 7 8 9 10 ... -#> $ .draw : int [1:400] 1 2 3 4 5 6 7 8 9 10 ...
-x2 <- draws_df(a = rnorm(10), b = rnorm(10), c = 1) -class(x2) -
#> [1] "draws_df" "draws" "tbl_df" "tbl" "data.frame"
print(x2) -
#> # A draws_df: 10 iterations, 1 chains, and 3 variables -#> a b c -#> 1 0.61 -2.612 1 -#> 2 -0.11 -0.156 1 -#> 3 0.17 0.434 1 -#> 4 -0.09 -0.382 1 -#> 5 1.92 0.424 1 -#> 6 1.30 1.063 1 -#> 7 0.75 1.049 1 -#> 8 0.56 -0.038 1 -#> 9 -0.55 0.486 1 -#> 10 1.11 1.673 1 -#> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
str(x2) -
#> draws_df [10 x 6] (S3: draws_df/draws/tbl_df/tbl/data.frame) -#> $ a : num [1:10] 0.6067 -0.1099 0.1722 -0.0903 1.9243 ... -#> $ b : num [1:10] -2.612 -0.156 0.434 -0.382 0.424 ... -#> $ c : num [1:10] 1 1 1 1 1 1 1 1 1 1 -#> $ .chain : int [1:10] 1 1 1 1 1 1 1 1 1 1 -#> $ .iteration: int [1:10] 1 2 3 4 5 6 7 8 9 10 -#> $ .draw : int [1:10] 1 2 3 4 5 6 7 8 9 10
-# the difference between iteration and draw is clearer when contrasting -# the head and tail of the data frame -print(head(x1), reserved = TRUE, max_variables = 2) -
#> # A draws_df: 6 iterations, 1 chains, and 10 variables -#> mu tau .chain .iteration .draw -#> 1 2.0 2.8 1 1 1 -#> 2 1.5 7.0 1 2 2 -#> 3 5.8 9.7 1 3 3 -#> 4 6.8 4.8 1 4 4 -#> 5 1.8 2.8 1 5 5 -#> 6 3.8 4.1 1 6 6 -#> # ... with 8 more variables
print(tail(x1), reserved = TRUE, max_variables = 2) -
#> # A draws_df: 6 iterations, 1 chains, and 10 variables -#> mu tau .chain .iteration .draw -#> 1 NA NA NA 1 1 -#> 2 NA NA NA 2 2 -#> 3 NA NA NA 3 3 -#> 4 NA NA NA 4 4 -#> 5 NA NA NA 5 5 -#> 6 NA NA NA 6 6 -#> # ... with 8 more variables
-# manually supply chain information -xnew <- data.frame(mu = rnorm(10), .chain = rep(1:2, each = 5)) -xnew <- as_draws_df(xnew) -print(xnew) -
#> # A draws_df: 5 iterations, 2 chains, and 1 variables -#> mu -#> 1 -0.35 -#> 2 0.95 -#> 3 1.32 -#> 4 -0.30 -#> 5 -0.39 -#> 6 -0.79 -#> 7 -1.06 -#> 8 -0.80 -#> 9 -1.76 -#> 10 -0.69 -#> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
-
+
+

Examples

+
x1 <- as_draws_df(example_draws())
+class(x1)
+#> [1] "draws_df"   "draws"      "tbl_df"     "tbl"        "data.frame"
+print(x1)
+#> # A draws_df: 100 iterations, 4 chains, and 10 variables
+#>      mu tau theta[1] theta[2] theta[3] theta[4] theta[5] theta[6]
+#> 1  2.01 2.8     3.96    0.271    -0.74      2.1    0.923      1.7
+#> 2  1.46 7.0     0.12   -0.069     0.95      7.3   -0.062     11.3
+#> 3  5.81 9.7    21.25   14.931     1.83      1.4    0.531      7.2
+#> 4  6.85 4.8    14.70    8.586     2.67      4.4    4.758      8.1
+#> 5  1.81 2.8     5.96    1.156     3.11      2.0    0.769      4.7
+#> 6  3.84 4.1     5.76    9.909    -1.00      5.3    5.889     -1.7
+#> 7  5.47 4.0     4.03    4.151    10.15      6.6    3.741     -2.2
+#> 8  1.20 1.5    -0.28    1.846     0.47      4.3    1.467      3.3
+#> 9  0.15 3.9     1.81    0.661     0.86      4.5   -1.025      1.1
+#> 10 7.17 1.8     6.08    8.102     7.68      5.6    7.106      8.5
+#> # ... with 390 more draws, and 2 more variables
+#> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
+str(x1)
+#> draws_df [400 × 13] (S3: draws_df/draws/tbl_df/tbl/data.frame)
+#>  $ mu        : num [1:400] 2.01 1.46 5.81 6.85 1.81 ...
+#>  $ tau       : num [1:400] 2.77 6.98 9.68 4.79 2.85 ...
+#>  $ theta[1]  : num [1:400] 3.962 0.124 21.251 14.7 5.96 ...
+#>  $ theta[2]  : num [1:400] 0.271 -0.069 14.931 8.586 1.156 ...
+#>  $ theta[3]  : num [1:400] -0.743 0.952 1.829 2.675 3.109 ...
+#>  $ theta[4]  : num [1:400] 2.1 7.28 1.38 4.39 1.99 ...
+#>  $ theta[5]  : num [1:400] 0.923 -0.062 0.531 4.758 0.769 ...
+#>  $ theta[6]  : num [1:400] 1.65 11.26 7.16 8.1 4.66 ...
+#>  $ theta[7]  : num [1:400] 3.32 9.62 14.8 9.49 1.21 ...
+#>  $ theta[8]  : num [1:400] 4.85 -8.64 -1.74 5.28 -4.54 ...
+#>  $ .chain    : int [1:400] 1 1 1 1 1 1 1 1 1 1 ...
+#>  $ .iteration: int [1:400] 1 2 3 4 5 6 7 8 9 10 ...
+#>  $ .draw     : int [1:400] 1 2 3 4 5 6 7 8 9 10 ...
+
+x2 <- draws_df(a = rnorm(10), b = rnorm(10), c = 1)
+class(x2)
+#> [1] "draws_df"   "draws"      "tbl_df"     "tbl"        "data.frame"
+print(x2)
+#> # A draws_df: 10 iterations, 1 chains, and 3 variables
+#>        a     b c
+#> 1  -1.11  0.86 1
+#> 2   0.24 -0.57 1
+#> 3   1.31 -1.09 1
+#> 4   0.71  0.26 1
+#> 5   0.64  1.03 1
+#> 6   1.50 -0.21 1
+#> 7  -0.34 -0.88 1
+#> 8  -0.15 -0.25 1
+#> 9  -0.40  0.99 1
+#> 10  0.62 -0.26 1
+#> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
+str(x2)
+#> draws_df [10 × 6] (S3: draws_df/draws/tbl_df/tbl/data.frame)
+#>  $ a         : num [1:10] -1.108 0.239 1.307 0.71 0.638 ...
+#>  $ b         : num [1:10] 0.857 -0.566 -1.093 0.259 1.034 ...
+#>  $ c         : num [1:10] 1 1 1 1 1 1 1 1 1 1
+#>  $ .chain    : int [1:10] 1 1 1 1 1 1 1 1 1 1
+#>  $ .iteration: int [1:10] 1 2 3 4 5 6 7 8 9 10
+#>  $ .draw     : int [1:10] 1 2 3 4 5 6 7 8 9 10
+
+# the difference between iteration and draw is clearer when contrasting
+# the head and tail of the data frame
+print(head(x1), reserved = TRUE, max_variables = 2)
+#> # A draws_df: 6 iterations, 1 chains, and 10 variables
+#>    mu tau .chain .iteration .draw
+#> 1 2.0 2.8      1          1     1
+#> 2 1.5 7.0      1          2     2
+#> 3 5.8 9.7      1          3     3
+#> 4 6.8 4.8      1          4     4
+#> 5 1.8 2.8      1          5     5
+#> 6 3.8 4.1      1          6     6
+#> # ... with 8 more variables
+print(tail(x1), reserved = TRUE, max_variables = 2)
+#> # A draws_df: 6 iterations, 1 chains, and 10 variables
+#>     mu tau .chain .iteration .draw
+#> 1 5.69 2.2      4         95   395
+#> 2 3.28 3.3      4         96   396
+#> 3 5.04 3.6      4         97   397
+#> 4 2.73 6.8      4         98   398
+#> 5 0.48 1.8      4         99   399
+#> 6 7.05 4.8      4        100   400
+#> # ... with 8 more variables
+
+# manually supply chain information
+xnew <- data.frame(mu = rnorm(10), .chain = rep(1:2, each = 5))
+xnew <- as_draws_df(xnew)
+print(xnew)
+#> # A draws_df: 5 iterations, 2 chains, and 1 variables
+#>       mu
+#> 1  -0.28
+#> 2  -0.45
+#> 3   0.72
+#> 4   2.15
+#> 5  -0.37
+#> 6  -0.15
+#> 7  -0.88
+#> 8  -2.91
+#> 9  -0.28
+#> 10  1.73
+#> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
+
+
+
+

-
- +
- - + + diff --git a/docs/reference/draws_list.html b/docs/reference/draws_list.html index e0500d81..34ca77a1 100644 --- a/docs/reference/draws_list.html +++ b/docs/reference/draws_list.html @@ -1,71 +1,16 @@ - - - - - - - -The draws_list format — draws_list • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The draws_list format — draws_list • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
@@ -179,201 +115,202 @@

The draws_list format

See Details.

-
as_draws_list(x, ...)
+    
+
as_draws_list(x, ...)
 
-# S3 method for default
-as_draws_list(x, ...)
+# S3 method for default
+as_draws_list(x, ...)
 
-# S3 method for draws_list
-as_draws_list(x, ...)
+# S3 method for draws_list
+as_draws_list(x, ...)
 
-# S3 method for draws_matrix
-as_draws_list(x, ...)
+# S3 method for draws_matrix
+as_draws_list(x, ...)
 
-# S3 method for draws_array
-as_draws_list(x, ...)
+# S3 method for draws_array
+as_draws_list(x, ...)
 
-# S3 method for draws_df
-as_draws_list(x, ...)
+# S3 method for draws_df
+as_draws_list(x, ...)
 
-# S3 method for draws_rvars
-as_draws_list(x, ...)
+# S3 method for draws_rvars
+as_draws_list(x, ...)
 
-# S3 method for mcmc
-as_draws_list(x, ...)
+# S3 method for mcmc
+as_draws_list(x, ...)
 
-# S3 method for mcmc.list
-as_draws_list(x, ...)
+# S3 method for mcmc.list
+as_draws_list(x, ...)
 
-draws_list(..., .nchains = 1)
+draws_list(..., .nchains = 1)
 
-is_draws_list(x)
+is_draws_list(x)
+
-

Arguments

- - - - - - - - - - - - - - -
x

An object to convert to a draws_list object.

...

For as_draws_list(): +

+

Arguments

+
x
+

An object to convert to a draws_list object.

+
...
+

For as_draws_list(): Arguments passed to individual methods (if applicable). For draws_list(): Named -arguments containing numeric vectors each defining a separate variable.

.nchains

(positive integer) The number of chains. The default is 1.

- -

Value

- +arguments containing numeric vectors each defining a separate variable.

+
.nchains
+

(positive integer) The number of chains. The default is 1.

+
+
+

Value

A draws_list object, which has classes -c("draws_list", "draws", "list").

-

Details

- +c("draws_list", "draws", "list").

+
+
+

Details

Objects of class "draws_list" are lists with one element per MCMC chain. Each of these elements is itself a named list of numeric vectors with one vector per variable. The length of each vector is equal to the number of saved iterations per chain. See Examples.

-

See also

- -

Other formats: -draws_array(), -draws_df(), -draws_matrix(), -draws_rvars(), -draws

+
+
+

See also

+

Other formats: +draws_array(), +draws_df(), +draws_matrix(), +draws_rvars(), +draws

+
-

Examples

-
x1 <- as_draws_list(example_draws()) -class(x1) -
#> [1] "draws_list" "draws" "list"
print(x1) -
#> # A draws_list: 100 iterations, 4 chains, and 10 variables -#> -#> [chain = 1] -#> $mu -#> [1] 2.01 1.46 5.81 6.85 1.81 3.84 5.47 1.20 0.15 7.17 -#> -#> $tau -#> [1] 2.8 7.0 9.7 4.8 2.8 4.1 4.0 1.5 3.9 1.8 -#> -#> $`theta[1]` -#> [1] 3.96 0.12 21.25 14.70 5.96 5.76 4.03 -0.28 1.81 6.08 -#> -#> $`theta[2]` -#> [1] 0.271 -0.069 14.931 8.586 1.156 9.909 4.151 1.846 0.661 8.102 -#> -#> -#> [chain = 2] -#> $mu -#> [1] 2.99 8.17 -1.15 10.93 9.82 -10.90 -9.26 1.79 5.35 0.87 -#> -#> $tau -#> [1] 2.80 2.76 0.57 2.45 2.80 6.08 9.33 6.81 2.82 6.69 -#> -#> $`theta[1]` -#> [1] 6.26 9.32 -0.97 12.45 9.75 2.56 11.92 9.89 4.31 9.26 -#> -#> $`theta[2]` -#> [1] 1.0 9.4 -1.2 12.5 11.9 -8.8 -6.1 11.6 2.8 8.4 -#> -#> # ... with 90 more iterations, and 2 more chains, and 6 more variables
str(x1) -
#> List of 4 -#> $ 1:List of 10 -#> ..$ mu : num [1:100] 2.01 1.46 5.81 6.85 1.81 ... -#> ..$ tau : num [1:100] 2.77 6.98 9.68 4.79 2.85 ... -#> ..$ theta[1]: num [1:100] 3.962 0.124 21.251 14.7 5.96 ... -#> ..$ theta[2]: num [1:100] 0.271 -0.069 14.931 8.586 1.156 ... -#> ..$ theta[3]: num [1:100] -0.743 0.952 1.829 2.675 3.109 ... -#> ..$ theta[4]: num [1:100] 2.1 7.28 1.38 4.39 1.99 ... -#> ..$ theta[5]: num [1:100] 0.923 -0.062 0.531 4.758 0.769 ... -#> ..$ theta[6]: num [1:100] 1.65 11.26 7.16 8.1 4.66 ... -#> ..$ theta[7]: num [1:100] 3.32 9.62 14.8 9.49 1.21 ... -#> ..$ theta[8]: num [1:100] 4.85 -8.64 -1.74 5.28 -4.54 ... -#> $ 2:List of 10 -#> ..$ mu : num [1:100] 2.99 8.17 -1.15 10.93 9.82 ... -#> ..$ tau : num [1:100] 2.804 2.757 0.569 2.453 2.798 ... -#> ..$ theta[1]: num [1:100] 6.259 9.321 -0.972 12.455 9.751 ... -#> ..$ theta[2]: num [1:100] 1.03 9.36 -1.19 12.53 11.94 ... -#> ..$ theta[3]: num [1:100] 0.218 9.685 -1.373 11.155 12.718 ... -#> ..$ theta[4]: num [1:100] -0.734 8.11 -0.794 10.476 9.698 ... -#> ..$ theta[5]: num [1:100] 4.06 6.72 -0.787 10.595 9.946 ... -#> ..$ theta[6]: num [1:100] 3.34 7.4 -1.18 10.51 8.35 ... -#> ..$ theta[7]: num [1:100] 3.15 11.39 -1.43 15.54 12.91 ... -#> ..$ theta[8]: num [1:100] -0.443 12.359 -1.775 14.45 15.171 ... -#> $ 3:List of 10 -#> ..$ mu : num [1:100] 1.7944 5.9864 2.5572 2.7944 -0.0296 ... -#> ..$ tau : num [1:100] 8.72 2.91 8.41 4.39 11.03 ... -#> ..$ theta[1]: num [1:100] 13.32 6.31 10.56 5.37 8.2 ... -#> ..$ theta[2]: num [1:100] 2.11 7.31 5.7 2.8 3.15 ... -#> ..$ theta[3]: num [1:100] 1.38 4.11 -8.27 -10.77 -27.78 ... -#> ..$ theta[4]: num [1:100] 7.82 4.7 6.8 6.8 12.32 ... -#> ..$ theta[5]: num [1:100] -1.5 6.96 -3.15 -4.81 -14.91 ... -#> ..$ theta[6]: num [1:100] 12.744 0.877 5.435 3.67 -0.246 ... -#> ..$ theta[7]: num [1:100] 9.37 6.11 15.37 3.17 7.81 ... -#> ..$ theta[8]: num [1:100] 11.98 2.26 4.27 2.91 3.52 ... -#> $ 4:List of 10 -#> ..$ mu : num [1:100] 6.459 9.145 0.203 3.693 5.48 ... -#> ..$ tau : num [1:100] 3.77 6.84 5.32 1.55 3 ... -#> ..$ theta[1]: num [1:100] 5.776 2.086 15.719 2.689 -0.906 ... -#> ..$ theta[2]: num [1:100] 4.96 8.19 6.04 2.67 3.19 ... -#> ..$ theta[3]: num [1:100] 5.69 3.47 3.13 3.16 2.55 ... -#> ..$ theta[4]: num [1:100] 4.84 7.78 6.06 7.92 11.27 ... -#> ..$ theta[5]: num [1:100] 2.74 6.15 3.73 3.34 3.98 ... -#> ..$ theta[6]: num [1:100] 0.607 1.227 1.538 0.26 -1.121 ... -#> ..$ theta[7]: num [1:100] 9.54 10.12 7.11 2.11 7.31 ... -#> ..$ theta[8]: num [1:100] 3.252 4.728 0.182 4.755 7.523 ... -#> - attr(*, "class")= chr [1:3] "draws_list" "draws" "list"
-x2 <- draws_list(a = rnorm(10), b = rnorm(10), c = 1) -class(x2) -
#> [1] "draws_list" "draws" "list"
print(x2) -
#> # A draws_list: 10 iterations, 1 chains, and 3 variables -#> -#> [chain = 1] -#> $a -#> [1] -0.56 -0.54 0.23 0.98 -0.21 -1.40 0.26 -0.44 0.57 2.13 -#> -#> $b -#> [1] 0.425 -1.684 0.249 1.073 2.039 0.449 1.392 0.427 0.108 0.022 -#> -#> $c -#> [1] 1 1 1 1 1 1 1 1 1 1 -#>
str(x2) -
#> List of 1 -#> $ 1:List of 3 -#> ..$ a: num [1:10] -0.559 -0.537 0.227 0.978 -0.209 ... -#> ..$ b: num [1:10] 0.425 -1.684 0.249 1.073 2.039 ... -#> ..$ c: num [1:10] 1 1 1 1 1 1 1 1 1 1 -#> - attr(*, "class")= chr [1:3] "draws_list" "draws" "list"
+
+

Examples

+
x1 <- as_draws_list(example_draws())
+class(x1)
+#> [1] "draws_list" "draws"      "list"      
+print(x1)
+#> # A draws_list: 100 iterations, 4 chains, and 10 variables
+#> 
+#> [chain = 1]
+#> $mu
+#>  [1] 2.01 1.46 5.81 6.85 1.81 3.84 5.47 1.20 0.15 7.17
+#> 
+#> $tau
+#>  [1] 2.8 7.0 9.7 4.8 2.8 4.1 4.0 1.5 3.9 1.8
+#> 
+#> $`theta[1]`
+#>  [1]  3.96  0.12 21.25 14.70  5.96  5.76  4.03 -0.28  1.81  6.08
+#> 
+#> $`theta[2]`
+#>  [1]  0.271 -0.069 14.931  8.586  1.156  9.909  4.151  1.846  0.661  8.102
+#> 
+#> 
+#> [chain = 2]
+#> $mu
+#>  [1]   2.99   8.17  -1.15  10.93   9.82 -10.90  -9.26   1.79   5.35   0.87
+#> 
+#> $tau
+#>  [1] 2.80 2.76 0.57 2.45 2.80 6.08 9.33 6.81 2.82 6.69
+#> 
+#> $`theta[1]`
+#>  [1]  6.26  9.32 -0.97 12.45  9.75  2.56 11.92  9.89  4.31  9.26
+#> 
+#> $`theta[2]`
+#>  [1]  1.0  9.4 -1.2 12.5 11.9 -8.8 -6.1 11.6  2.8  8.4
+#> 
+#> # ... with 90 more iterations, and 2 more chains, and 6 more variables
+str(x1)
+#> List of 4
+#>  $ 1:List of 10
+#>   ..$ mu      : num [1:100] 2.01 1.46 5.81 6.85 1.81 ...
+#>   ..$ tau     : num [1:100] 2.77 6.98 9.68 4.79 2.85 ...
+#>   ..$ theta[1]: num [1:100] 3.962 0.124 21.251 14.7 5.96 ...
+#>   ..$ theta[2]: num [1:100] 0.271 -0.069 14.931 8.586 1.156 ...
+#>   ..$ theta[3]: num [1:100] -0.743 0.952 1.829 2.675 3.109 ...
+#>   ..$ theta[4]: num [1:100] 2.1 7.28 1.38 4.39 1.99 ...
+#>   ..$ theta[5]: num [1:100] 0.923 -0.062 0.531 4.758 0.769 ...
+#>   ..$ theta[6]: num [1:100] 1.65 11.26 7.16 8.1 4.66 ...
+#>   ..$ theta[7]: num [1:100] 3.32 9.62 14.8 9.49 1.21 ...
+#>   ..$ theta[8]: num [1:100] 4.85 -8.64 -1.74 5.28 -4.54 ...
+#>  $ 2:List of 10
+#>   ..$ mu      : num [1:100] 2.99 8.17 -1.15 10.93 9.82 ...
+#>   ..$ tau     : num [1:100] 2.804 2.757 0.569 2.453 2.798 ...
+#>   ..$ theta[1]: num [1:100] 6.259 9.321 -0.972 12.455 9.751 ...
+#>   ..$ theta[2]: num [1:100] 1.03 9.36 -1.19 12.53 11.94 ...
+#>   ..$ theta[3]: num [1:100] 0.218 9.685 -1.373 11.155 12.718 ...
+#>   ..$ theta[4]: num [1:100] -0.734 8.11 -0.794 10.476 9.698 ...
+#>   ..$ theta[5]: num [1:100] 4.06 6.72 -0.787 10.595 9.946 ...
+#>   ..$ theta[6]: num [1:100] 3.34 7.4 -1.18 10.51 8.35 ...
+#>   ..$ theta[7]: num [1:100] 3.15 11.39 -1.43 15.54 12.91 ...
+#>   ..$ theta[8]: num [1:100] -0.443 12.359 -1.775 14.45 15.171 ...
+#>  $ 3:List of 10
+#>   ..$ mu      : num [1:100] 1.7944 5.9864 2.5572 2.7944 -0.0296 ...
+#>   ..$ tau     : num [1:100] 8.72 2.91 8.41 4.39 11.03 ...
+#>   ..$ theta[1]: num [1:100] 13.32 6.31 10.56 5.37 8.2 ...
+#>   ..$ theta[2]: num [1:100] 2.11 7.31 5.7 2.8 3.15 ...
+#>   ..$ theta[3]: num [1:100] 1.38 4.11 -8.27 -10.77 -27.78 ...
+#>   ..$ theta[4]: num [1:100] 7.82 4.7 6.8 6.8 12.32 ...
+#>   ..$ theta[5]: num [1:100] -1.5 6.96 -3.15 -4.81 -14.91 ...
+#>   ..$ theta[6]: num [1:100] 12.744 0.877 5.435 3.67 -0.246 ...
+#>   ..$ theta[7]: num [1:100] 9.37 6.11 15.37 3.17 7.81 ...
+#>   ..$ theta[8]: num [1:100] 11.98 2.26 4.27 2.91 3.52 ...
+#>  $ 4:List of 10
+#>   ..$ mu      : num [1:100] 6.459 9.145 0.203 3.693 5.48 ...
+#>   ..$ tau     : num [1:100] 3.77 6.84 5.32 1.55 3 ...
+#>   ..$ theta[1]: num [1:100] 5.776 2.086 15.719 2.689 -0.906 ...
+#>   ..$ theta[2]: num [1:100] 4.96 8.19 6.04 2.67 3.19 ...
+#>   ..$ theta[3]: num [1:100] 5.69 3.47 3.13 3.16 2.55 ...
+#>   ..$ theta[4]: num [1:100] 4.84 7.78 6.06 7.92 11.27 ...
+#>   ..$ theta[5]: num [1:100] 2.74 6.15 3.73 3.34 3.98 ...
+#>   ..$ theta[6]: num [1:100] 0.607 1.227 1.538 0.26 -1.121 ...
+#>   ..$ theta[7]: num [1:100] 9.54 10.12 7.11 2.11 7.31 ...
+#>   ..$ theta[8]: num [1:100] 3.252 4.728 0.182 4.755 7.523 ...
+#>  - attr(*, "class")= chr [1:3] "draws_list" "draws" "list"
+
+x2 <- draws_list(a = rnorm(10), b = rnorm(10), c = 1)
+class(x2)
+#> [1] "draws_list" "draws"      "list"      
+print(x2)
+#> # A draws_list: 10 iterations, 1 chains, and 3 variables
+#> 
+#> [chain = 1]
+#> $a
+#>  [1] -0.375  1.195  1.422 -0.306  0.832  1.290  0.136 -0.070 -0.044  0.159
+#> 
+#> $b
+#>  [1]  1.070 -0.138  0.491 -0.884  1.481  2.128  0.062 -0.435 -0.230 -1.069
+#> 
+#> $c
+#>  [1] 1 1 1 1 1 1 1 1 1 1
+#> 
+str(x2)
+#> List of 1
+#>  $ 1:List of 3
+#>   ..$ a: num [1:10] -0.375 1.195 1.422 -0.306 0.832 ...
+#>   ..$ b: num [1:10] 1.07 -0.138 0.491 -0.884 1.481 ...
+#>   ..$ c: num [1:10] 1 1 1 1 1 1 1 1 1 1
+#>  - attr(*, "class")= chr [1:3] "draws_list" "draws" "list"
+
+
+
-
- +
- - + + diff --git a/docs/reference/draws_matrix.html b/docs/reference/draws_matrix.html index 84aaf3f7..753f4025 100644 --- a/docs/reference/draws_matrix.html +++ b/docs/reference/draws_matrix.html @@ -1,71 +1,16 @@ - - - - - - - -The draws_matrix format — draws_matrix • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The draws_matrix format — draws_matrix • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
@@ -179,142 +115,143 @@

The draws_matrix format

See Details.

-
as_draws_matrix(x, ...)
+    
+
as_draws_matrix(x, ...)
 
-# S3 method for default
-as_draws_matrix(x, ...)
+# S3 method for default
+as_draws_matrix(x, ...)
 
-# S3 method for draws_matrix
-as_draws_matrix(x, ...)
+# S3 method for draws_matrix
+as_draws_matrix(x, ...)
 
-# S3 method for draws_array
-as_draws_matrix(x, ...)
+# S3 method for draws_array
+as_draws_matrix(x, ...)
 
-# S3 method for draws_df
-as_draws_matrix(x, ...)
+# S3 method for draws_df
+as_draws_matrix(x, ...)
 
-# S3 method for draws_list
-as_draws_matrix(x, ...)
+# S3 method for draws_list
+as_draws_matrix(x, ...)
 
-# S3 method for draws_rvars
-as_draws_matrix(x, ...)
+# S3 method for draws_rvars
+as_draws_matrix(x, ...)
 
-# S3 method for mcmc
-as_draws_matrix(x, ...)
+# S3 method for mcmc
+as_draws_matrix(x, ...)
 
-# S3 method for mcmc.list
-as_draws_matrix(x, ...)
+# S3 method for mcmc.list
+as_draws_matrix(x, ...)
 
-draws_matrix(..., .nchains = 1)
+draws_matrix(..., .nchains = 1)
 
-is_draws_matrix(x)
+is_draws_matrix(x)
+
-

Arguments

- - - - - - - - - - - - - - -
x

An object to convert to a draws_matrix object.

...

For as_draws_matrix(): +

+

Arguments

+
x
+

An object to convert to a draws_matrix object.

+
...
+

For as_draws_matrix(): Arguments passed to individual methods (if applicable). For draws_matrix(): Named -arguments containing numeric vectors each defining a separate variable.

.nchains

(positive integer) The number of chains. The default is 1.

- -

Value

- +arguments containing numeric vectors each defining a separate variable.

+
.nchains
+

(positive integer) The number of chains. The default is 1.

+
+
+

Value

A draws_matrix object, which has classes -c("draws_matrix", "draws", "matrix").

-

Details

- +c("draws_matrix", "draws", "matrix").

+
+
+

Details

Objects of class "draws_matrix" are matrices (2-D arrays) with dimensions "draw" and "variable". See Examples.

-

See also

- -

Other formats: -draws_array(), -draws_df(), -draws_list(), -draws_rvars(), -draws

+
+
+

See also

+

Other formats: +draws_array(), +draws_df(), +draws_list(), +draws_rvars(), +draws

+
-

Examples

-
x1 <- as_draws_matrix(example_draws()) -class(x1) -
#> [1] "draws_matrix" "draws" "matrix"
print(x1) -
#> # A draws_matrix: 100 iterations, 4 chains, and 10 variables -#> variable -#> draw mu tau theta[1] theta[2] theta[3] theta[4] theta[5] theta[6] -#> 1 2.01 2.8 3.96 0.271 -0.74 2.1 0.923 1.7 -#> 2 1.46 7.0 0.12 -0.069 0.95 7.3 -0.062 11.3 -#> 3 5.81 9.7 21.25 14.931 1.83 1.4 0.531 7.2 -#> 4 6.85 4.8 14.70 8.586 2.67 4.4 4.758 8.1 -#> 5 1.81 2.8 5.96 1.156 3.11 2.0 0.769 4.7 -#> 6 3.84 4.1 5.76 9.909 -1.00 5.3 5.889 -1.7 -#> 7 5.47 4.0 4.03 4.151 10.15 6.6 3.741 -2.2 -#> 8 1.20 1.5 -0.28 1.846 0.47 4.3 1.467 3.3 -#> 9 0.15 3.9 1.81 0.661 0.86 4.5 -1.025 1.1 -#> 10 7.17 1.8 6.08 8.102 7.68 5.6 7.106 8.5 -#> # ... with 390 more draws, and 2 more variables
str(x1) -
#> 'draws_matrix' num [1:400, 1:10] 2.01 1.46 5.81 6.85 1.81 ... -#> - attr(*, "dimnames")=List of 2 -#> ..$ draw : chr [1:400] "1" "2" "3" "4" ... -#> ..$ variable: chr [1:10] "mu" "tau" "theta[1]" "theta[2]" ... -#> - attr(*, "nchains")= int 4
-x2 <- draws_matrix(a = rnorm(10), b = rnorm(10), c = 1) -class(x2) -
#> [1] "draws_matrix" "draws" "matrix"
print(x2) -
#> # A draws_matrix: 10 iterations, 1 chains, and 3 variables -#> variable -#> draw a b c -#> 1 0.604 -0.855 1 -#> 2 -0.263 -0.287 1 -#> 3 -0.528 0.895 1 -#> 4 0.192 0.067 1 -#> 5 -1.146 -0.163 1 -#> 6 0.846 -0.827 1 -#> 7 0.082 1.877 1 -#> 8 -1.305 0.766 1 -#> 9 -0.945 0.980 1 -#> 10 0.454 1.322 1
str(x2) -
#> 'draws_matrix' num [1:10, 1:3] 0.604 -0.263 -0.528 0.192 -1.146 ... -#> - attr(*, "dimnames")=List of 2 -#> ..$ draw : chr [1:10] "1" "2" "3" "4" ... -#> ..$ variable: chr [1:3] "a" "b" "c" -#> - attr(*, "nchains")= int 1
+
+

Examples

+
x1 <- as_draws_matrix(example_draws())
+class(x1)
+#> [1] "draws_matrix" "draws"        "matrix"      
+print(x1)
+#> # A draws_matrix: 100 iterations, 4 chains, and 10 variables
+#>     variable
+#> draw   mu tau theta[1] theta[2] theta[3] theta[4] theta[5] theta[6]
+#>   1  2.01 2.8     3.96    0.271    -0.74      2.1    0.923      1.7
+#>   2  1.46 7.0     0.12   -0.069     0.95      7.3   -0.062     11.3
+#>   3  5.81 9.7    21.25   14.931     1.83      1.4    0.531      7.2
+#>   4  6.85 4.8    14.70    8.586     2.67      4.4    4.758      8.1
+#>   5  1.81 2.8     5.96    1.156     3.11      2.0    0.769      4.7
+#>   6  3.84 4.1     5.76    9.909    -1.00      5.3    5.889     -1.7
+#>   7  5.47 4.0     4.03    4.151    10.15      6.6    3.741     -2.2
+#>   8  1.20 1.5    -0.28    1.846     0.47      4.3    1.467      3.3
+#>   9  0.15 3.9     1.81    0.661     0.86      4.5   -1.025      1.1
+#>   10 7.17 1.8     6.08    8.102     7.68      5.6    7.106      8.5
+#> # ... with 390 more draws, and 2 more variables
+str(x1)
+#>  'draws_matrix' num [1:400, 1:10] 2.01 1.46 5.81 6.85 1.81 ...
+#>  - attr(*, "dimnames")=List of 2
+#>   ..$ draw    : chr [1:400] "1" "2" "3" "4" ...
+#>   ..$ variable: chr [1:10] "mu" "tau" "theta[1]" "theta[2]" ...
+#>  - attr(*, "nchains")= int 4
+
+x2 <- draws_matrix(a = rnorm(10), b = rnorm(10), c = 1)
+class(x2)
+#> [1] "draws_matrix" "draws"        "matrix"      
+print(x2)
+#> # A draws_matrix: 10 iterations, 1 chains, and 3 variables
+#>     variable
+#> draw      a     b c
+#>   1  -0.035 -1.04 1
+#>   2   0.138 -0.96 1
+#>   3  -0.078 -0.39 1
+#>   4  -0.276 -1.17 1
+#>   5  -0.124  0.12 1
+#>   6  -1.697  0.41 1
+#>   7   1.220  0.36 1
+#>   8  -0.944  2.01 1
+#>   9   1.177 -0.72 1
+#>   10 -1.049 -1.97 1
+str(x2)
+#>  'draws_matrix' num [1:10, 1:3] -0.0353 0.1384 -0.078 -0.2758 -0.1241 ...
+#>  - attr(*, "dimnames")=List of 2
+#>   ..$ draw    : chr [1:10] "1" "2" "3" "4" ...
+#>   ..$ variable: chr [1:3] "a" "b" "c"
+#>  - attr(*, "nchains")= int 1
+
+
+

-
- +
- - + + diff --git a/docs/reference/draws_of.html b/docs/reference/draws_of.html index 0bae1ea8..681f0de6 100644 --- a/docs/reference/draws_of.html +++ b/docs/reference/draws_of.html @@ -1,67 +1,12 @@ - - - - - - - -Get/set array of draws underlying a random variable — draws_of • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Get/set array of draws underlying a random variable — draws_of • posterior - - + + - - -
-
- -
- -
+
-

Gets/sets the array-representation that backs an rvar. Should be used rarely.

+

Gets/sets the array-representation that backs an rvar. Should be used rarely.

-
draws_of(x, with_chains = FALSE)
+    
+
draws_of(x, with_chains = FALSE)
 
-draws_of(x, with_chains = FALSE) <- value
+draws_of(x, with_chains = FALSE) <- value
+
-

Arguments

- - - - - - - - - - - - - - -
x

(rvar) An rvar object.

with_chains

(logical) Should the array of draws include a dimension for chains? +

+

Arguments

+
x
+

(rvar) An rvar object.

+
with_chains
+

(logical) Should the array of draws include a dimension for chains? If FALSE (the default), chains are not included and the array has dimension -c(ndraws(x), dim(x)). If TRUE, chains are included and the array has -dimension c(niterations(x), nchains(x), dim(x)).

value

(array) An array of values to use as the backing array of x.

- -

Value

- -

If with_chains = FALSE, an array with dimensions c(ndraws(x), dim(x)).

-

If with_chains = TRUE, an array with dimensions -c(niterations(x), nchains(x), dim(x)).

-

Details

- -

While rvars implement fast versions of basic math operations (including -matrix multiplication), sometimes you may need to bypass -the rvar abstraction to do what you need to do more efficiently. +c(ndraws(x), dim(x)). If TRUE, chains are included and the array has +dimension c(niterations(x), nchains(x), dim(x)).

+
value
+

(array) An array of values to use as the backing array of x.

+
+
+

Value

+

If with_chains = FALSE, an array with dimensions c(ndraws(x), dim(x)). +If with_chains = TRUE, an array with dimensions +c(niterations(x), nchains(x), dim(x)).

+
+
+

Details

+

While rvars implement fast versions of basic math operations (including +matrix multiplication), sometimes you may need to bypass +the rvar abstraction to do what you need to do more efficiently. draws_of() allows you to get / set the underlying array of draws in order to do that.

-

rvars represent draws internally using arrays of arbitrary dimension, which +

rvars represent draws internally using arrays of arbitrary dimension, which is returned by draws_of(x) and can be set using draws_of(x) <- value. The first dimension of these arrays is the index of the draws. If with_chains = TRUE, then the dimensions of the returned array are modified so that the first dimension is the index of the iterations and the second dimension is the index of the chains.

+
-

Examples

-
-x <- rvar(1:10, nchains = 2) -x -
#> rvar<5,2>[1] mean ± sd: -#> [1] 5.5 ± 3
-# draws_of() without arguments will return the array of draws without -# chain information (first dimension is draw) -draws_of(x) -
#> [,1] -#> 1 1 -#> 2 2 -#> 3 3 -#> 4 4 -#> 5 5 -#> 6 6 -#> 7 7 -#> 8 8 -#> 9 9 -#> 10 10
-# draws_of() with with_chains = TRUE will reshape the returned array to -# include chain information in the second dimension -draws_of(x, with_chains = TRUE) -
#> , , 1 -#> -#> [,1] [,2] -#> [1,] 1 6 -#> [2,] 2 7 -#> [3,] 3 8 -#> [4,] 4 9 -#> [5,] 5 10 -#>
-# you can also set draws using draws_of(). When with_chains = FALSE the -# existing chain information will be retained ... -draws_of(x) <- 2:11 -x -
#> rvar<5,2>[1] mean ± sd: -#> [1] 6.5 ± 3
-# when with_chains = TRUE the chain information will be set by the -# second dimension of the assigned array -draws_of(x, with_chains = TRUE) <- array(2:11, dim = c(2,5)) -x -
#> rvar<2,5>[1] mean ± sd: -#> [1] 6.5 ± 3
-
+
+

Examples

+

+x <- rvar(1:10, nchains = 2)
+x
+#> rvar<5,2>[1] mean ± sd:
+#> [1] 5.5 ± 3 
+
+# draws_of() without arguments will return the array of draws without
+# chain information (first dimension is draw)
+draws_of(x)
+#>    [,1]
+#> 1     1
+#> 2     2
+#> 3     3
+#> 4     4
+#> 5     5
+#> 6     6
+#> 7     7
+#> 8     8
+#> 9     9
+#> 10   10
+
+# draws_of() with with_chains = TRUE will reshape the returned array to
+# include chain information in the second dimension
+draws_of(x, with_chains = TRUE)
+#> , , 1
+#> 
+#>      [,1] [,2]
+#> [1,]    1    6
+#> [2,]    2    7
+#> [3,]    3    8
+#> [4,]    4    9
+#> [5,]    5   10
+#> 
+
+# you can also set draws using draws_of(). When with_chains = FALSE the
+# existing chain information will be retained ...
+draws_of(x) <- 2:11
+x
+#> rvar<5,2>[1] mean ± sd:
+#> [1] 6.5 ± 3 
+
+# when with_chains = TRUE the chain information will be set by the
+# second dimension of the assigned array
+draws_of(x, with_chains = TRUE) <- array(2:11, dim = c(2,5))
+x
+#> rvar<2,5>[1] mean ± sd:
+#> [1] 6.5 ± 3 
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/draws_rvars.html b/docs/reference/draws_rvars.html index fea20f48..ef98e537 100644 --- a/docs/reference/draws_rvars.html +++ b/docs/reference/draws_rvars.html @@ -1,71 +1,16 @@ - - - - - - - -The draws_rvars format — draws_rvars • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -The draws_rvars format — draws_rvars • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
@@ -179,139 +115,140 @@

The draws_rvars format

See Details.

-
as_draws_rvars(x, ...)
+    
+
as_draws_rvars(x, ...)
 
-# S3 method for default
-as_draws_rvars(x, ...)
+# S3 method for default
+as_draws_rvars(x, ...)
 
-# S3 method for draws_rvars
-as_draws_rvars(x, ...)
+# S3 method for draws_rvars
+as_draws_rvars(x, ...)
 
-# S3 method for list
-as_draws_rvars(x, ...)
+# S3 method for list
+as_draws_rvars(x, ...)
 
-# S3 method for draws_matrix
-as_draws_rvars(x, ...)
+# S3 method for draws_matrix
+as_draws_rvars(x, ...)
 
-# S3 method for draws_array
-as_draws_rvars(x, ...)
+# S3 method for draws_array
+as_draws_rvars(x, ...)
 
-# S3 method for draws_df
-as_draws_rvars(x, ...)
+# S3 method for draws_df
+as_draws_rvars(x, ...)
 
-# S3 method for draws_list
-as_draws_rvars(x, ...)
+# S3 method for draws_list
+as_draws_rvars(x, ...)
 
-# S3 method for mcmc
-as_draws_rvars(x, ...)
+# S3 method for mcmc
+as_draws_rvars(x, ...)
 
-# S3 method for mcmc.list
-as_draws_rvars(x, ...)
+# S3 method for mcmc.list
+as_draws_rvars(x, ...)
 
-draws_rvars(..., .nchains = 1)
+draws_rvars(..., .nchains = 1)
 
-is_draws_rvars(x)
+is_draws_rvars(x)
+
-

Arguments

- - - - - - - - - - - - - - -
x

An object to convert to a draws_rvars object.

...

For as_draws_rvars(): +

+

Arguments

+
x
+

An object to convert to a draws_rvars object.

+
...
+

For as_draws_rvars(): Arguments passed to individual methods (if applicable). For draws_rvars(): Named -arguments containing numeric vectors each defining a separate variable.

.nchains

(positive integer) The number of chains. The default is 1.

- -

Value

- +arguments containing numeric vectors each defining a separate variable.

+
.nchains
+

(positive integer) The number of chains. The default is 1.

+
+
+

Value

A draws_rvars object, which has classes -c("draws_rvars", "draws", "list").

-

Details

- -

Objects of class "draws_rvars" are lists of rvar objects. +c("draws_rvars", "draws", "list").

+
+
+

Details

+

Objects of class "draws_rvars" are lists of rvar objects. See Examples.

-

See also

- -

Other formats: -draws_array(), -draws_df(), -draws_list(), -draws_matrix(), -draws

+
+
+

See also

+

Other formats: +draws_array(), +draws_df(), +draws_list(), +draws_matrix(), +draws

+
-

Examples

-
x1 <- as_draws_rvars(example_draws()) -class(x1) -
#> [1] "draws_rvars" "draws" "list"
print(x1) -
#> # A draws_rvars: 100 iterations, 4 chains, and 3 variables -#> $mu: rvar<100,4>[1] mean ± sd: -#> [1] 4.2 ± 3.4 -#> -#> $tau: rvar<100,4>[1] mean ± sd: -#> [1] 4.2 ± 3.6 -#> -#> $theta: rvar<100,4>[8] mean ± sd: -#> [1] 6.7 ± 6.3 5.3 ± 4.6 3.0 ± 6.8 4.9 ± 4.9 3.2 ± 5.1 4.0 ± 5.2 6.5 ± 5.3 -#> [8] 4.6 ± 5.3 -#>
str(x1) -
#> List of 3 -#> $ mu : rvar<100,4>[1] 4.2 ± 3.4 -#> $ tau : rvar<100,4>[1] 4.2 ± 3.6 -#> $ theta: rvar<100,4>[8] 6.7 ± 6.3 5.3 ± 4.6 3.0 ± 6.8 4.9 ± 4.9 ... -#> - attr(*, "class")= chr [1:3] "draws_rvars" "draws" "list"
-x2 <- draws_rvars(a = rnorm(10), b = rnorm(10), c = 1) -class(x2) -
#> [1] "draws_rvars" "draws" "list"
print(x2) -
#> # A draws_rvars: 10 iterations, 1 chains, and 3 variables -#> $a: rvar<10>[1] mean ± sd: -#> [1] 0.0004 ± 1 -#> -#> $b: rvar<10>[1] mean ± sd: -#> [1] -0.23 ± 1 -#> -#> $c: rvar<10>[1] mean ± sd: -#> [1] 1 ± 0 -#>
str(x2) -
#> List of 3 -#> $ a: rvar<10>[1] 0.0004 ± 1 -#> $ b: rvar<10>[1] -0.23 ± 1 -#> $ c: rvar<10>[1] 1 ± 0 -#> - attr(*, "class")= chr [1:3] "draws_rvars" "draws" "list"
+
+

Examples

+
x1 <- as_draws_rvars(example_draws())
+class(x1)
+#> [1] "draws_rvars" "draws"       "list"       
+print(x1)
+#> # A draws_rvars: 100 iterations, 4 chains, and 3 variables
+#> $mu: rvar<100,4>[1] mean ± sd:
+#> [1] 4.2 ± 3.4 
+#> 
+#> $tau: rvar<100,4>[1] mean ± sd:
+#> [1] 4.2 ± 3.6 
+#> 
+#> $theta: rvar<100,4>[8] mean ± sd:
+#> [1] 6.7 ± 6.3  5.3 ± 4.6  3.0 ± 6.8  4.9 ± 4.9  3.2 ± 5.1  4.0 ± 5.2  6.5 ± 5.3 
+#> [8] 4.6 ± 5.3 
+#> 
+str(x1)
+#> List of 3
+#>  $ mu   : rvar<100,4>[1]  4.2 ± 3.4
+#>  $ tau  : rvar<100,4>[1]  4.2 ± 3.6
+#>  $ theta: rvar<100,4>[8]  6.7 ± 6.3  5.3 ± 4.6  3.0 ± 6.8  4.9 ± 4.9 ...
+#>  - attr(*, "class")= chr [1:3] "draws_rvars" "draws" "list"
+
+x2 <- draws_rvars(a = rnorm(10), b = rnorm(10), c = 1)
+class(x2)
+#> [1] "draws_rvars" "draws"       "list"       
+print(x2)
+#> # A draws_rvars: 10 iterations, 1 chains, and 3 variables
+#> $a: rvar<10>[1] mean ± sd:
+#> [1] -0.49 ± 1.2 
+#> 
+#> $b: rvar<10>[1] mean ± sd:
+#> [1] -0.08 ± 0.65 
+#> 
+#> $c: rvar<10>[1] mean ± sd:
+#> [1] 1 ± 0 
+#> 
+str(x2)
+#> List of 3
+#>  $ a: rvar<10>[1]  -0.49 ± 1.2
+#>  $ b: rvar<10>[1]  -0.08 ± 0.65
+#>  $ c: rvar<10>[1]  1 ± 0
+#>  - attr(*, "class")= chr [1:3] "draws_rvars" "draws" "list"
+
+
+ - - - + + diff --git a/docs/reference/draws_summary.html b/docs/reference/draws_summary.html index b0c2a603..8bc48a93 100644 --- a/docs/reference/draws_summary.html +++ b/docs/reference/draws_summary.html @@ -1,72 +1,17 @@ - - - - - - - -Summaries of draws objects — draws_summary • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Summaries of draws objects — draws_summary • posterior - - - - - - - - - - + + - - - -
-
- -
- -
+
@@ -176,258 +112,254 @@

Summaries of draws objects

The summarise_draws() (and summarize_draws()) methods provide a quick way to get a table of summary statistics and diagnostics. These methods will convert an object to a draws object if it isn't already. For convenience, a -summary() method for draws and rvar objects are also +summary() method for draws and rvar objects are also provided as an alias for summarise_draws() if the input object is a draws or rvar object.

-
summarise_draws(.x, ...)
+    
+
summarise_draws(.x, ...)
 
-summarize_draws(.x, ...)
+summarize_draws(.x, ...)
 
-# S3 method for draws
-summarise_draws(.x, ..., .args = list(), .cores = 1)
+# S3 method for draws
+summarise_draws(.x, ..., .args = list(), .cores = 1)
 
-# S3 method for draws
-summary(object, ...)
+# S3 method for draws
+summary(object, ...)
 
-# S3 method for rvar
-summarise_draws(.x, ...)
+# S3 method for rvar
+summarise_draws(.x, ...)
 
-# S3 method for rvar
-summary(object, ...)
+# S3 method for rvar
+summary(object, ...)
 
-default_summary_measures()
+default_summary_measures()
 
-default_convergence_measures()
+default_convergence_measures()
 
-default_mcse_measures()
+default_mcse_measures()
+
-

Arguments

- - - - - - - - - - - - - - - - - - -
.x, object

(draws) A draws object or one coercible to a draws object.

...

Name-value pairs of summary or diagnostic +

+

Arguments

+
.x, object
+

(draws) A draws object or one coercible to a draws object.

+
...
+

Name-value pairs of summary or diagnostic functions. The provided names will be used as the names of the columns in the result unless the function returns a named vector, in which case the latter names are used. The functions can be specified in any format -supported by as_function(). See Examples.

.args

(named list) Optional arguments passed to the summary functions.

.cores

(positive integer) The number of cores to use for computing +supported by as_function(). See Examples.

+
.args
+

(named list) Optional arguments passed to the summary functions.

+
.cores
+

(positive integer) The number of cores to use for computing summaries for different variables in parallel. Coerced to integer if possible, otherwise errors. The default is .cores = 1, in which case no parallelization is implemented. By default, a socket cluster is used on -Windows and forks otherwise.

- -

Value

- -

The summarise_draws() methods return a tibble data frame. +Windows and forks otherwise.

+
+
+

Value

+

The summarise_draws() methods return a tibble data frame. The first column ("variable") contains the variable names and the remaining -columns contain summary statistics and diagnostics.

-

The functions default_summary_measures(), default_convergence_measures(), +columns contain summary statistics and diagnostics. +The functions default_summary_measures(), default_convergence_measures(), and default_mcse_measures() return character vectors of names of the default measures.

-

Details

- +
+
+

Details

The default summary functions used are the ones specified by default_summary_measures() and default_convergence_measures():

-

default_summary_measures()

- -

default_convergence_measures()

- -

The var() function should not be used to compute variances due +

default_summary_measures()

default_convergence_measures()

The var() function should not be used to compute variances due to its inconsistent behavior with matrices. Instead, please use -distributional::variance().

-

See also

- -

diagnostics for a list of available diagnostics and links to +distributional::variance().

+
+
+

See also

+

diagnostics for a list of available diagnostics and links to their individual help pages.

+
-

Examples

-
x <- example_draws("eight_schools") -class(x) -
#> [1] "draws_array" "draws" "array"
str(x) -
#> 'draws_array' num [1:100, 1:4, 1:10] 2.01 1.46 5.81 6.85 1.81 ... -#> - attr(*, "dimnames")=List of 3 -#> ..$ iteration: chr [1:100] "1" "2" "3" "4" ... -#> ..$ chain : chr [1:4] "1" "2" "3" "4" -#> ..$ variable : chr [1:10] "mu" "tau" "theta[1]" "theta[2]" ...
-summarise_draws(x) -
#> # A tibble: 10 x 10 -#> variable mean median sd mad q5 q95 rhat ess_bulk ess_tail -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mu 4.18 4.16 3.40 3.57 -0.854 9.39 1.02 558. 322. -#> 2 tau 4.16 3.07 3.58 2.89 0.309 11.0 1.01 246. 202. -#> 3 theta[1] 6.75 5.97 6.30 4.87 -1.23 18.9 1.01 400. 254. -#> 4 theta[2] 5.25 5.13 4.63 4.25 -1.97 12.5 1.02 564. 372. -#> 5 theta[3] 3.04 3.99 6.80 4.94 -10.3 11.9 1.01 312. 205. -#> 6 theta[4] 4.86 4.99 4.92 4.51 -3.57 12.2 1.02 695. 252. -#> 7 theta[5] 3.22 3.72 5.08 4.38 -5.93 10.8 1.01 523. 306. -#> 8 theta[6] 3.99 4.14 5.16 4.81 -4.32 11.5 1.02 548. 205. -#> 9 theta[7] 6.50 5.90 5.26 4.54 -1.19 15.4 1.00 434. 308. -#> 10 theta[8] 4.57 4.64 5.25 4.89 -3.79 12.2 1.02 355. 146.
summarise_draws(x, "mean", "median") -
#> # A tibble: 10 x 3 -#> variable mean median -#> <chr> <dbl> <dbl> -#> 1 mu 4.18 4.16 -#> 2 tau 4.16 3.07 -#> 3 theta[1] 6.75 5.97 -#> 4 theta[2] 5.25 5.13 -#> 5 theta[3] 3.04 3.99 -#> 6 theta[4] 4.86 4.99 -#> 7 theta[5] 3.22 3.72 -#> 8 theta[6] 3.99 4.14 -#> 9 theta[7] 6.50 5.90 -#> 10 theta[8] 4.57 4.64
summarise_draws(x, mean, mcse = mcse_mean) -
#> # A tibble: 10 x 3 -#> variable mean mcse -#> <chr> <dbl> <dbl> -#> 1 mu 4.18 0.150 -#> 2 tau 4.16 0.213 -#> 3 theta[1] 6.75 0.319 -#> 4 theta[2] 5.25 0.202 -#> 5 theta[3] 3.04 0.447 -#> 6 theta[4] 4.86 0.189 -#> 7 theta[5] 3.22 0.232 -#> 8 theta[6] 3.99 0.222 -#> 9 theta[7] 6.50 0.250 -#> 10 theta[8] 4.57 0.273
summarise_draws(x, ~quantile(.x, probs = c(0.4, 0.6))) -
#> # A tibble: 10 x 3 -#> variable `40%` `60%` -#> <chr> <dbl> <dbl> -#> 1 mu 3.41 5.35 -#> 2 tau 2.47 3.96 -#> 3 theta[1] 4.95 7.01 -#> 4 theta[2] 4.32 6.13 -#> 5 theta[3] 2.54 5.33 -#> 6 theta[4] 3.78 6.11 -#> 7 theta[5] 2.69 4.69 -#> 8 theta[6] 2.92 5.47 -#> 9 theta[7] 4.81 7.33 -#> 10 theta[8] 3.50 5.92
-# using default_*_meaures() -summarise_draws(x, default_summary_measures()) -
#> # A tibble: 10 x 7 -#> variable mean median sd mad q5 q95 -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mu 4.18 4.16 3.40 3.57 -0.854 9.39 -#> 2 tau 4.16 3.07 3.58 2.89 0.309 11.0 -#> 3 theta[1] 6.75 5.97 6.30 4.87 -1.23 18.9 -#> 4 theta[2] 5.25 5.13 4.63 4.25 -1.97 12.5 -#> 5 theta[3] 3.04 3.99 6.80 4.94 -10.3 11.9 -#> 6 theta[4] 4.86 4.99 4.92 4.51 -3.57 12.2 -#> 7 theta[5] 3.22 3.72 5.08 4.38 -5.93 10.8 -#> 8 theta[6] 3.99 4.14 5.16 4.81 -4.32 11.5 -#> 9 theta[7] 6.50 5.90 5.26 4.54 -1.19 15.4 -#> 10 theta[8] 4.57 4.64 5.25 4.89 -3.79 12.2
summarise_draws(x, default_convergence_measures()) -
#> # A tibble: 10 x 4 -#> variable rhat ess_bulk ess_tail -#> <chr> <dbl> <dbl> <dbl> -#> 1 mu 1.02 558. 322. -#> 2 tau 1.01 246. 202. -#> 3 theta[1] 1.01 400. 254. -#> 4 theta[2] 1.02 564. 372. -#> 5 theta[3] 1.01 312. 205. -#> 6 theta[4] 1.02 695. 252. -#> 7 theta[5] 1.01 523. 306. -#> 8 theta[6] 1.02 548. 205. -#> 9 theta[7] 1.00 434. 308. -#> 10 theta[8] 1.02 355. 146.
summarise_draws(x, default_mcse_measures()) -
#> # A tibble: 10 x 6 -#> variable mcse_mean mcse_median mcse_sd mcse_q5 mcse_q95 -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mu 0.150 0.319 0.149 0.551 0.415 -#> 2 tau 0.213 0.250 0.156 0.114 0.964 -#> 3 theta[1] 0.319 0.262 0.233 0.820 1.36 -#> 4 theta[2] 0.202 0.213 0.166 0.676 0.848 -#> 5 theta[3] 0.447 0.346 0.329 2.18 0.623 -#> 6 theta[4] 0.189 0.287 0.154 0.956 0.449 -#> 7 theta[5] 0.232 0.139 0.213 1.62 0.736 -#> 8 theta[6] 0.222 0.421 0.195 1.16 0.432 -#> 9 theta[7] 0.250 0.270 0.178 0.458 0.622 -#> 10 theta[8] 0.273 0.372 0.241 0.997 1.29
-# compute variance of variables -summarise_draws(x, var = distributional::variance) -
#> # A tibble: 10 x 17 -#> variable var.1 var.2 var.3 var.4 var.5 var.6 var.7 var.8 var.9 -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mu 12.1 0.652 -0.288 -0.153 0.652 17.5 -0.157 -1.46 -0.288 -#> 2 tau 11.9 -2.40 -0.0611 -0.799 -2.40 13.1 -1.27 -0.304 -0.0611 -#> 3 theta[1] 46.4 0.805 -3.43 0.782 0.805 42.6 -9.72 -1.65 -3.43 -#> 4 theta[2] 27.0 -0.132 0.00865 -1.52 -0.132 26.6 -5.31 -2.10 0.00865 -#> 5 theta[3] 44.9 -8.23 -3.24 -3.66 -8.23 36.2 -2.01 0.194 -3.24 -#> 6 theta[4] 22.8 0.266 -1.42 -1.74 0.266 27.6 -2.15 0.593 -1.42 -#> 7 theta[5] 30.9 0.879 0.840 -4.10 0.879 29.8 2.34 -0.505 0.840 -#> 8 theta[6] 34.8 0.754 -3.73 -3.03 0.754 24.9 0.0602 0.939 -3.73 -#> 9 theta[7] 30.5 2.41 -0.968 -1.16 2.41 34.8 -2.53 -3.50 -0.968 -#> 10 theta[8] 25.7 1.01 -3.63 -1.32 1.01 33.1 0.314 -4.44 -3.63 -#> # ... with 7 more variables: var.10 <dbl>, var.11 <dbl>, var.12 <dbl>, -#> # var.13 <dbl>, var.14 <dbl>, var.15 <dbl>, var.16 <dbl>
-# illustrate use of '.args' -ws <- rexp(ndraws(x)) -summarise_draws(x, weighted.mean, .args = list(w = ws)) -
#> # A tibble: 10 x 2 -#> variable weighted.mean -#> <chr> <dbl> -#> 1 mu 4.14 -#> 2 tau 4.22 -#> 3 theta[1] 7.41 -#> 4 theta[2] 5.03 -#> 5 theta[3] 3.35 -#> 6 theta[4] 4.77 -#> 7 theta[5] 2.87 -#> 8 theta[6] 3.33 -#> 9 theta[7] 6.67 -#> 10 theta[8] 4.73
-
+
+

Examples

+
x <- example_draws("eight_schools")
+class(x)
+#> [1] "draws_array" "draws"       "array"      
+str(x)
+#>  'draws_array' num [1:100, 1:4, 1:10] 2.01 1.46 5.81 6.85 1.81 ...
+#>  - attr(*, "dimnames")=List of 3
+#>   ..$ iteration: chr [1:100] "1" "2" "3" "4" ...
+#>   ..$ chain    : chr [1:4] "1" "2" "3" "4"
+#>   ..$ variable : chr [1:10] "mu" "tau" "theta[1]" "theta[2]" ...
+
+summarise_draws(x)
+#> # A tibble: 10 × 10
+#>    variable  mean median    sd   mad      q5   q95  rhat ess_bulk ess_tail
+#>    <chr>    <dbl>  <dbl> <dbl> <dbl>   <dbl> <dbl> <dbl>    <dbl>    <dbl>
+#>  1 mu        4.18   4.16  3.40  3.57  -0.854  9.39  1.02     558.     322.
+#>  2 tau       4.16   3.07  3.58  2.89   0.309 11.0   1.01     246.     202.
+#>  3 theta[1]  6.75   5.97  6.30  4.87  -1.23  18.9   1.01     400.     254.
+#>  4 theta[2]  5.25   5.13  4.63  4.25  -1.97  12.5   1.02     564.     372.
+#>  5 theta[3]  3.04   3.99  6.80  4.94 -10.3   11.9   1.01     312.     205.
+#>  6 theta[4]  4.86   4.99  4.92  4.51  -3.57  12.2   1.02     695.     252.
+#>  7 theta[5]  3.22   3.72  5.08  4.38  -5.93  10.8   1.01     523.     306.
+#>  8 theta[6]  3.99   4.14  5.16  4.81  -4.32  11.5   1.02     548.     205.
+#>  9 theta[7]  6.50   5.90  5.26  4.54  -1.19  15.4   1.00     434.     308.
+#> 10 theta[8]  4.57   4.64  5.25  4.89  -3.79  12.2   1.02     355.     146.
+summarise_draws(x, "mean", "median")
+#> # A tibble: 10 × 3
+#>    variable  mean median
+#>    <chr>    <dbl>  <dbl>
+#>  1 mu        4.18   4.16
+#>  2 tau       4.16   3.07
+#>  3 theta[1]  6.75   5.97
+#>  4 theta[2]  5.25   5.13
+#>  5 theta[3]  3.04   3.99
+#>  6 theta[4]  4.86   4.99
+#>  7 theta[5]  3.22   3.72
+#>  8 theta[6]  3.99   4.14
+#>  9 theta[7]  6.50   5.90
+#> 10 theta[8]  4.57   4.64
+summarise_draws(x, mean, mcse = mcse_mean)
+#> # A tibble: 10 × 3
+#>    variable  mean  mcse
+#>    <chr>    <dbl> <dbl>
+#>  1 mu        4.18 0.150
+#>  2 tau       4.16 0.213
+#>  3 theta[1]  6.75 0.319
+#>  4 theta[2]  5.25 0.202
+#>  5 theta[3]  3.04 0.447
+#>  6 theta[4]  4.86 0.189
+#>  7 theta[5]  3.22 0.232
+#>  8 theta[6]  3.99 0.222
+#>  9 theta[7]  6.50 0.250
+#> 10 theta[8]  4.57 0.273
+summarise_draws(x, ~quantile(.x, probs = c(0.4, 0.6)))
+#> # A tibble: 10 × 3
+#>    variable `40%` `60%`
+#>    <chr>    <dbl> <dbl>
+#>  1 mu        3.41  5.35
+#>  2 tau       2.47  3.96
+#>  3 theta[1]  4.95  7.01
+#>  4 theta[2]  4.32  6.13
+#>  5 theta[3]  2.54  5.33
+#>  6 theta[4]  3.78  6.11
+#>  7 theta[5]  2.69  4.69
+#>  8 theta[6]  2.92  5.47
+#>  9 theta[7]  4.81  7.33
+#> 10 theta[8]  3.50  5.92
+
+# using default_*_meaures()
+summarise_draws(x, default_summary_measures())
+#> # A tibble: 10 × 7
+#>    variable  mean median    sd   mad      q5   q95
+#>    <chr>    <dbl>  <dbl> <dbl> <dbl>   <dbl> <dbl>
+#>  1 mu        4.18   4.16  3.40  3.57  -0.854  9.39
+#>  2 tau       4.16   3.07  3.58  2.89   0.309 11.0 
+#>  3 theta[1]  6.75   5.97  6.30  4.87  -1.23  18.9 
+#>  4 theta[2]  5.25   5.13  4.63  4.25  -1.97  12.5 
+#>  5 theta[3]  3.04   3.99  6.80  4.94 -10.3   11.9 
+#>  6 theta[4]  4.86   4.99  4.92  4.51  -3.57  12.2 
+#>  7 theta[5]  3.22   3.72  5.08  4.38  -5.93  10.8 
+#>  8 theta[6]  3.99   4.14  5.16  4.81  -4.32  11.5 
+#>  9 theta[7]  6.50   5.90  5.26  4.54  -1.19  15.4 
+#> 10 theta[8]  4.57   4.64  5.25  4.89  -3.79  12.2 
+summarise_draws(x, default_convergence_measures())
+#> # A tibble: 10 × 4
+#>    variable  rhat ess_bulk ess_tail
+#>    <chr>    <dbl>    <dbl>    <dbl>
+#>  1 mu        1.02     558.     322.
+#>  2 tau       1.01     246.     202.
+#>  3 theta[1]  1.01     400.     254.
+#>  4 theta[2]  1.02     564.     372.
+#>  5 theta[3]  1.01     312.     205.
+#>  6 theta[4]  1.02     695.     252.
+#>  7 theta[5]  1.01     523.     306.
+#>  8 theta[6]  1.02     548.     205.
+#>  9 theta[7]  1.00     434.     308.
+#> 10 theta[8]  1.02     355.     146.
+summarise_draws(x, default_mcse_measures())
+#> # A tibble: 10 × 6
+#>    variable mcse_mean mcse_median mcse_sd mcse_q5 mcse_q95
+#>    <chr>        <dbl>       <dbl>   <dbl>   <dbl>    <dbl>
+#>  1 mu           0.150       0.319   0.149   0.551    0.415
+#>  2 tau          0.213       0.250   0.156   0.114    0.964
+#>  3 theta[1]     0.319       0.262   0.233   0.820    1.36 
+#>  4 theta[2]     0.202       0.213   0.166   0.676    0.848
+#>  5 theta[3]     0.447       0.346   0.329   2.18     0.623
+#>  6 theta[4]     0.189       0.287   0.154   0.956    0.449
+#>  7 theta[5]     0.232       0.139   0.213   1.62     0.736
+#>  8 theta[6]     0.222       0.421   0.195   1.16     0.432
+#>  9 theta[7]     0.250       0.270   0.178   0.458    0.622
+#> 10 theta[8]     0.273       0.372   0.241   0.997    1.29 
+
+# compute variance of variables
+summarise_draws(x, var = distributional::variance)
+#> # A tibble: 10 × 2
+#>    variable   var
+#>    <chr>    <dbl>
+#>  1 mu        11.6
+#>  2 tau       12.8
+#>  3 theta[1]  39.7
+#>  4 theta[2]  21.5
+#>  5 theta[3]  46.2
+#>  6 theta[4]  24.2
+#>  7 theta[5]  25.9
+#>  8 theta[6]  26.6
+#>  9 theta[7]  27.7
+#> 10 theta[8]  27.6
+
+# illustrate use of '.args'
+ws <- rexp(ndraws(x))
+summarise_draws(x, weighted.mean, .args = list(w = ws))
+#> # A tibble: 10 × 2
+#>    variable weighted.mean
+#>    <chr>            <dbl>
+#>  1 mu                4.18
+#>  2 tau               4.47
+#>  3 theta[1]          7.15
+#>  4 theta[2]          5.50
+#>  5 theta[3]          2.39
+#>  6 theta[4]          5.07
+#>  7 theta[5]          3.33
+#>  8 theta[6]          3.77
+#>  9 theta[7]          6.87
+#> 10 theta[8]          4.67
+
+
+
+ - - - + + diff --git a/docs/reference/ess_basic.html b/docs/reference/ess_basic.html index 9238dd84..873bd3c0 100644 --- a/docs/reference/ess_basic.html +++ b/docs/reference/ess_basic.html @@ -1,70 +1,17 @@ - - - - - - - -Basic version of the effective sample size — ess_basic • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Basic version of the effective sample size — ess_basic • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+

Compute the basic effective sample size (ESS) estimate for a single variable -as described in Gelman et al. (2013). For practical applications, we strongly +as described in Gelman et al. (2013) with some changes according to Vehtari et +al. (2021). For practical applications, we strongly recommend the improved ESS convergence diagnostics implemented in -ess_bulk() and ess_tail().

+ess_bulk() and ess_tail(). See Vehtari (2021) for an in-depth +comparison of different effective sample size estimators.

-
ess_basic(x, ...)
-
-# S3 method for default
-ess_basic(x, split = TRUE, ...)
-
-# S3 method for rvar
-ess_basic(x, split = TRUE, ...)
+
+
ess_basic(x, ...)
 
-    

Arguments

- - - - - - - - - - - - - - -
x

(multiple options) One of:

...

Arguments passed to individual methods (if applicable).

split

(logical) Should the estimate be computed on split chains? The -default is TRUE.

+# S3 method for default +ess_basic(x, split = TRUE, ...) -

Value

+# S3 method for rvar +ess_basic(x, split = TRUE, ...)
+
+
+

Arguments

+
x
+

(multiple options) One of:

+
...
+

Arguments passed to individual methods (if applicable).

+
split
+

(logical) Should the estimate be computed on split chains? The +default is TRUE.

+
+
+

Value

If the input is an array, returns a single numeric value. If any of the draws is non-finite, that is, NA, NaN, Inf, or -Inf, the returned output will be (numeric) NA. Also, if all draws within any of the chains of a -variable are the same (constant), the returned output will be (numeric) NA -as well. The reason for the latter is that, for constant draws, we cannot +variable are the same (constant), the returned output will be (numeric) NAas well. The reason for the latter is that, for constant draws, we cannot distinguish between variables that are supposed to be constant (e.g., a diagonal element of a correlation matrix is always 1) or variables that just happened to be constant because of a failure of convergence or other problems -in the sampling process.

-

If the input is an rvar, returns an array of the same dimensions as the -rvar, where each element is equal to the value that would be returned by -passing the draws array for that element of the rvar to this function.

-

References

- +in the sampling process. +If the input is an rvar, returns an array of the same dimensions as the +rvar, where each element is equal to the value that would be returned by +passing the draws array for that element of the rvar to this function.

+
+
+

References

Andrew Gelman, John B. Carlin, Hal S. Stern, David B. Dunson, Aki Vehtari and -Donald B. Rubin (2013). Bayesian Data Analysis, Third Edition. Chapman and +Donald B. Rubin (2013). Bayesian Data Analysis, Third Edition. Chapman and Hall/CRC.

-

See also

- -

Other diagnostics: -ess_bulk(), -ess_quantile(), -ess_sd(), -ess_tail(), -mcse_mean(), -mcse_quantile(), -mcse_sd(), -rhat_basic(), -rhat(), -rstar()

+

Aki Vehtari, Andrew Gelman, Daniel Simpson, Bob Carpenter, and +Paul-Christian Bürkner (2021). Rank-normalization, folding, and +localization: An improved R-hat for assessing convergence of +MCMC (with discussion). Bayesian Data Analysis. 16(2), 667-–718. +doi:10.1214/20-BA1221

+

Aki Vehtari (2021). Comparison of MCMC effective sample size estimators. +Retrieved from https://avehtari.github.io/rhat_ess/ess_comparison.html

+
+
+

See also

+

Other diagnostics: +ess_bulk(), +ess_quantile(), +ess_sd(), +ess_tail(), +mcse_mean(), +mcse_quantile(), +mcse_sd(), +rhat_basic(), +rhat(), +rstar()

+
-

Examples

-
mu <- extract_variable_matrix(example_draws(), "mu") -ess_basic(mu) -
#> [1] 511.5225
-d <- as_draws_rvars(example_draws("multi_normal")) -ess_basic(d$Sigma) -
#> [,1] [,2] [,3] -#> [1,] 680.2791 446.2236 481.9080 -#> [2,] 446.2236 522.0755 418.0690 -#> [3,] 481.9080 418.0690 636.2592
-
+
+

Examples

+
mu <- extract_variable_matrix(example_draws(), "mu")
+ess_basic(mu)
+#> [1] 511.5225
+
+d <- as_draws_rvars(example_draws("multi_normal"))
+ess_basic(d$Sigma)
+#>          [,1]     [,2]     [,3]
+#> [1,] 680.2791 446.2236 481.9080
+#> [2,] 446.2236 522.0755 418.0690
+#> [3,] 481.9080 418.0690 636.2592
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/ess_bulk.html b/docs/reference/ess_bulk.html index b55b23ca..488b5cb4 100644 --- a/docs/reference/ess_bulk.html +++ b/docs/reference/ess_bulk.html @@ -1,71 +1,17 @@ - - - - - - - -Bulk effective sample size (bulk-ESS) — ess_bulk • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Bulk effective sample size (bulk-ESS) — ess_bulk • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
@@ -176,104 +113,105 @@

Bulk effective sample size (bulk-ESS)

variable. Bulk-ESS is useful as a diagnostic for the sampling efficiency in the bulk of the posterior. It is defined as the effective sample size for rank normalized values using split chains. For the tail effective sample size -see ess_tail().

+see ess_tail(). See Vehtari (2021) for an in-depth +comparison of different effective sample size estimators.

-
ess_bulk(x, ...)
-
-# S3 method for default
-ess_bulk(x, ...)
-
-# S3 method for rvar
-ess_bulk(x, ...)
+
+
ess_bulk(x, ...)
 
-    

Arguments

- - - - - - - - - - -
x

(multiple options) One of:

...

Arguments passed to individual methods (if applicable).

+# S3 method for default +ess_bulk(x, ...) -

Value

+# S3 method for rvar +ess_bulk(x, ...)
+
+
+

Arguments

+
x
+

(multiple options) One of:

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

If the input is an array, returns a single numeric value. If any of the draws is non-finite, that is, NA, NaN, Inf, or -Inf, the returned output will be (numeric) NA. Also, if all draws within any of the chains of a -variable are the same (constant), the returned output will be (numeric) NA -as well. The reason for the latter is that, for constant draws, we cannot +variable are the same (constant), the returned output will be (numeric) NAas well. The reason for the latter is that, for constant draws, we cannot distinguish between variables that are supposed to be constant (e.g., a diagonal element of a correlation matrix is always 1) or variables that just happened to be constant because of a failure of convergence or other problems -in the sampling process.

-

If the input is an rvar, returns an array of the same dimensions as the -rvar, where each element is equal to the value that would be returned by -passing the draws array for that element of the rvar to this function.

-

References

- +in the sampling process. +If the input is an rvar, returns an array of the same dimensions as the +rvar, where each element is equal to the value that would be returned by +passing the draws array for that element of the rvar to this function.

+
+
+

References

Aki Vehtari, Andrew Gelman, Daniel Simpson, Bob Carpenter, and -Paul-Christian Bürkner (2019). Rank-normalization, folding, and +Paul-Christian Bürkner (2021). Rank-normalization, folding, and localization: An improved R-hat for assessing convergence of -MCMC. arXiv preprint arXiv:1903.08008.

-

See also

- -

Other diagnostics: -ess_basic(), -ess_quantile(), -ess_sd(), -ess_tail(), -mcse_mean(), -mcse_quantile(), -mcse_sd(), -rhat_basic(), -rhat(), -rstar()

+MCMC (with discussion). Bayesian Data Analysis. 16(2), 667-–718. +doi:10.1214/20-BA1221

+

Aki Vehtari (2021). Comparison of MCMC effective sample size estimators. +Retrieved from https://avehtari.github.io/rhat_ess/ess_comparison.html

+
+
+

See also

+

Other diagnostics: +ess_basic(), +ess_quantile(), +ess_sd(), +ess_tail(), +mcse_mean(), +mcse_quantile(), +mcse_sd(), +rhat_basic(), +rhat(), +rstar()

+
-

Examples

-
mu <- extract_variable_matrix(example_draws(), "mu") -ess_bulk(mu) -
#> [1] 558.0173
-d <- as_draws_rvars(example_draws("multi_normal")) -ess_bulk(d$Sigma) -
#> [,1] [,2] [,3] -#> [1,] 742.2907 454.0657 468.3890 -#> [2,] 454.0657 528.7972 434.1141 -#> [3,] 468.3890 434.1141 728.9440
-
+
+

Examples

+
mu <- extract_variable_matrix(example_draws(), "mu")
+ess_bulk(mu)
+#> [1] 558.0173
+
+d <- as_draws_rvars(example_draws("multi_normal"))
+ess_bulk(d$Sigma)
+#>          [,1]     [,2]     [,3]
+#> [1,] 742.2907 454.0657 468.3890
+#> [2,] 454.0657 528.7972 434.1141
+#> [3,] 468.3890 434.1141 728.9440
+
+
+
+
- - - + + diff --git a/docs/reference/ess_mean.html b/docs/reference/ess_mean.html index 19c178fe..ad38f4f0 100644 --- a/docs/reference/ess_mean.html +++ b/docs/reference/ess_mean.html @@ -1,68 +1,13 @@ - - - - - - - -Effective sample size for the mean — ess_mean • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Effective sample size for the mean — ess_mean • posterior - - + + - - -
-
- -
- -
+
@@ -173,84 +109,80 @@

Effective sample size for the mean

estimate of a single variable.

-
ess_mean(x, ...)
-
-# S3 method for rvar
-ess_mean(x, ...)
+
+
ess_mean(x, ...)
 
-    

Arguments

- - - - - - - - - - -
x

(multiple options) One of:

...

Arguments passed to individual methods (if applicable).

- -

Value

+# S3 method for rvar +ess_mean(x, ...)
+
+
+

Arguments

+
x
+

(multiple options) One of:

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

If the input is an array, returns a single numeric value. If any of the draws is non-finite, that is, NA, NaN, Inf, or -Inf, the returned output will be (numeric) NA. Also, if all draws within any of the chains of a -variable are the same (constant), the returned output will be (numeric) NA -as well. The reason for the latter is that, for constant draws, we cannot +variable are the same (constant), the returned output will be (numeric) NAas well. The reason for the latter is that, for constant draws, we cannot distinguish between variables that are supposed to be constant (e.g., a diagonal element of a correlation matrix is always 1) or variables that just happened to be constant because of a failure of convergence or other problems -in the sampling process.

-

If the input is an rvar, returns an array of the same dimensions as the -rvar, where each element is equal to the value that would be returned by -passing the draws array for that element of the rvar to this function.

-

References

- +in the sampling process. +If the input is an rvar, returns an array of the same dimensions as the +rvar, where each element is equal to the value that would be returned by +passing the draws array for that element of the rvar to this function.

+
+
+

References

Andrew Gelman, John B. Carlin, Hal S. Stern, David B. Dunson, Aki Vehtari and -Donald B. Rubin (2013). Bayesian Data Analysis, Third Edition. Chapman and +Donald B. Rubin (2013). Bayesian Data Analysis, Third Edition. Chapman and Hall/CRC.

+
-

Examples

-
mu <- extract_variable_matrix(example_draws(), "mu") -ess_mean(mu) -
#> [1] 511.5225
-d <- as_draws_rvars(example_draws("multi_normal")) -ess_mean(d$Sigma) -
#> [,1] [,2] [,3] -#> [1,] 680.2791 446.2236 481.9080 -#> [2,] 446.2236 522.0755 418.0690 -#> [3,] 481.9080 418.0690 636.2592
-
+
+

Examples

+
mu <- extract_variable_matrix(example_draws(), "mu")
+ess_mean(mu)
+#> [1] 511.5225
+
+d <- as_draws_rvars(example_draws("multi_normal"))
+ess_mean(d$Sigma)
+#>          [,1]     [,2]     [,3]
+#> [1,] 680.2791 446.2236 481.9080
+#> [2,] 446.2236 522.0755 418.0690
+#> [3,] 481.9080 418.0690 636.2592
+
+
+
+
- - - + + diff --git a/docs/reference/ess_quantile.html b/docs/reference/ess_quantile.html index 65e5e0c6..a3737bcb 100644 --- a/docs/reference/ess_quantile.html +++ b/docs/reference/ess_quantile.html @@ -1,68 +1,13 @@ - - - - - - - -Effective sample sizes for quantiles — ess_quantile • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Effective sample sizes for quantiles — ess_quantile • posterior + + - - - - -
-
- -
- -
+
@@ -173,120 +109,114 @@

Effective sample sizes for quantiles

variable.

-
ess_quantile(x, probs = c(0.05, 0.95), ...)
+    
+
ess_quantile(x, probs = c(0.05, 0.95), ...)
 
-# S3 method for default
-ess_quantile(x, probs = c(0.05, 0.95), names = TRUE, ...)
+# S3 method for default
+ess_quantile(x, probs = c(0.05, 0.95), names = TRUE, ...)
 
-# S3 method for rvar
-ess_quantile(x, probs = c(0.05, 0.95), names = TRUE, ...)
+# S3 method for rvar
+ess_quantile(x, probs = c(0.05, 0.95), names = TRUE, ...)
 
-ess_median(x, ...)
+ess_median(x, ...)
 
-# S3 method for default
-ess_mean(x, ...)
+# S3 method for default +ess_mean(x, ...)
+
-

Arguments

- - - - - - - - - - - - - - - - - - -
x

(multiple options) One of:

probs

(numeric vector) Probabilities in [0, 1].

...

Arguments passed to individual methods (if applicable).

names

(logical) Should the result have a names attribute? The +

+

Arguments

+
x
+

(multiple options) One of:

+
probs
+

(numeric vector) Probabilities in [0, 1].

+
...
+

Arguments passed to individual methods (if applicable).

+
names
+

(logical) Should the result have a names attribute? The default is TRUE, but use FALSE for improved speed if there are many -values in probs.

- -

Value

- +values in probs.

+
+
+

Value

If the input is an array, returns a numeric vector with one element per quantile. If any of the draws is non-finite, that is, NA, NaN, Inf, or -Inf, the returned output will be a vector of (numeric) NA values. Also, if all draws of a variable are -the same (constant), the returned output will be a vector of (numeric) NA -values as well. The reason for the latter is that, for constant draws, we +the same (constant), the returned output will be a vector of (numeric) NAvalues as well. The reason for the latter is that, for constant draws, we cannot distinguish between variables that are supposed to be constant (e.g., a diagonal element of a correlation matrix is always 1) or variables that just happened to be constant because of a failure of convergence or other -problems in the sampling process.

-

If the input is an rvar and length(probs) == 1, returns an array of the -same dimensions as the rvar, where each element is equal to the value +problems in the sampling process. +If the input is an rvar and length(probs) == 1, returns an array of the +same dimensions as the rvar, where each element is equal to the value that would be returned by passing the draws array for that element of the -rvar to this function. If length(probs) > 1, the first dimension of the +rvar to this function. If length(probs) > 1, the first dimension of the result indexes the input probabilities; i.e. the result has dimension -c(length(probs), dim(x)).

-

References

- +c(length(probs), dim(x)).

+
+
+

References

Aki Vehtari, Andrew Gelman, Daniel Simpson, Bob Carpenter, and -Paul-Christian Bürkner (2019). Rank-normalization, folding, and +Paul-Christian Bürkner (2021). Rank-normalization, folding, and localization: An improved R-hat for assessing convergence of -MCMC. arXiv preprint arXiv:1903.08008.

-

See also

- -

Other diagnostics: -ess_basic(), -ess_bulk(), -ess_sd(), -ess_tail(), -mcse_mean(), -mcse_quantile(), -mcse_sd(), -rhat_basic(), -rhat(), -rstar()

+MCMC (with discussion). Bayesian Data Analysis. 16(2), 667-–718. +doi:10.1214/20-BA1221

+
+
+

See also

+

Other diagnostics: +ess_basic(), +ess_bulk(), +ess_sd(), +ess_tail(), +mcse_mean(), +mcse_quantile(), +mcse_sd(), +rhat_basic(), +rhat(), +rstar()

+
-

Examples

-
mu <- extract_variable_matrix(example_draws(), "mu") -ess_quantile(mu, probs = c(0.1, 0.9)) -
#> ess_q10 ess_q90 -#> 300.6674 325.0324
-d <- as_draws_rvars(example_draws("multi_normal")) -ess_quantile(d$mu, probs = c(0.1, 0.9)) -
#> [,1] [,2] [,3] -#> ess_q10 383.4835 468.2163 340.6056 -#> ess_q90 389.0418 419.6722 271.5482
-
+
+

Examples

+
mu <- extract_variable_matrix(example_draws(), "mu")
+ess_quantile(mu, probs = c(0.1, 0.9))
+#>  ess_q10  ess_q90 
+#> 300.6674 325.0324 
+
+d <- as_draws_rvars(example_draws("multi_normal"))
+ess_quantile(d$mu, probs = c(0.1, 0.9))
+#>             [,1]     [,2]     [,3]
+#> ess_q10 383.4835 468.2163 340.6056
+#> ess_q90 389.0418 419.6722 271.5482
+
+
+
+ - - - + + diff --git a/docs/reference/ess_sd.html b/docs/reference/ess_sd.html index 0311940c..05d0890a 100644 --- a/docs/reference/ess_sd.html +++ b/docs/reference/ess_sd.html @@ -1,70 +1,15 @@ - - - - - - - -Effective sample size for the standard deviation — ess_sd • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Effective sample size for the standard deviation — ess_sd • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
@@ -177,101 +113,99 @@

Effective sample size for the standard deviation

for the mean of the squared value.

-
ess_sd(x, ...)
-
-# S3 method for default
-ess_sd(x, ...)
-
-# S3 method for rvar
-ess_sd(x, ...)
+
+
ess_sd(x, ...)
 
-    

Arguments

- - - - - - - - - - -
x

(multiple options) One of:

...

Arguments passed to individual methods (if applicable).

+# S3 method for default +ess_sd(x, ...) -

Value

+# S3 method for rvar +ess_sd(x, ...)
+
+
+

Arguments

+
x
+

(multiple options) One of:

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

If the input is an array, returns a single numeric value. If any of the draws is non-finite, that is, NA, NaN, Inf, or -Inf, the returned output will be (numeric) NA. Also, if all draws within any of the chains of a -variable are the same (constant), the returned output will be (numeric) NA -as well. The reason for the latter is that, for constant draws, we cannot +variable are the same (constant), the returned output will be (numeric) NAas well. The reason for the latter is that, for constant draws, we cannot distinguish between variables that are supposed to be constant (e.g., a diagonal element of a correlation matrix is always 1) or variables that just happened to be constant because of a failure of convergence or other problems -in the sampling process.

-

If the input is an rvar, returns an array of the same dimensions as the -rvar, where each element is equal to the value that would be returned by -passing the draws array for that element of the rvar to this function.

-

References

- +in the sampling process. +If the input is an rvar, returns an array of the same dimensions as the +rvar, where each element is equal to the value that would be returned by +passing the draws array for that element of the rvar to this function.

+
+
+

References

Aki Vehtari, Andrew Gelman, Daniel Simpson, Bob Carpenter, and -Paul-Christian Bürkner (2019). Rank-normalization, folding, and +Paul-Christian Bürkner (2021). Rank-normalization, folding, and localization: An improved R-hat for assessing convergence of -MCMC. arXiv preprint arXiv:1903.08008.

-

See also

- -

Other diagnostics: -ess_basic(), -ess_bulk(), -ess_quantile(), -ess_tail(), -mcse_mean(), -mcse_quantile(), -mcse_sd(), -rhat_basic(), -rhat(), -rstar()

+MCMC (with discussion). Bayesian Data Analysis. 16(2), 667-–718. +doi:10.1214/20-BA1221

+
+
+

See also

+

Other diagnostics: +ess_basic(), +ess_bulk(), +ess_quantile(), +ess_tail(), +mcse_mean(), +mcse_quantile(), +mcse_sd(), +rhat_basic(), +rhat(), +rstar()

+
-

Examples

-
mu <- extract_variable_matrix(example_draws(), "mu") -ess_sd(mu) -
#> [1] 259.8527
-d <- as_draws_rvars(example_draws("multi_normal")) -ess_sd(d$Sigma) -
#> [,1] [,2] [,3] -#> [1,] 623.0794 382.0790 430.0359 -#> [2,] 382.0790 512.1350 381.7729 -#> [3,] 430.0359 381.7729 591.6446
-
+
+

Examples

+
mu <- extract_variable_matrix(example_draws(), "mu")
+ess_sd(mu)
+#> [1] 259.8527
+
+d <- as_draws_rvars(example_draws("multi_normal"))
+ess_sd(d$Sigma)
+#>          [,1]     [,2]     [,3]
+#> [1,] 623.0794 382.0790 430.0359
+#> [2,] 382.0790 512.1350 381.7729
+#> [3,] 430.0359 381.7729 591.6446
+
+
+
+
- - - + + diff --git a/docs/reference/ess_tail.html b/docs/reference/ess_tail.html index 4ba55da9..74e8d000 100644 --- a/docs/reference/ess_tail.html +++ b/docs/reference/ess_tail.html @@ -1,71 +1,17 @@ - - - - - - - -Tail effective sample size (tail-ESS) — ess_tail • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Tail effective sample size (tail-ESS) — ess_tail • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
@@ -176,104 +113,105 @@

Tail effective sample size (tail-ESS)

variable. Tail-ESS is useful as a diagnostic for the sampling efficiency in the tails of the posterior. It is defined as the minimum of the effective sample sizes for 5% and 95% quantiles. For the bulk effective sample -size see ess_bulk().

+size see ess_bulk(). See Vehtari (2021) for an in-depth +comparison of different effective sample size estimators.

-
ess_tail(x, ...)
-
-# S3 method for default
-ess_tail(x, ...)
-
-# S3 method for rvar
-ess_tail(x, ...)
+
+
ess_tail(x, ...)
 
-    

Arguments

- - - - - - - - - - -
x

(multiple options) One of:

...

Arguments passed to individual methods (if applicable).

+# S3 method for default +ess_tail(x, ...) -

Value

+# S3 method for rvar +ess_tail(x, ...)
+
+
+

Arguments

+
x
+

(multiple options) One of:

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

If the input is an array, returns a single numeric value. If any of the draws is non-finite, that is, NA, NaN, Inf, or -Inf, the returned output will be (numeric) NA. Also, if all draws within any of the chains of a -variable are the same (constant), the returned output will be (numeric) NA -as well. The reason for the latter is that, for constant draws, we cannot +variable are the same (constant), the returned output will be (numeric) NAas well. The reason for the latter is that, for constant draws, we cannot distinguish between variables that are supposed to be constant (e.g., a diagonal element of a correlation matrix is always 1) or variables that just happened to be constant because of a failure of convergence or other problems -in the sampling process.

-

If the input is an rvar, returns an array of the same dimensions as the -rvar, where each element is equal to the value that would be returned by -passing the draws array for that element of the rvar to this function.

-

References

- +in the sampling process. +If the input is an rvar, returns an array of the same dimensions as the +rvar, where each element is equal to the value that would be returned by +passing the draws array for that element of the rvar to this function.

+
+
+

References

Aki Vehtari, Andrew Gelman, Daniel Simpson, Bob Carpenter, and -Paul-Christian Bürkner (2019). Rank-normalization, folding, and +Paul-Christian Bürkner (2021). Rank-normalization, folding, and localization: An improved R-hat for assessing convergence of -MCMC. arXiv preprint arXiv:1903.08008.

-

See also

- -

Other diagnostics: -ess_basic(), -ess_bulk(), -ess_quantile(), -ess_sd(), -mcse_mean(), -mcse_quantile(), -mcse_sd(), -rhat_basic(), -rhat(), -rstar()

+MCMC (with discussion). Bayesian Data Analysis. 16(2), 667-–718. +doi:10.1214/20-BA1221

+

Aki Vehtari (2021). Comparison of MCMC effective sample size estimators. +Retrieved from https://avehtari.github.io/rhat_ess/ess_comparison.html

+
+
+

See also

+

Other diagnostics: +ess_basic(), +ess_bulk(), +ess_quantile(), +ess_sd(), +mcse_mean(), +mcse_quantile(), +mcse_sd(), +rhat_basic(), +rhat(), +rstar()

+
-

Examples

-
mu <- extract_variable_matrix(example_draws(), "mu") -ess_tail(mu) -
#> [1] 322.0955
-d <- as_draws_rvars(example_draws("multi_normal")) -ess_tail(d$Sigma) -
#> [,1] [,2] [,3] -#> [1,] 369.3083 238.6147 307.7817 -#> [2,] 238.6147 363.2964 356.7673 -#> [3,] 307.7817 356.7673 324.4500
-
+
+

Examples

+
mu <- extract_variable_matrix(example_draws(), "mu")
+ess_tail(mu)
+#> [1] 322.0955
+
+d <- as_draws_rvars(example_draws("multi_normal"))
+ess_tail(d$Sigma)
+#>          [,1]     [,2]     [,3]
+#> [1,] 369.3083 238.6147 307.7817
+#> [2,] 238.6147 363.2964 356.7673
+#> [3,] 307.7817 356.7673 324.4500
+
+
+
+
- - - + + diff --git a/docs/reference/example_draws.html b/docs/reference/example_draws.html index 6131d777..318f7df1 100644 --- a/docs/reference/example_draws.html +++ b/docs/reference/example_draws.html @@ -1,67 +1,12 @@ - - - - - - - -Example draws objects — example_draws • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Example draws objects — example_draws • posterior - + + - - - -
-
- -
- -
+
@@ -171,110 +107,106 @@

Example draws objects

Objects for use in examples, vignettes, and tests.

-
example_draws(example = "eight_schools")
- -

Arguments

- - - - - - -
example

(string) The name of the example draws object. See -Details for available options.

- -

Value

+
+
example_draws(example = "eight_schools")
+
+
+

Arguments

+
example
+

(string) The name of the example draws object. See +Details for available options.

+
+
+

Value

A draws object.

-

Details

- +
+
+

Details

The following example draws objects are available.

-

eight_schools: A draws_array object with 100 iterations +

eight_schools: A draws_array object with 100 iterations from each of 4 Markov chains obtained by fitting the eight schools model -described in Gelman et al. (2013) with Stan. The -variables are:

    -
  • mu: Overall mean of the eight schools

  • +described in Gelman et al. (2013) with Stan. The +variables are:

    • mu: Overall mean of the eight schools

    • tau: Standard deviation between schools

    • theta: Individual means of each of the eight schools

    • -
    - -

    multi_normal: A draws_array object with 100 iterations from each of +

multi_normal: A draws_array object with 100 iterations from each of the 4 Markov chains obtained by fitting a 3-dimensional multivariate normal -model to 100 simulated observations. The variables are:

    -
  • mu: Mean parameter vector of length 3

  • +model to 100 simulated observations. The variables are:

    • mu: Mean parameter vector of length 3

    • Sigma: Covariance matrix of dimension 3 x 3

    • -
    - -

    Note

    - +
+
+

Note

These objects are only intended to be used in demonstrations and tests. They contain fewer iterations and chains than recommended for performing actual inference.

-

References

- +
+
+

References

Andrew Gelman, John B. Carlin, Hal S. Stern, David B. Dunson, Aki Vehtari and Donald B. Rubin (2013). Bayesian Data Analysis, Third Edition. Chapman and Hall/CRC.

+
-

Examples

-
draws_eight_schools <- example_draws("eight_schools") -summarise_draws(draws_eight_schools) -
#> # A tibble: 10 x 10 -#> variable mean median sd mad q5 q95 rhat ess_bulk ess_tail -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mu 4.18 4.16 3.40 3.57 -0.854 9.39 1.02 558. 322. -#> 2 tau 4.16 3.07 3.58 2.89 0.309 11.0 1.01 246. 202. -#> 3 theta[1] 6.75 5.97 6.30 4.87 -1.23 18.9 1.01 400. 254. -#> 4 theta[2] 5.25 5.13 4.63 4.25 -1.97 12.5 1.02 564. 372. -#> 5 theta[3] 3.04 3.99 6.80 4.94 -10.3 11.9 1.01 312. 205. -#> 6 theta[4] 4.86 4.99 4.92 4.51 -3.57 12.2 1.02 695. 252. -#> 7 theta[5] 3.22 3.72 5.08 4.38 -5.93 10.8 1.01 523. 306. -#> 8 theta[6] 3.99 4.14 5.16 4.81 -4.32 11.5 1.02 548. 205. -#> 9 theta[7] 6.50 5.90 5.26 4.54 -1.19 15.4 1.00 434. 308. -#> 10 theta[8] 4.57 4.64 5.25 4.89 -3.79 12.2 1.02 355. 146.
-draws_multi_normal <- example_draws("multi_normal") -summarise_draws(draws_multi_normal) -
#> # A tibble: 12 x 10 -#> variable mean median sd mad q5 q95 rhat ess_bulk ess_tail -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mu[1] 0.0514 0.0575 0.112 0.131 -0.130 0.225 1.01 677. 356. -#> 2 mu[2] 0.111 0.104 0.199 0.198 -0.208 0.449 1.00 566. 426. -#> 3 mu[3] 0.186 0.184 0.314 0.315 -0.322 0.715 1.02 650. 334. -#> 4 Sigma[1,1] 1.28 1.26 0.165 0.173 1.03 1.56 1.00 742. 369. -#> 5 Sigma[2,1] 0.525 0.502 0.200 0.173 0.227 0.874 1.01 454. 239. -#> 6 Sigma[3,1] -0.403 -0.393 0.282 0.267 -0.874 0.0432 1.01 468. 308. -#> 7 Sigma[1,2] 0.525 0.502 0.200 0.173 0.227 0.874 1.01 454. 239. -#> 8 Sigma[2,2] 3.67 3.62 0.447 0.433 3.02 4.40 1.01 529. 363. -#> 9 Sigma[3,2] -2.10 -2.11 0.480 0.469 -2.87 -1.39 1.02 434. 357. -#> 10 Sigma[1,3] -0.403 -0.393 0.282 0.267 -0.874 0.0432 1.01 468. 308. -#> 11 Sigma[2,3] -2.10 -2.11 0.480 0.469 -2.87 -1.39 1.02 434. 357. -#> 12 Sigma[3,3] 8.12 8.02 0.946 0.941 6.71 9.91 0.997 729. 324.
-
+
+

Examples

+
draws_eight_schools <- example_draws("eight_schools")
+summarise_draws(draws_eight_schools)
+#> # A tibble: 10 × 10
+#>    variable  mean median    sd   mad      q5   q95  rhat ess_bulk ess_tail
+#>    <chr>    <dbl>  <dbl> <dbl> <dbl>   <dbl> <dbl> <dbl>    <dbl>    <dbl>
+#>  1 mu        4.18   4.16  3.40  3.57  -0.854  9.39  1.02     558.     322.
+#>  2 tau       4.16   3.07  3.58  2.89   0.309 11.0   1.01     246.     202.
+#>  3 theta[1]  6.75   5.97  6.30  4.87  -1.23  18.9   1.01     400.     254.
+#>  4 theta[2]  5.25   5.13  4.63  4.25  -1.97  12.5   1.02     564.     372.
+#>  5 theta[3]  3.04   3.99  6.80  4.94 -10.3   11.9   1.01     312.     205.
+#>  6 theta[4]  4.86   4.99  4.92  4.51  -3.57  12.2   1.02     695.     252.
+#>  7 theta[5]  3.22   3.72  5.08  4.38  -5.93  10.8   1.01     523.     306.
+#>  8 theta[6]  3.99   4.14  5.16  4.81  -4.32  11.5   1.02     548.     205.
+#>  9 theta[7]  6.50   5.90  5.26  4.54  -1.19  15.4   1.00     434.     308.
+#> 10 theta[8]  4.57   4.64  5.25  4.89  -3.79  12.2   1.02     355.     146.
+
+draws_multi_normal <- example_draws("multi_normal")
+summarise_draws(draws_multi_normal)
+#> # A tibble: 12 × 10
+#>    variable      mean  median    sd   mad     q5     q95  rhat ess_bulk ess_tail
+#>    <chr>        <dbl>   <dbl> <dbl> <dbl>  <dbl>   <dbl> <dbl>    <dbl>    <dbl>
+#>  1 mu[1]       0.0514  0.0575 0.112 0.131 -0.130  0.225  1.01      677.     356.
+#>  2 mu[2]       0.111   0.104  0.199 0.198 -0.208  0.449  1.00      566.     426.
+#>  3 mu[3]       0.186   0.184  0.314 0.315 -0.322  0.715  1.02      650.     334.
+#>  4 Sigma[1,1]  1.28    1.26   0.165 0.173  1.03   1.56   1.00      742.     369.
+#>  5 Sigma[2,1]  0.525   0.502  0.200 0.173  0.227  0.874  1.01      454.     239.
+#>  6 Sigma[3,1] -0.403  -0.393  0.282 0.267 -0.874  0.0432 1.01      468.     308.
+#>  7 Sigma[1,2]  0.525   0.502  0.200 0.173  0.227  0.874  1.01      454.     239.
+#>  8 Sigma[2,2]  3.67    3.62   0.447 0.433  3.02   4.40   1.01      529.     363.
+#>  9 Sigma[3,2] -2.10   -2.11   0.480 0.469 -2.87  -1.39   1.02      434.     357.
+#> 10 Sigma[1,3] -0.403  -0.393  0.282 0.267 -0.874  0.0432 1.01      468.     308.
+#> 11 Sigma[2,3] -2.10   -2.11   0.480 0.469 -2.87  -1.39   1.02      434.     357.
+#> 12 Sigma[3,3]  8.12    8.02   0.946 0.941  6.71   9.91   0.997     729.     324.
+
+
+
+
- - - + + diff --git a/docs/reference/extract_variable.html b/docs/reference/extract_variable.html index 2cacf4c2..62b5be31 100644 --- a/docs/reference/extract_variable.html +++ b/docs/reference/extract_variable.html @@ -1,67 +1,12 @@ - - - - - - - -Extract draws of a single variable — extract_variable • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Extract draws of a single variable — extract_variable • posterior - - - - + + -
-
- -
- -
+
@@ -171,70 +107,64 @@

Extract draws of a single variable

Extract a vector of draws of a single variable.

-
extract_variable(x, variable, ...)
-
-# S3 method for default
-extract_variable(x, variable, ...)
-
-# S3 method for draws
-extract_variable(x, variable, ...)
-
-# S3 method for draws_rvars
-extract_variable(x, variable, ...)
- -

Arguments

- - - - - - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

variable

(string) The name of the variable to extract.

...

Arguments passed to individual methods (if applicable).

- -

Value

+
+
extract_variable(x, variable, ...)
 
+# S3 method for default
+extract_variable(x, variable, ...)
+
+# S3 method for draws
+extract_variable(x, variable, ...)
+
+# S3 method for draws_rvars
+extract_variable(x, variable, ...)
+
+ +
+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
variable
+

(string) The name of the variable to extract.

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

A numeric vector of length equal to the number of draws.

+
-

Examples

-
x <- example_draws() -mu <- extract_variable(x, variable = "mu") -str(mu) -
#> num [1:400] 2.01 1.46 5.81 6.85 1.81 ...
-
+
+

Examples

+
x <- example_draws()
+mu <- extract_variable(x, variable = "mu")
+str(mu)
+#>  num [1:400] 2.01 1.46 5.81 6.85 1.81 ...
+
+
+
+
- - - + + diff --git a/docs/reference/extract_variable_matrix.html b/docs/reference/extract_variable_matrix.html index d67820b3..322ccbf5 100644 --- a/docs/reference/extract_variable_matrix.html +++ b/docs/reference/extract_variable_matrix.html @@ -1,68 +1,13 @@ - - - - - - - -Extract matrix of a single variable — extract_variable_matrix • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Extract matrix of a single variable — extract_variable_matrix • posterior - - - - + + -
-
- -
- -
+

Extract an iterations x chains matrix of draws of a single variable. -This is primarily used for convergence diagnostic functions such as rhat().

+This is primarily used for convergence diagnostic functions such as rhat().

-
extract_variable_matrix(x, variable, ...)
-
-# S3 method for default
-extract_variable_matrix(x, variable, ...)
-
-# S3 method for draws
-extract_variable_matrix(x, variable, ...)
-
-# S3 method for draws_rvars
-extract_variable_matrix(x, variable, ...)
- -

Arguments

- - - - - - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

variable

(string) The name of the variable to extract.

...

Arguments passed to individual methods (if applicable).

- -

Value

+
+
extract_variable_matrix(x, variable, ...)
 
+# S3 method for default
+extract_variable_matrix(x, variable, ...)
+
+# S3 method for draws
+extract_variable_matrix(x, variable, ...)
+
+# S3 method for draws_rvars
+extract_variable_matrix(x, variable, ...)
+
+ +
+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
variable
+

(string) The name of the variable to extract.

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

A matrix with dimension iterations x chains.

+
-

Examples

-
x <- example_draws() -mu <- extract_variable_matrix(x, variable = "mu") -dim(mu) -
#> [1] 100 4
rhat(mu) -
#> [1] 1.021923
-
+
+

Examples

+
x <- example_draws()
+mu <- extract_variable_matrix(x, variable = "mu")
+dim(mu)
+#> [1] 100   4
+rhat(mu)
+#> [1] 1.021923
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 639df284..c264ebe4 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,66 +1,12 @@ - - - - - - - -Function reference • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Function reference • posterior + + - - - - -
-
- -
- -
+
- - - - - - - - - - -
-

Overview

-

Pacakge overview and global options

+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+

Overview

+

Pacakge overview and global options

+

posterior-package

Tools for working with posterior (and prior) distributions

-

Draws objects and formats

-

Createdraws objects and convert between supported formats

+
+

Draws objects and formats

+

Createdraws objects and convert between supported formats

+

as_draws() is_draws()

Transform to draws objects

+

as_draws_array() draws_array() is_draws_array()

The draws_array format

+

as_draws_df() draws_df() is_draws_df()

The draws_df format

+

as_draws_list() draws_list() is_draws_list()

The draws_list format

+

as_draws_matrix() draws_matrix() is_draws_matrix()

The draws_matrix format

+

as_draws_rvars() draws_rvars() is_draws_rvars()

The draws_rvars format

+

print(<draws_array>)

Print draws_array objects

+

print(<draws_df>)

Print draws_df objects

+

print(<draws_list>)

Print draws_list objects

+

print(<draws_matrix>)

Print draws_matrix objects

+

print(<draws_rvars>)

Print draws_rvars objects

+

print(<rvar>) format(<rvar>) str(<rvar>)

Print or format a random variable

+

variables() `variables<-`() iteration_ids() chain_ids() draw_ids() nvariables() niterations() nchains() ndraws()

Index draws objects

+

example_draws()

Example draws objects

-

Working with draws objects

-

Functions for modifying draws objects and extracting their contents

+
+

Working with draws objects

+

Functions for modifying draws objects and extracting their contents

+

bind_draws()

Bind draws objects together

+

extract_variable()

Extract draws of a single variable

+

extract_variable_matrix()

Extract matrix of a single variable

+

merge_chains()

Merge chains of draws objects

+

mutate_variables()

Mutate variables in draws objects

+

order_draws()

Order draws objects

+

split_chains()

Split Chains

+

subset_draws() subset(<draws>)

Subset draws objects

+

rename_variables()

Rename variables in draws objects

+

repair_draws()

Repair indices of draws objects

+

resample_draws()

Resample draws objects

+

thin_draws()

Thin draws objects

+

weight_draws()

Weight draws objects

+

weights(<draws>)

Extract Weights from Draws Objects

-

Summarizing and diagnosing draws objects

-

Compute summary statistics and convergence diagnostics

+
+

Summarizing and diagnosing draws objects

+

Compute summary statistics and convergence diagnostics

+

summarise_draws() summarize_draws() summary(<draws>) summary(<rvar>) default_summary_measures() default_convergence_measures() default_mcse_measures()

Summaries of draws objects

+

diagnostics

List of available convergence diagnostics

+

ess_basic()

Basic version of the effective sample size

+

ess_bulk()

Bulk effective sample size (bulk-ESS)

+

ess_mean()

Effective sample size for the mean

+

ess_quantile() ess_median() ess_mean(<default>)

Effective sample sizes for quantiles

+

ess_sd()

Effective sample size for the standard deviation

+

ess_tail()

Tail effective sample size (tail-ESS)

+

rhat()

Rhat convergence diagnostic

+

rhat_basic()

Basic version of the Rhat convergence diagnostic

+

mcse_mean()

Monte Carlo standard error for the mean

+

mcse_quantile() mcse_median()

Monte Carlo standard error for quantiles

+

mcse_sd()

Monte Carlo standard error for the standard deviation

+

quantile2()

Compute Quantiles

+

rstar()

Calculate R* convergence diagnostic

-

Functionality specific to the rvar datatype

-

The draws_rvar format (a structured list of rvar objects) has the same methods (e.g. bind_draws()) as the other draws formats. For individual rvar objects themselves, however, posterior provides additional functionality.

+
+

Functionality specific to the rvar datatype

+

The draws_rvar format (a structured list of rvar objects) has the same methods (e.g. bind_draws()) as the other draws formats. For individual rvar objects themselves, however, posterior provides additional functionality.

+

chol(<rvar>)

Cholesky decomposition of random matrix

+

density(<rvar>) cdf(<rvar>) quantile(<rvar>)

Density, CDF, and quantile functions of random variables

+

`%**%`

Matrix multiplication of random variables

+

E() mean(<rvar>) Pr() median(<rvar>) min(<rvar>) max(<rvar>) sum(<rvar>) prod(<rvar>) all(<rvar>) any(<rvar>) Summary(<rvar>) variance(<rvar>) var() sd() mad() range(<rvar>) is.finite(<rvar>) is.infinite(<rvar>) is.nan(<rvar>) is.na(<rvar>)

Summaries of random variables within array elements, over draws

+

rvar_mean() rvar_median() rvar_sum() rvar_prod() rvar_min() rvar_max() rvar_sd() rvar_var() rvar_mad() rvar_range() rvar_quantile() rvar_all() rvar_any()

Summaries of random variables over array elements, within draws

+

rvar()

Random variables of arbitrary dimension

+

rvar_apply()

Random variable resulting from a function applied over margins of an array or random variable

+

rvar_is_finite() rvar_is_infinite() rvar_is_nan() rvar_is_na()

Special value predicates for random variables

+

rvar_rng()

Create random variables from existing random number generators

+

is_rvar()

Is x a random variable?

+

as_rvar()

Coerce to a random variable

+

rdo()

Execute expressions of random variables

+

rfun()

Create functions of random variables

+

draws_of() `draws_of<-`()

Get/set array of draws underlying a random variable

-

vec_ptype2(<rvar>) vec_ptype2.rvar(<default>) vec_cast(<rvar>) vec_cast.rvar(<default>) vec_ptype2.rvar(<rvar>) vec_cast.rvar(<rvar>) vec_ptype2.double(<rvar>) vec_ptype2.rvar(<double>) vec_cast.rvar(<double>) vec_ptype2.integer(<rvar>) vec_ptype2.rvar(<integer>) vec_cast.rvar(<integer>) vec_ptype2.logical(<rvar>) vec_ptype2.rvar(<logical>) vec_cast.rvar(<logical>)

-

rvar vctrs compatibility

- +
+
-
- +
- - + + diff --git a/docs/reference/is_rvar.html b/docs/reference/is_rvar.html index 1851d0cb..7b7c083c 100644 --- a/docs/reference/is_rvar.html +++ b/docs/reference/is_rvar.html @@ -1,67 +1,12 @@ - - - - - - - -Is x a random variable? — is_rvar • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Is x a random variable? — is_rvar • posterior - - - - + + -
-
- -
- -
+
-

Test if x is an rvar.

+

Test if x is an rvar.

-
is_rvar(x)
- -

Arguments

- - - - - - -
x

(any object) An object to test.

- -

Value

- -

TRUE if x is an rvar, FALSE otherwise.

-

See also

+
+
is_rvar(x)
+
-

as_rvar() to convert objects to rvars.

+
+

Arguments

+
x
+

(any object) An object to test.

+
+
+

Value

+

TRUE if x is an rvar, FALSE otherwise.

+
+
+

See also

+

as_rvar() to convert objects to rvars.

+
+
-
- +
- - + + diff --git a/docs/reference/mcse_mean.html b/docs/reference/mcse_mean.html index 7b9c353d..8bdb6eaa 100644 --- a/docs/reference/mcse_mean.html +++ b/docs/reference/mcse_mean.html @@ -1,68 +1,13 @@ - - - - - - - -Monte Carlo standard error for the mean — mcse_mean • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Monte Carlo standard error for the mean — mcse_mean • posterior + + - - - - -
-
- -
- -
+
@@ -173,100 +109,97 @@

Monte Carlo standard error for the mean

single variable.

-
mcse_mean(x, ...)
-
-# S3 method for default
-mcse_mean(x, ...)
-
-# S3 method for rvar
-mcse_mean(x, ...)
+
+
mcse_mean(x, ...)
 
-    

Arguments

- - - - - - - - - - -
x

(multiple options) One of:

...

Arguments passed to individual methods (if applicable).

+# S3 method for default +mcse_mean(x, ...) -

Value

+# S3 method for rvar +mcse_mean(x, ...)
+
+
+

Arguments

+
x
+

(multiple options) One of:

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

If the input is an array, returns a single numeric value. If any of the draws is non-finite, that is, NA, NaN, Inf, or -Inf, the returned output will be (numeric) NA. Also, if all draws within any of the chains of a -variable are the same (constant), the returned output will be (numeric) NA -as well. The reason for the latter is that, for constant draws, we cannot +variable are the same (constant), the returned output will be (numeric) NAas well. The reason for the latter is that, for constant draws, we cannot distinguish between variables that are supposed to be constant (e.g., a diagonal element of a correlation matrix is always 1) or variables that just happened to be constant because of a failure of convergence or other problems -in the sampling process.

-

If the input is an rvar, returns an array of the same dimensions as the -rvar, where each element is equal to the value that would be returned by -passing the draws array for that element of the rvar to this function.

-

References

- +in the sampling process. +If the input is an rvar, returns an array of the same dimensions as the +rvar, where each element is equal to the value that would be returned by +passing the draws array for that element of the rvar to this function.

+
+
+

References

Andrew Gelman, John B. Carlin, Hal S. Stern, David B. Dunson, Aki Vehtari and -Donald B. Rubin (2013). Bayesian Data Analysis, Third Edition. Chapman and +Donald B. Rubin (2013). Bayesian Data Analysis, Third Edition. Chapman and Hall/CRC.

-

See also

- -

Other diagnostics: -ess_basic(), -ess_bulk(), -ess_quantile(), -ess_sd(), -ess_tail(), -mcse_quantile(), -mcse_sd(), -rhat_basic(), -rhat(), -rstar()

+
+
+

See also

+

Other diagnostics: +ess_basic(), +ess_bulk(), +ess_quantile(), +ess_sd(), +ess_tail(), +mcse_quantile(), +mcse_sd(), +rhat_basic(), +rhat(), +rstar()

+
-

Examples

-
mu <- extract_variable_matrix(example_draws(), "mu") -mcse_mean(mu) -
#> [1] 0.1504394
-d <- as_draws_rvars(example_draws("multi_normal")) -mcse_mean(d$Sigma) -
#> [,1] [,2] [,3] -#> [1,] 0.006331065 0.009478331 0.01283981 -#> [2,] 0.009478331 0.019579138 0.02346471 -#> [3,] 0.012839814 0.023464711 0.03748603
-
+
+

Examples

+
mu <- extract_variable_matrix(example_draws(), "mu")
+mcse_mean(mu)
+#> [1] 0.1504394
+
+d <- as_draws_rvars(example_draws("multi_normal"))
+mcse_mean(d$Sigma)
+#>             [,1]        [,2]       [,3]
+#> [1,] 0.006331065 0.009478331 0.01283981
+#> [2,] 0.009478331 0.019579138 0.02346471
+#> [3,] 0.012839814 0.023464711 0.03748603
+
+
+
+
- - - + + diff --git a/docs/reference/mcse_quantile.html b/docs/reference/mcse_quantile.html index 19bee5e1..d0b49de9 100644 --- a/docs/reference/mcse_quantile.html +++ b/docs/reference/mcse_quantile.html @@ -1,68 +1,13 @@ - - - - - - - -Monte Carlo standard error for quantiles — mcse_quantile • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Monte Carlo standard error for quantiles — mcse_quantile • posterior + + - - - - -
-
- -
- -
+
@@ -173,117 +109,111 @@

Monte Carlo standard error for quantiles

single variable.

-
mcse_quantile(x, probs = c(0.05, 0.95), ...)
+    
+
mcse_quantile(x, probs = c(0.05, 0.95), ...)
 
-# S3 method for default
-mcse_quantile(x, probs = c(0.05, 0.95), names = TRUE, ...)
+# S3 method for default
+mcse_quantile(x, probs = c(0.05, 0.95), names = TRUE, ...)
 
-# S3 method for rvar
-mcse_quantile(x, probs = c(0.05, 0.95), names = TRUE, ...)
+# S3 method for rvar
+mcse_quantile(x, probs = c(0.05, 0.95), names = TRUE, ...)
 
-mcse_median(x, ...)
+mcse_median(x, ...)
+
-

Arguments

- - - - - - - - - - - - - - - - - - -
x

(multiple options) One of:

probs

(numeric vector) Probabilities in [0, 1].

...

Arguments passed to individual methods (if applicable).

names

(logical) Should the result have a names attribute? The +

+

Arguments

+
x
+

(multiple options) One of:

+
probs
+

(numeric vector) Probabilities in [0, 1].

+
...
+

Arguments passed to individual methods (if applicable).

+
names
+

(logical) Should the result have a names attribute? The default is TRUE, but use FALSE for improved speed if there are many -values in probs.

- -

Value

- +values in probs.

+
+
+

Value

If the input is an array, returns a numeric vector with one element per quantile. If any of the draws is non-finite, that is, NA, NaN, Inf, or -Inf, the returned output will be a vector of (numeric) NA values. Also, if all draws of a variable are -the same (constant), the returned output will be a vector of (numeric) NA -values as well. The reason for the latter is that, for constant draws, we +the same (constant), the returned output will be a vector of (numeric) NAvalues as well. The reason for the latter is that, for constant draws, we cannot distinguish between variables that are supposed to be constant (e.g., a diagonal element of a correlation matrix is always 1) or variables that just happened to be constant because of a failure of convergence or other -problems in the sampling process.

-

If the input is an rvar and length(probs) == 1, returns an array of the -same dimensions as the rvar, where each element is equal to the value +problems in the sampling process. +If the input is an rvar and length(probs) == 1, returns an array of the +same dimensions as the rvar, where each element is equal to the value that would be returned by passing the draws array for that element of the -rvar to this function. If length(probs) > 1, the first dimension of the +rvar to this function. If length(probs) > 1, the first dimension of the result indexes the input probabilities; i.e. the result has dimension -c(length(probs), dim(x)).

-

References

- +c(length(probs), dim(x)).

+
+
+

References

Aki Vehtari, Andrew Gelman, Daniel Simpson, Bob Carpenter, and -Paul-Christian Bürkner (2019). Rank-normalization, folding, and +Paul-Christian Bürkner (2021). Rank-normalization, folding, and localization: An improved R-hat for assessing convergence of -MCMC. arXiv preprint arXiv:1903.08008.

-

See also

- -

Other diagnostics: -ess_basic(), -ess_bulk(), -ess_quantile(), -ess_sd(), -ess_tail(), -mcse_mean(), -mcse_sd(), -rhat_basic(), -rhat(), -rstar()

+MCMC (with discussion). Bayesian Data Analysis. 16(2), 667-–718. +doi:10.1214/20-BA1221

+
+
+

See also

+

Other diagnostics: +ess_basic(), +ess_bulk(), +ess_quantile(), +ess_sd(), +ess_tail(), +mcse_mean(), +mcse_sd(), +rhat_basic(), +rhat(), +rstar()

+
-

Examples

-
mu <- extract_variable_matrix(example_draws(), "mu") -mcse_quantile(mu, probs = c(0.1, 0.9)) -
#> mcse_q10 mcse_q90 -#> 0.3199011 0.2677437
-d <- as_draws_rvars(example_draws("multi_normal")) -mcse_quantile(d$mu) -
#> [,1] [,2] [,3] -#> mcse_q5 0.012675014 0.01279547 0.02331627 -#> mcse_q95 0.008302994 0.02609606 0.05555146
-
+
+

Examples

+
mu <- extract_variable_matrix(example_draws(), "mu")
+mcse_quantile(mu, probs = c(0.1, 0.9))
+#>  mcse_q10  mcse_q90 
+#> 0.3199011 0.2677437 
+
+d <- as_draws_rvars(example_draws("multi_normal"))
+mcse_quantile(d$mu)
+#>                 [,1]       [,2]       [,3]
+#> mcse_q5  0.012675014 0.01279547 0.02331627
+#> mcse_q95 0.008302994 0.02609606 0.05555146
+
+
+
+ - - - + + diff --git a/docs/reference/mcse_sd.html b/docs/reference/mcse_sd.html index 2ee370b1..0d2447d3 100644 --- a/docs/reference/mcse_sd.html +++ b/docs/reference/mcse_sd.html @@ -1,69 +1,14 @@ - - - - - - - -Monte Carlo standard error for the standard deviation — mcse_sd • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Monte Carlo standard error for the standard deviation — mcse_sd • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
@@ -175,101 +111,99 @@

Monte Carlo standard error for the standard deviation

normality.

-
mcse_sd(x, ...)
-
-# S3 method for default
-mcse_sd(x, ...)
-
-# S3 method for rvar
-mcse_sd(x, ...)
+
+
mcse_sd(x, ...)
 
-    

Arguments

- - - - - - - - - - -
x

(multiple options) One of:

...

Arguments passed to individual methods (if applicable).

+# S3 method for default +mcse_sd(x, ...) -

Value

+# S3 method for rvar +mcse_sd(x, ...)
+
+
+

Arguments

+
x
+

(multiple options) One of:

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

If the input is an array, returns a single numeric value. If any of the draws is non-finite, that is, NA, NaN, Inf, or -Inf, the returned output will be (numeric) NA. Also, if all draws within any of the chains of a -variable are the same (constant), the returned output will be (numeric) NA -as well. The reason for the latter is that, for constant draws, we cannot +variable are the same (constant), the returned output will be (numeric) NAas well. The reason for the latter is that, for constant draws, we cannot distinguish between variables that are supposed to be constant (e.g., a diagonal element of a correlation matrix is always 1) or variables that just happened to be constant because of a failure of convergence or other problems -in the sampling process.

-

If the input is an rvar, returns an array of the same dimensions as the -rvar, where each element is equal to the value that would be returned by -passing the draws array for that element of the rvar to this function.

-

References

- +in the sampling process. +If the input is an rvar, returns an array of the same dimensions as the +rvar, where each element is equal to the value that would be returned by +passing the draws array for that element of the rvar to this function.

+
+
+

References

Aki Vehtari, Andrew Gelman, Daniel Simpson, Bob Carpenter, and -Paul-Christian Bürkner (2019). Rank-normalization, folding, and +Paul-Christian Bürkner (2021). Rank-normalization, folding, and localization: An improved R-hat for assessing convergence of -MCMC. arXiv preprint arXiv:1903.08008.

-

See also

- -

Other diagnostics: -ess_basic(), -ess_bulk(), -ess_quantile(), -ess_sd(), -ess_tail(), -mcse_mean(), -mcse_quantile(), -rhat_basic(), -rhat(), -rstar()

+MCMC (with discussion). Bayesian Data Analysis. 16(2), 667-–718. +doi:10.1214/20-BA1221

+
+
+

See also

+

Other diagnostics: +ess_basic(), +ess_bulk(), +ess_quantile(), +ess_sd(), +ess_tail(), +mcse_mean(), +mcse_quantile(), +rhat_basic(), +rhat(), +rstar()

+
-

Examples

-
mu <- extract_variable_matrix(example_draws(), "mu") -mcse_sd(mu) -
#> [1] 0.1494182
-d <- as_draws_rvars(example_draws("multi_normal")) -mcse_sd(d$Sigma) -
#> [,1] [,2] [,3] -#> [1,] 0.004679905 0.007248505 0.009617634 -#> [2,] 0.007248505 0.013986224 0.017376158 -#> [3,] 0.009617634 0.017376158 0.027501426
-
+
+

Examples

+
mu <- extract_variable_matrix(example_draws(), "mu")
+mcse_sd(mu)
+#> [1] 0.1494182
+
+d <- as_draws_rvars(example_draws("multi_normal"))
+mcse_sd(d$Sigma)
+#>             [,1]        [,2]        [,3]
+#> [1,] 0.004679905 0.007248505 0.009617634
+#> [2,] 0.007248505 0.013986224 0.017376158
+#> [3,] 0.009617634 0.017376158 0.027501426
+
+
+
+
- - - + + diff --git a/docs/reference/merge_chains.html b/docs/reference/merge_chains.html index 5af93b28..a0c49397 100644 --- a/docs/reference/merge_chains.html +++ b/docs/reference/merge_chains.html @@ -1,71 +1,16 @@ - - - - - - - -Merge chains of draws objects — merge_chains • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Merge chains of draws objects — merge_chains • posterior - - - - - - - - - - - - - + + -
-
- -
- -
+
-

Merge chains of draws objects into a single chain. Some operations will +

Merge chains of draws objects into a single chain. Some operations will trigger an automatic merging of chains, for example, because chains do not match between two objects involved in a binary operation. By default, no warning will be issued when this happens but you can activate one via -options(posterior.warn_on_merge_chains = TRUE).

+options(posterior.warn_on_merge_chains = TRUE).

-
merge_chains(x, ...)
+    
+
merge_chains(x, ...)
 
-# S3 method for draws_matrix
-merge_chains(x, ...)
+# S3 method for draws_matrix
+merge_chains(x, ...)
 
-# S3 method for draws_array
-merge_chains(x, ...)
+# S3 method for draws_array
+merge_chains(x, ...)
 
-# S3 method for draws_df
-merge_chains(x, ...)
+# S3 method for draws_df
+merge_chains(x, ...)
 
-# S3 method for draws_list
-merge_chains(x, ...)
+# S3 method for draws_list
+merge_chains(x, ...)
 
-# S3 method for rvar
-merge_chains(x, ...)
+# S3 method for rvar
+merge_chains(x, ...)
 
-# S3 method for draws_rvars
-merge_chains(x, ...)
- -

Arguments

- - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

...

Arguments passed to individual methods (if applicable).

- -

Value

+# S3 method for draws_rvars +merge_chains(x, ...)
+
+
+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

A draws object of the same class as x.

+
-

Examples

-
x <- example_draws() - -# draws_array with 4 chains, 100 iters each -str(x) -
#> 'draws_array' num [1:100, 1:4, 1:10] 2.01 1.46 5.81 6.85 1.81 ... -#> - attr(*, "dimnames")=List of 3 -#> ..$ iteration: chr [1:100] "1" "2" "3" "4" ... -#> ..$ chain : chr [1:4] "1" "2" "3" "4" -#> ..$ variable : chr [1:10] "mu" "tau" "theta[1]" "theta[2]" ...
-# draws_array with 1 chain of 400 iterations -str(merge_chains(x)) -
#> 'draws_array' num [1:400, 1, 1:10] 2.01 1.46 5.81 6.85 1.81 ... -#> - attr(*, "dimnames")=List of 3 -#> ..$ iteration: chr [1:400] "1" "2" "3" "4" ... -#> ..$ chain : chr "1" -#> ..$ variable : chr [1:10] "mu" "tau" "theta[1]" "theta[2]" ...
-
+
+

Examples

+
x <- example_draws()
+
+# draws_array with 4 chains, 100 iters each
+str(x)
+#>  'draws_array' num [1:100, 1:4, 1:10] 2.01 1.46 5.81 6.85 1.81 ...
+#>  - attr(*, "dimnames")=List of 3
+#>   ..$ iteration: chr [1:100] "1" "2" "3" "4" ...
+#>   ..$ chain    : chr [1:4] "1" "2" "3" "4"
+#>   ..$ variable : chr [1:10] "mu" "tau" "theta[1]" "theta[2]" ...
+
+# draws_array with 1 chain of 400 iterations
+str(merge_chains(x))
+#>  'draws_array' num [1:400, 1, 1:10] 2.01 1.46 5.81 6.85 1.81 ...
+#>  - attr(*, "dimnames")=List of 3
+#>   ..$ iteration: chr [1:400] "1" "2" "3" "4" ...
+#>   ..$ chain    : chr "1"
+#>   ..$ variable : chr [1:10] "mu" "tau" "theta[1]" "theta[2]" ...
+
+
+
+
- - - + + diff --git a/docs/reference/mutate_variables.html b/docs/reference/mutate_variables.html index cf4e6f08..21c71215 100644 --- a/docs/reference/mutate_variables.html +++ b/docs/reference/mutate_variables.html @@ -1,67 +1,12 @@ - - - - - - - -Mutate variables in draws objects — mutate_variables • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Mutate variables in draws objects — mutate_variables • posterior + + - - - - -
-
- -
- -
+
-

Mutate variables in a draws object.

+

Mutate variables in a draws object.

-
mutate_variables(.x, ...)
+    
+
mutate_variables(.x, ...)
 
-# S3 method for draws_matrix
-mutate_variables(.x, ...)
+# S3 method for draws_matrix
+mutate_variables(.x, ...)
 
-# S3 method for draws_array
-mutate_variables(.x, ...)
+# S3 method for draws_array
+mutate_variables(.x, ...)
 
-# S3 method for draws_df
-mutate_variables(.x, ...)
+# S3 method for draws_df
+mutate_variables(.x, ...)
 
-# S3 method for draws_list
-mutate_variables(.x, ...)
+# S3 method for draws_list
+mutate_variables(.x, ...)
 
-# S3 method for draws_rvars
-mutate_variables(.x, ...)
+# S3 method for draws_rvars +mutate_variables(.x, ...)
+
-

Arguments

- - - - - - - - - - -
.x

(draws) A draws object.

...

Name-value pairs of expressions, each with either length 1 or the +

+

Arguments

+
.x
+

(draws) A draws object.

+
...
+

Name-value pairs of expressions, each with either length 1 or the same length as in the entire input (i.e., number of iterations or draws). The name of each argument will be the name of a new variable, and the value will be its corresponding value. Use a NULL value in mutate_variables to drop a variable. New variables overwrite existing variables of the same -name.

- -

Value

- -

Returns a draws object of the same format as .x, with variables mutated +name.

+
+
+

Value

+

Returns a draws object of the same format as .x, with variables mutated according to the expressions provided in ....

-

Details

- -

In order to mutate variables in draws_matrix and draws_array objects, -they are transformed to draws_df objects first and then transformed back +

+
+

Details

+

In order to mutate variables in draws_matrix and draws_array objects, +they are transformed to draws_df objects first and then transformed back after mutation. As those transformations are quite expensive for larger -number of draws, we recommend using mutate_variables on draws_df and -draws_list objects if speed is an issue.

-

In draws_rvars objects, the output of each expression in ... is -coerced to an rvar object if it is not already one using as_rvar().

-

See also

- - - -

Examples

-
x <- as_draws_df(example_draws()) -x <- subset(x, variable = c("mu", "tau")) +number of draws, we recommend using mutate_variables on draws_df and +draws_list objects if speed is an issue.

+

In draws_rvars objects, the output of each expression in ... is +coerced to an rvar object if it is not already one using as_rvar().

+
+
+

See also

+ +
-mutate_variables(x, tau2 = tau^2) -
#> # A draws_df: 100 iterations, 4 chains, and 3 variables -#> mu tau tau2 -#> 1 2.01 2.8 7.7 -#> 2 1.46 7.0 48.7 -#> 3 5.81 9.7 93.6 -#> 4 6.85 4.8 22.9 -#> 5 1.81 2.8 8.1 -#> 6 3.84 4.1 16.7 -#> 7 5.47 4.0 15.6 -#> 8 1.20 1.5 2.2 -#> 9 0.15 3.9 15.4 -#> 10 7.17 1.8 3.1 -#> # ... with 390 more draws -#> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
mutate_variables(x, scale = 1.96 * tau, lower = mu - scale) -
#> # A draws_df: 100 iterations, 4 chains, and 4 variables -#> mu tau scale lower -#> 1 2.01 2.8 5.4 -3.4 -#> 2 1.46 7.0 13.7 -12.2 -#> 3 5.81 9.7 19.0 -13.2 -#> 4 6.85 4.8 9.4 -2.5 -#> 5 1.81 2.8 5.6 -3.8 -#> 6 3.84 4.1 8.0 -4.2 -#> 7 5.47 4.0 7.7 -2.3 -#> 8 1.20 1.5 2.9 -1.7 -#> 9 0.15 3.9 7.7 -7.6 -#> 10 7.17 1.8 3.5 3.7 -#> # ... with 390 more draws -#> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
-
+
+

Examples

+
x <- as_draws_df(example_draws())
+x <- subset(x, variable = c("mu", "tau"))
+
+mutate_variables(x, tau2 = tau^2)
+#> # A draws_df: 100 iterations, 4 chains, and 3 variables
+#>      mu tau tau2
+#> 1  2.01 2.8  7.7
+#> 2  1.46 7.0 48.7
+#> 3  5.81 9.7 93.6
+#> 4  6.85 4.8 22.9
+#> 5  1.81 2.8  8.1
+#> 6  3.84 4.1 16.7
+#> 7  5.47 4.0 15.6
+#> 8  1.20 1.5  2.2
+#> 9  0.15 3.9 15.4
+#> 10 7.17 1.8  3.1
+#> # ... with 390 more draws
+#> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
+mutate_variables(x, scale = 1.96 * tau, lower = mu - scale)
+#> # A draws_df: 100 iterations, 4 chains, and 4 variables
+#>      mu tau scale lower
+#> 1  2.01 2.8   5.4  -3.4
+#> 2  1.46 7.0  13.7 -12.2
+#> 3  5.81 9.7  19.0 -13.2
+#> 4  6.85 4.8   9.4  -2.5
+#> 5  1.81 2.8   5.6  -3.8
+#> 6  3.84 4.1   8.0  -4.2
+#> 7  5.47 4.0   7.7  -2.3
+#> 8  1.20 1.5   2.9  -1.7
+#> 9  0.15 3.9   7.7  -7.6
+#> 10 7.17 1.8   3.5   3.7
+#> # ... with 390 more draws
+#> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
+
+
+
+ - - - + + diff --git a/docs/reference/order_draws.html b/docs/reference/order_draws.html index 38e3ec0b..5746874f 100644 --- a/docs/reference/order_draws.html +++ b/docs/reference/order_draws.html @@ -1,69 +1,14 @@ - - - - - - - -Order draws objects — order_draws • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Order draws objects — order_draws • posterior - - - - - - - - - - - + + - - -
-
- -
- -
+
-

Order draws objects according to iteration and chain number. By default, +

Order draws objects according to iteration and chain number. By default, draws objects are ordered but subsetting or extracting parts of them may leave them in an unordered state.

-
order_draws(x, ...)
-
-# S3 method for draws_matrix
-order_draws(x, ...)
+    
+
order_draws(x, ...)
 
-# S3 method for draws_array
-order_draws(x, ...)
+# S3 method for draws_matrix
+order_draws(x, ...)
 
-# S3 method for draws_df
-order_draws(x, ...)
+# S3 method for draws_array
+order_draws(x, ...)
 
-# S3 method for draws_list
-order_draws(x, ...)
+# S3 method for draws_df
+order_draws(x, ...)
 
-# S3 method for draws_rvars
-order_draws(x, ...)
+# S3 method for draws_list
+order_draws(x, ...)
 
-# S3 method for rvar
-order_draws(x, ...)
+# S3 method for draws_rvars +order_draws(x, ...) -

Arguments

- - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

...

Arguments passed to individual methods (if applicable).

- -

Value

+# S3 method for rvar +order_draws(x, ...)
+
+
+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

A draws object of the same class as x.

-

See also

- - +
+
+

See also

+ +
-

Examples

-
x <- as_draws_array(example_draws()) -dimnames(x[10:5, 4:3, ]) -
#> $iteration -#> [1] "10" "9" "8" "7" "6" "5" -#> -#> $chain -#> [1] "4" "3" -#> -#> $variable -#> [1] "mu" "tau" "theta[1]" "theta[2]" "theta[3]" "theta[4]" -#> [7] "theta[5]" "theta[6]" "theta[7]" "theta[8]" -#>
dimnames(order_draws(x[10:5, 4:3, ])) -
#> $iteration -#> [1] "5" "6" "7" "8" "9" "10" -#> -#> $chain -#> [1] "3" "4" -#> -#> $variable -#> [1] "mu" "tau" "theta[1]" "theta[2]" "theta[3]" "theta[4]" -#> [7] "theta[5]" "theta[6]" "theta[7]" "theta[8]" -#>
-
+
+

Examples

+
x <- as_draws_array(example_draws())
+dimnames(x[10:5, 4:3, ])
+#> $iteration
+#> [1] "10" "9"  "8"  "7"  "6"  "5" 
+#> 
+#> $chain
+#> [1] "4" "3"
+#> 
+#> $variable
+#>  [1] "mu"       "tau"      "theta[1]" "theta[2]" "theta[3]" "theta[4]"
+#>  [7] "theta[5]" "theta[6]" "theta[7]" "theta[8]"
+#> 
+dimnames(order_draws(x[10:5, 4:3, ]))
+#> $iteration
+#> [1] "5"  "6"  "7"  "8"  "9"  "10"
+#> 
+#> $chain
+#> [1] "3" "4"
+#> 
+#> $variable
+#>  [1] "mu"       "tau"      "theta[1]" "theta[2]" "theta[3]" "theta[4]"
+#>  [7] "theta[5]" "theta[6]" "theta[7]" "theta[8]"
+#> 
+
+
+
+
- - - + + diff --git a/docs/reference/posterior-package.html b/docs/reference/posterior-package.html index 54c6a6fb..cf059005 100644 --- a/docs/reference/posterior-package.html +++ b/docs/reference/posterior-package.html @@ -1,46 +1,5 @@ - - - - - - - -Tools for working with posterior (and prior) distributions — posterior-package • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Tools for working with posterior (and prior) distributions — posterior-package • posterior - - - - - - - - - - - - - + + -
-
- -
- -
+
-

- https://mc-stan.org/posterior/

+

https://mc-stan.org/posterior/

The posterior package is intended to provide useful tools for both users and developers of packages for fitting Bayesian models or working with output from Bayesian models. The primary goals of the package -are to:

    -
  • Efficiently convert between many different useful formats of +are to:

    • Efficiently convert between many different useful formats of draws (samples) from posterior or prior distributions.

    • Provide consistent methods for operations commonly performed on draws, for example, subsetting, binding, or mutating draws.

    • Provide various summaries of draws in convenient formats.

    • Provide lightweight implementations of state of the art posterior inference diagnostics.

    • -
    - -
- - +
-

Package options

+
+

Package options

-

The following options are used to format and print draws objects, -as in print.draws_array(), print.draws_df(), print.draws_list(), -print.draws_matrix(), and print.draws_rvars():

    -
  • posterior.max_draws: Maximum number of draws to print.

  • +

    The following options are used to format and print draws objects, +as in print.draws_array(), print.draws_df(), print.draws_list(), +print.draws_matrix(), and print.draws_rvars():

    • posterior.max_draws: Maximum number of draws to print.

    • posterior.max_iterations: Maximum number of iterations to print.

    • posterior.max_chains: Maximum number of chains to print.

    • posterior.max_variables: Maximum number of variables to print.

    • -
    - -

    The following option is used to format and print rvar objects, -as in print.rvar() and print.draws_rvars():

      -
    • posterior.rvar_summary: What style of summary to display: +

    The following option is used to format and print rvar objects, +as in print.rvar() and print.draws_rvars():

    • posterior.rvar_summary: What style of summary to display: "mean_sd" displays mean±sd, "median_mad" displays median±mad.

    • -
    - -

    The following option is used to construct new rvar objects, -as in rfun() and rdo():

      -
    • posterior.rvar_ndraws: The number of draws used to construct +

    The following option is used to construct new rvar objects, +as in rfun() and rdo():

    • posterior.rvar_ndraws: The number of draws used to construct new random variables when this number cannot be determined -from existing arguments (e.g., other rvars passed to a function).

    • -
    - -

    The following options are used to control warning messages:

      -
    • posterior.warn_on_merge_chains: (logical) Some operations will +from existing arguments (e.g., other rvars passed to a function).

    • +

    The following options are used to control warning messages:

    • posterior.warn_on_merge_chains: (logical) Some operations will trigger an automatic merging of chains, for example, because chains do not match between two objects involved in a binary operation. Whether this causes a warning can be controlled by this option.

    • -
    - +
+
- - - + + diff --git a/docs/reference/print.draws_array.html b/docs/reference/print.draws_array.html index 00535ef2..b303c33b 100644 --- a/docs/reference/print.draws_array.html +++ b/docs/reference/print.draws_array.html @@ -1,67 +1,12 @@ - - - - - - - -Print draws_array objects — print.draws_array • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Print draws_array objects — print.draws_array • posterior - - + + - - -
-
- -
- -
+
-

Pretty printing for draws_array objects.

+

Pretty printing for draws_array objects.

-
# S3 method for draws_array
-print(
-  x,
-  digits = 2,
-  max_iterations = getOption("posterior.max_iterations", 5),
-  max_chains = getOption("posterior.max_chains", 8),
-  max_variables = getOption("posterior.max_variables", 4),
-  reserved = FALSE,
-  ...
-)
+
+
# S3 method for draws_array
+print(
+  x,
+  digits = 2,
+  max_iterations = getOption("posterior.max_iterations", 5),
+  max_chains = getOption("posterior.max_chains", 8),
+  max_variables = getOption("posterior.max_variables", 4),
+  reserved = FALSE,
+  ...
+)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

digits

(nonnegative integer) The minimum number of significant digits -to print.

max_iterations

(positive integer) The maximum number of iterations to +

+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
digits
+

(nonnegative integer) The minimum number of significant digits +to print.

+
max_iterations
+

(positive integer) The maximum number of iterations to print. Can be controlled globally via the "posterior.max_iterations" -option.

max_chains

(positive integer) The maximum number of chains to print. +option.

+
max_chains
+

(positive integer) The maximum number of chains to print. Can be controlled globally via the "posterior.max_chains" -option.

max_variables

(positive integer) The maximum number of variables to +option.

+
max_variables
+

(positive integer) The maximum number of variables to print. Can be controlled globally via the "posterior.max_variables" -option.

reserved

(logical) Should reserved variables be included in the -output? Defaults to FALSE. See reserved_variables for an overview of -currently reserved variable names.

...

Further arguments passed to the underlying print() methods.

- -

Value

- +option.

+
reserved
+

(logical) Should reserved variables be included in the +output? Defaults to FALSE. See reserved_variables for an overview of +currently reserved variable names.

+
...
+

Further arguments passed to the underlying print() methods.

+
+
+

Value

A draws object of the same class as x.

+
-

Examples

-
#> # A draws_array: 100 iterations, 4 chains, and 10 variables -#> , , variable = mu -#> -#> chain -#> iteration 1 2 3 4 -#> 1 2.0 3.0 1.79 6.5 -#> 2 1.5 8.2 5.99 9.1 -#> 3 5.8 -1.2 2.56 0.2 -#> 4 6.8 10.9 2.79 3.7 -#> 5 1.8 9.8 -0.03 5.5 -#> -#> , , variable = tau -#> -#> chain -#> iteration 1 2 3 4 -#> 1 2.8 2.80 8.7 3.8 -#> 2 7.0 2.76 2.9 6.8 -#> 3 9.7 0.57 8.4 5.3 -#> 4 4.8 2.45 4.4 1.6 -#> 5 2.8 2.80 11.0 3.0 -#> -#> , , variable = theta[1] -#> -#> chain -#> iteration 1 2 3 4 -#> 1 3.96 6.26 13.3 5.78 -#> 2 0.12 9.32 6.3 2.09 -#> 3 21.25 -0.97 10.6 15.72 -#> 4 14.70 12.45 5.4 2.69 -#> 5 5.96 9.75 8.2 -0.91 -#> -#> , , variable = theta[2] -#> -#> chain -#> iteration 1 2 3 4 -#> 1 0.271 1.0 2.1 5.0 -#> 2 -0.069 9.4 7.3 8.2 -#> 3 14.931 -1.2 5.7 6.0 -#> 4 8.586 12.5 2.8 2.7 -#> 5 1.156 11.9 3.2 3.2 -#> -#> # ... with 95 more iterations, and 6 more variables
-
+
+

Examples

+
x <- as_draws_array(example_draws())
+print(x)
+#> # A draws_array: 100 iterations, 4 chains, and 10 variables
+#> , , variable = mu
+#> 
+#>          chain
+#> iteration   1    2     3   4
+#>         1 2.0  3.0  1.79 6.5
+#>         2 1.5  8.2  5.99 9.1
+#>         3 5.8 -1.2  2.56 0.2
+#>         4 6.8 10.9  2.79 3.7
+#>         5 1.8  9.8 -0.03 5.5
+#> 
+#> , , variable = tau
+#> 
+#>          chain
+#> iteration   1    2    3   4
+#>         1 2.8 2.80  8.7 3.8
+#>         2 7.0 2.76  2.9 6.8
+#>         3 9.7 0.57  8.4 5.3
+#>         4 4.8 2.45  4.4 1.6
+#>         5 2.8 2.80 11.0 3.0
+#> 
+#> , , variable = theta[1]
+#> 
+#>          chain
+#> iteration     1     2    3     4
+#>         1  3.96  6.26 13.3  5.78
+#>         2  0.12  9.32  6.3  2.09
+#>         3 21.25 -0.97 10.6 15.72
+#>         4 14.70 12.45  5.4  2.69
+#>         5  5.96  9.75  8.2 -0.91
+#> 
+#> , , variable = theta[2]
+#> 
+#>          chain
+#> iteration      1    2   3   4
+#>         1  0.271  1.0 2.1 5.0
+#>         2 -0.069  9.4 7.3 8.2
+#>         3 14.931 -1.2 5.7 6.0
+#>         4  8.586 12.5 2.8 2.7
+#>         5  1.156 11.9 3.2 3.2
+#> 
+#> # ... with 95 more iterations, and 6 more variables
+
+
+
+
- - - + + diff --git a/docs/reference/print.draws_df.html b/docs/reference/print.draws_df.html index 34bff0de..318ca0c5 100644 --- a/docs/reference/print.draws_df.html +++ b/docs/reference/print.draws_df.html @@ -1,67 +1,12 @@ - - - - - - - -Print draws_df objects — print.draws_df • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Print draws_df objects — print.draws_df • posterior - - + + - - -
-
- -
- -
+
-

Pretty printing for draws_df objects.

+

Pretty printing for draws_df objects.

-
# S3 method for draws_df
-print(
-  x,
-  digits = 2,
-  max_draws = getOption("posterior.max_draws", 10),
-  max_variables = getOption("posterior.max_variables", 8),
-  reserved = FALSE,
-  ...
-)
+
+
# S3 method for draws_df
+print(
+  x,
+  digits = 2,
+  max_draws = getOption("posterior.max_draws", 10),
+  max_variables = getOption("posterior.max_variables", 8),
+  reserved = FALSE,
+  ...
+)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

digits

(nonnegative integer) The minimum number of significant digits -to print.

max_draws

(positive integer) The maximum number of draws to print. Can +

+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
digits
+

(nonnegative integer) The minimum number of significant digits +to print.

+
max_draws
+

(positive integer) The maximum number of draws to print. Can be controlled globally via the "posterior.max_draws" -option.

max_variables

(positive integer) The maximum number of variables to +option.

+
max_variables
+

(positive integer) The maximum number of variables to print. Can be controlled globally via the "posterior.max_variables" -option.

reserved

(logical) Should reserved variables be included in the -output? Defaults to FALSE. See reserved_variables for an overview of -currently reserved variable names.

...

Further arguments passed to the underlying print() methods.

- -

Value

- +option.

+
reserved
+

(logical) Should reserved variables be included in the +output? Defaults to FALSE. See reserved_variables for an overview of +currently reserved variable names.

+
...
+

Further arguments passed to the underlying print() methods.

+
+
+

Value

A draws object of the same class as x.

+
-

Examples

-
#> # A draws_df: 100 iterations, 4 chains, and 10 variables -#> mu tau theta[1] theta[2] theta[3] theta[4] theta[5] theta[6] -#> 1 2.01 2.8 3.96 0.271 -0.74 2.1 0.923 1.7 -#> 2 1.46 7.0 0.12 -0.069 0.95 7.3 -0.062 11.3 -#> 3 5.81 9.7 21.25 14.931 1.83 1.4 0.531 7.2 -#> 4 6.85 4.8 14.70 8.586 2.67 4.4 4.758 8.1 -#> 5 1.81 2.8 5.96 1.156 3.11 2.0 0.769 4.7 -#> 6 3.84 4.1 5.76 9.909 -1.00 5.3 5.889 -1.7 -#> 7 5.47 4.0 4.03 4.151 10.15 6.6 3.741 -2.2 -#> 8 1.20 1.5 -0.28 1.846 0.47 4.3 1.467 3.3 -#> 9 0.15 3.9 1.81 0.661 0.86 4.5 -1.025 1.1 -#> 10 7.17 1.8 6.08 8.102 7.68 5.6 7.106 8.5 -#> # ... with 390 more draws, and 2 more variables -#> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
-
+
+

Examples

+
x <- as_draws_df(example_draws())
+print(x)
+#> # A draws_df: 100 iterations, 4 chains, and 10 variables
+#>      mu tau theta[1] theta[2] theta[3] theta[4] theta[5] theta[6]
+#> 1  2.01 2.8     3.96    0.271    -0.74      2.1    0.923      1.7
+#> 2  1.46 7.0     0.12   -0.069     0.95      7.3   -0.062     11.3
+#> 3  5.81 9.7    21.25   14.931     1.83      1.4    0.531      7.2
+#> 4  6.85 4.8    14.70    8.586     2.67      4.4    4.758      8.1
+#> 5  1.81 2.8     5.96    1.156     3.11      2.0    0.769      4.7
+#> 6  3.84 4.1     5.76    9.909    -1.00      5.3    5.889     -1.7
+#> 7  5.47 4.0     4.03    4.151    10.15      6.6    3.741     -2.2
+#> 8  1.20 1.5    -0.28    1.846     0.47      4.3    1.467      3.3
+#> 9  0.15 3.9     1.81    0.661     0.86      4.5   -1.025      1.1
+#> 10 7.17 1.8     6.08    8.102     7.68      5.6    7.106      8.5
+#> # ... with 390 more draws, and 2 more variables
+#> # ... hidden reserved variables {'.chain', '.iteration', '.draw'}
+
+
+
+
- - - + + diff --git a/docs/reference/print.draws_list.html b/docs/reference/print.draws_list.html index 3fa12373..b4faba7b 100644 --- a/docs/reference/print.draws_list.html +++ b/docs/reference/print.draws_list.html @@ -1,67 +1,12 @@ - - - - - - - -Print draws_list objects — print.draws_list • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Print draws_list objects — print.draws_list • posterior - - + + - - -
-
- -
- -
+
-

Pretty printing for draws_list objects.

+

Pretty printing for draws_list objects.

-
# S3 method for draws_list
-print(
-  x,
-  digits = 2,
-  max_iterations = getOption("posterior.max_iterations", 10),
-  max_chains = getOption("posterior.max_chains", 2),
-  max_variables = getOption("posterior.max_variables", 4),
-  reserved = FALSE,
-  ...
-)
+
+
# S3 method for draws_list
+print(
+  x,
+  digits = 2,
+  max_iterations = getOption("posterior.max_iterations", 10),
+  max_chains = getOption("posterior.max_chains", 2),
+  max_variables = getOption("posterior.max_variables", 4),
+  reserved = FALSE,
+  ...
+)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

digits

(nonnegative integer) The minimum number of significant digits -to print.

max_iterations

(positive integer) The maximum number of iterations to +

+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
digits
+

(nonnegative integer) The minimum number of significant digits +to print.

+
max_iterations
+

(positive integer) The maximum number of iterations to print. Can be controlled globally via the "posterior.max_iterations" -option.

max_chains

(positive integer) The maximum number of chains to print. +option.

+
max_chains
+

(positive integer) The maximum number of chains to print. Can be controlled globally via the "posterior.max_chains" -option.

max_variables

(positive integer) The maximum number of variables to +option.

+
max_variables
+

(positive integer) The maximum number of variables to print. Can be controlled globally via the "posterior.max_variables" -option.

reserved

(logical) Should reserved variables be included in the -output? Defaults to FALSE. See reserved_variables for an overview of -currently reserved variable names.

...

Further arguments passed to the underlying print() methods.

- -

Value

- +option.

+
reserved
+

(logical) Should reserved variables be included in the +output? Defaults to FALSE. See reserved_variables for an overview of +currently reserved variable names.

+
...
+

Further arguments passed to the underlying print() methods.

+
+
+

Value

A draws object of the same class as x.

+
-

Examples

-
#> # A draws_list: 100 iterations, 4 chains, and 10 variables -#> -#> [chain = 1] -#> $mu -#> [1] 2.01 1.46 5.81 6.85 1.81 3.84 5.47 1.20 0.15 7.17 -#> -#> $tau -#> [1] 2.8 7.0 9.7 4.8 2.8 4.1 4.0 1.5 3.9 1.8 -#> -#> $`theta[1]` -#> [1] 3.96 0.12 21.25 14.70 5.96 5.76 4.03 -0.28 1.81 6.08 -#> -#> $`theta[2]` -#> [1] 0.271 -0.069 14.931 8.586 1.156 9.909 4.151 1.846 0.661 8.102 -#> -#> -#> [chain = 2] -#> $mu -#> [1] 2.99 8.17 -1.15 10.93 9.82 -10.90 -9.26 1.79 5.35 0.87 -#> -#> $tau -#> [1] 2.80 2.76 0.57 2.45 2.80 6.08 9.33 6.81 2.82 6.69 -#> -#> $`theta[1]` -#> [1] 6.26 9.32 -0.97 12.45 9.75 2.56 11.92 9.89 4.31 9.26 -#> -#> $`theta[2]` -#> [1] 1.0 9.4 -1.2 12.5 11.9 -8.8 -6.1 11.6 2.8 8.4 -#> -#> # ... with 90 more iterations, and 2 more chains, and 6 more variables
-
+
+

Examples

+
x <- as_draws_list(example_draws())
+print(x)
+#> # A draws_list: 100 iterations, 4 chains, and 10 variables
+#> 
+#> [chain = 1]
+#> $mu
+#>  [1] 2.01 1.46 5.81 6.85 1.81 3.84 5.47 1.20 0.15 7.17
+#> 
+#> $tau
+#>  [1] 2.8 7.0 9.7 4.8 2.8 4.1 4.0 1.5 3.9 1.8
+#> 
+#> $`theta[1]`
+#>  [1]  3.96  0.12 21.25 14.70  5.96  5.76  4.03 -0.28  1.81  6.08
+#> 
+#> $`theta[2]`
+#>  [1]  0.271 -0.069 14.931  8.586  1.156  9.909  4.151  1.846  0.661  8.102
+#> 
+#> 
+#> [chain = 2]
+#> $mu
+#>  [1]   2.99   8.17  -1.15  10.93   9.82 -10.90  -9.26   1.79   5.35   0.87
+#> 
+#> $tau
+#>  [1] 2.80 2.76 0.57 2.45 2.80 6.08 9.33 6.81 2.82 6.69
+#> 
+#> $`theta[1]`
+#>  [1]  6.26  9.32 -0.97 12.45  9.75  2.56 11.92  9.89  4.31  9.26
+#> 
+#> $`theta[2]`
+#>  [1]  1.0  9.4 -1.2 12.5 11.9 -8.8 -6.1 11.6  2.8  8.4
+#> 
+#> # ... with 90 more iterations, and 2 more chains, and 6 more variables
+
+
+
+
- - - + + diff --git a/docs/reference/print.draws_matrix.html b/docs/reference/print.draws_matrix.html index 73713109..cf40186f 100644 --- a/docs/reference/print.draws_matrix.html +++ b/docs/reference/print.draws_matrix.html @@ -1,67 +1,12 @@ - - - - - - - -Print draws_matrix objects — print.draws_matrix • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Print draws_matrix objects — print.draws_matrix • posterior - - + + - - -
-
- -
- -
+
-

Pretty printing for draws_matrix objects.

+

Pretty printing for draws_matrix objects.

-
# S3 method for draws_matrix
-print(
-  x,
-  digits = 2,
-  max_draws = getOption("posterior.max_draws", 10),
-  max_variables = getOption("posterior.max_variables", 8),
-  reserved = FALSE,
-  ...
-)
+
+
# S3 method for draws_matrix
+print(
+  x,
+  digits = 2,
+  max_draws = getOption("posterior.max_draws", 10),
+  max_variables = getOption("posterior.max_variables", 8),
+  reserved = FALSE,
+  ...
+)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

digits

(nonnegative integer) The minimum number of significant digits -to print.

max_draws

(positive integer) The maximum number of draws to print. Can +

+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
digits
+

(nonnegative integer) The minimum number of significant digits +to print.

+
max_draws
+

(positive integer) The maximum number of draws to print. Can be controlled globally via the "posterior.max_draws" -option.

max_variables

(positive integer) The maximum number of variables to +option.

+
max_variables
+

(positive integer) The maximum number of variables to print. Can be controlled globally via the "posterior.max_variables" -option.

reserved

(logical) Should reserved variables be included in the -output? Defaults to FALSE. See reserved_variables for an overview of -currently reserved variable names.

...

Further arguments passed to the underlying print() methods.

- -

Value

- +option.

+
reserved
+

(logical) Should reserved variables be included in the +output? Defaults to FALSE. See reserved_variables for an overview of +currently reserved variable names.

+
...
+

Further arguments passed to the underlying print() methods.

+
+
+

Value

A draws object of the same class as x.

+
-

Examples

-
#> # A draws_matrix: 100 iterations, 4 chains, and 10 variables -#> variable -#> draw mu tau theta[1] theta[2] theta[3] theta[4] theta[5] theta[6] -#> 1 2.01 2.8 3.96 0.271 -0.74 2.1 0.923 1.7 -#> 2 1.46 7.0 0.12 -0.069 0.95 7.3 -0.062 11.3 -#> 3 5.81 9.7 21.25 14.931 1.83 1.4 0.531 7.2 -#> 4 6.85 4.8 14.70 8.586 2.67 4.4 4.758 8.1 -#> 5 1.81 2.8 5.96 1.156 3.11 2.0 0.769 4.7 -#> 6 3.84 4.1 5.76 9.909 -1.00 5.3 5.889 -1.7 -#> 7 5.47 4.0 4.03 4.151 10.15 6.6 3.741 -2.2 -#> 8 1.20 1.5 -0.28 1.846 0.47 4.3 1.467 3.3 -#> 9 0.15 3.9 1.81 0.661 0.86 4.5 -1.025 1.1 -#> 10 7.17 1.8 6.08 8.102 7.68 5.6 7.106 8.5 -#> # ... with 390 more draws, and 2 more variables
-
+
+

Examples

+
x <- as_draws_matrix(example_draws())
+print(x)
+#> # A draws_matrix: 100 iterations, 4 chains, and 10 variables
+#>     variable
+#> draw   mu tau theta[1] theta[2] theta[3] theta[4] theta[5] theta[6]
+#>   1  2.01 2.8     3.96    0.271    -0.74      2.1    0.923      1.7
+#>   2  1.46 7.0     0.12   -0.069     0.95      7.3   -0.062     11.3
+#>   3  5.81 9.7    21.25   14.931     1.83      1.4    0.531      7.2
+#>   4  6.85 4.8    14.70    8.586     2.67      4.4    4.758      8.1
+#>   5  1.81 2.8     5.96    1.156     3.11      2.0    0.769      4.7
+#>   6  3.84 4.1     5.76    9.909    -1.00      5.3    5.889     -1.7
+#>   7  5.47 4.0     4.03    4.151    10.15      6.6    3.741     -2.2
+#>   8  1.20 1.5    -0.28    1.846     0.47      4.3    1.467      3.3
+#>   9  0.15 3.9     1.81    0.661     0.86      4.5   -1.025      1.1
+#>   10 7.17 1.8     6.08    8.102     7.68      5.6    7.106      8.5
+#> # ... with 390 more draws, and 2 more variables
+
+
+
+
- - - + + diff --git a/docs/reference/print.draws_rvars.html b/docs/reference/print.draws_rvars.html index ba0aa603..28f8efed 100644 --- a/docs/reference/print.draws_rvars.html +++ b/docs/reference/print.draws_rvars.html @@ -1,67 +1,12 @@ - - - - - - - -Print draws_rvars objects — print.draws_rvars • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Print draws_rvars objects — print.draws_rvars • posterior - - + + - - -
-
- -
- -
+
-

Pretty printing for draws_rvars objects.

+

Pretty printing for draws_rvars objects.

-
# S3 method for draws_rvars
-print(
-  x,
-  digits = 2,
-  max_variables = getOption("posterior.max_variables", 8),
-  summary = getOption("posterior.rvar_summary", "mean_sd"),
-  reserved = FALSE,
-  ...
-)
+
+
# S3 method for draws_rvars
+print(
+  x,
+  digits = 2,
+  max_variables = getOption("posterior.max_variables", 8),
+  summary = getOption("posterior.rvar_summary", "mean_sd"),
+  reserved = FALSE,
+  ...
+)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

digits

(nonnegative integer) The minimum number of significant digits -to print.

max_variables

(positive integer) The maximum number of variables to +

+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
digits
+

(nonnegative integer) The minimum number of significant digits +to print.

+
max_variables
+

(positive integer) The maximum number of variables to print. Can be controlled globally via the "posterior.max_variables" -option.

summary

(string) The style of summary to display: "mean_sd" displays +option.

+
summary
+

(string) The style of summary to display: "mean_sd" displays mean±sd, "median_mad" displays median±mad. If NULL, -getOption("posterior.rvar_summary") is used (default "mean_sd).

reserved

(logical) Should reserved variables be included in the -output? Defaults to FALSE. See reserved_variables for an overview of -currently reserved variable names.

...

Further arguments passed to the underlying print() methods.

- -

Value

- +getOption("posterior.rvar_summary") is used (default "mean_sd).

+
reserved
+

(logical) Should reserved variables be included in the +output? Defaults to FALSE. See reserved_variables for an overview of +currently reserved variable names.

+
...
+

Further arguments passed to the underlying print() methods.

+
+
+

Value

A draws object of the same class as x.

+
-

Examples

-
#> # A draws_rvars: 100 iterations, 4 chains, and 3 variables -#> $mu: rvar<100,4>[1] mean ± sd: -#> [1] 4.2 ± 3.4 -#> -#> $tau: rvar<100,4>[1] mean ± sd: -#> [1] 4.2 ± 3.6 -#> -#> $theta: rvar<100,4>[8] mean ± sd: -#> [1] 6.7 ± 6.3 5.3 ± 4.6 3.0 ± 6.8 4.9 ± 4.9 3.2 ± 5.1 4.0 ± 5.2 6.5 ± 5.3 -#> [8] 4.6 ± 5.3 -#>
-
+
+

Examples

+
x <- as_draws_rvars(example_draws())
+print(x)
+#> # A draws_rvars: 100 iterations, 4 chains, and 3 variables
+#> $mu: rvar<100,4>[1] mean ± sd:
+#> [1] 4.2 ± 3.4 
+#> 
+#> $tau: rvar<100,4>[1] mean ± sd:
+#> [1] 4.2 ± 3.6 
+#> 
+#> $theta: rvar<100,4>[8] mean ± sd:
+#> [1] 6.7 ± 6.3  5.3 ± 4.6  3.0 ± 6.8  4.9 ± 4.9  3.2 ± 5.1  4.0 ± 5.2  6.5 ± 5.3 
+#> [8] 4.6 ± 5.3 
+#> 
+
+
+
+
- - - + + diff --git a/docs/reference/print.rvar.html b/docs/reference/print.rvar.html index 8d312e49..76a5ab7b 100644 --- a/docs/reference/print.rvar.html +++ b/docs/reference/print.rvar.html @@ -1,67 +1,12 @@ - - - - - - - -Print or format a random variable — print.rvar • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Print or format a random variable — print.rvar • posterior + + - - - - -
-
- -
- -
+
-

Printing and formatting methods for rvars.

+

Printing and formatting methods for rvars.

-
# S3 method for rvar
-print(x, ..., summary = NULL, digits = 2, color = TRUE)
-
-# S3 method for rvar
-format(x, ..., summary = NULL, digits = 2, color = FALSE)
-
-# S3 method for rvar
-str(
-  object,
-  ...,
-  summary = NULL,
-  vec.len = NULL,
-  indent.str = paste(rep.int(" ", max(0, nest.lev + 1)), collapse = ".."),
-  nest.lev = 0,
-  give.attr = TRUE
-)
+
+
# S3 method for rvar
+print(x, ..., summary = NULL, digits = 2, color = TRUE)
+
+# S3 method for rvar
+format(x, ..., summary = NULL, digits = 2, color = FALSE)
+
+# S3 method for rvar
+str(
+  object,
+  ...,
+  summary = NULL,
+  vec.len = NULL,
+  indent.str = paste(rep.int(" ", max(0, nest.lev + 1)), collapse = ".."),
+  nest.lev = 0,
+  give.attr = TRUE
+)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
x, object

(rvar) The rvar to print.

...

Further arguments passed to the underlying print() methods.

summary

(string) The style of summary to display: "mean_sd" displays +

+

Arguments

+
x, object
+

(rvar) The rvar to print.

+
...
+

Further arguments passed to the underlying print() methods.

+
summary
+

(string) The style of summary to display: "mean_sd" displays mean±sd, "median_mad" displays median±mad. If NULL, -getOption("posterior.rvar_summary") is used (default "mean_sd).

digits

(nonnegative integer) The minimum number of significant digits -to print.

color

(logical) Whether or not to use color when formatting the -output. If TRUE, the pillar::style_num() functions may be used to +getOption("posterior.rvar_summary") is used (default "mean_sd).

+
digits
+

(nonnegative integer) The minimum number of significant digits +to print.

+
color
+

(logical) Whether or not to use color when formatting the +output. If TRUE, the pillar::style_num() functions may be used to produce strings containing control sequences to produce colored output on -the terminal.

vec.len

(nonnegative integer) How many 'first few' elements are +the terminal.

+
vec.len
+

(nonnegative integer) How many 'first few' elements are displayed of each vector. If NULL, defaults to -getOption("str")$vec.len, which defaults to 4.

indent.str

(string) The indentation string to use.

nest.lev

(nonnegative integer) Current nesting level in the recursive -calls to str().

give.attr

(logical) If TRUE (default), show attributes as sub -structures.

- -

Value

- -

For print(), an invisible version of the input object.

-

For str(), nothing; i.e. invisible(NULL).

-

For format(), a character vector of the same dimensions as x where each +getOption("str")$vec.len, which defaults to 4.

+
indent.str
+

(string) The indentation string to use.

+
nest.lev
+

(nonnegative integer) Current nesting level in the recursive +calls to str().

+
give.attr
+

(logical) If TRUE (default), show attributes as sub +structures.

+
+
+

Value

+

For print(), an invisible version of the input object. +For str(), nothing; i.e. invisible(NULL). +For format(), a character vector of the same dimensions as x where each entry is of the form "mean±sd" or "median±mad", depending on the value of summary.

-

Details

- -

print() and str() print out rvar objects by summarizing each element +

+
+

Details

+

print() and str() print out rvar objects by summarizing each element in the random variable with either its mean±sd or median±mad, depending on -the value of summary. Both functions use the format() implementation for -rvar objects under the hood, which returns a character vector in the +the value of summary. Both functions use the format() implementation for +rvar objects under the hood, which returns a character vector in the mean±sd or median±mad form.

+
-

Examples

-
-set.seed(5678) -x = rbind( - cbind(rvar(rnorm(1000, 1)), rvar(rnorm(1000, 2))), - cbind(rvar(rnorm(1000, 3)), rvar(rnorm(1000, 4))) -) - -print(x) -
#> rvar<1000>[2,2] mean ± sd: -#> [,1] [,2] -#> [1,] 1 ± 1.01 2 ± 0.99 -#> [2,] 3 ± 1.00 4 ± 1.03
print(x, summary = "median_mad") -
#> rvar<1000>[2,2] median ± mad: -#> [,1] [,2] -#> [1,] 1.0 ± 1.00 2.0 ± 0.98 -#> [2,] 3.0 ± 1.03 3.9 ± 1.02
-str(x) -
#> rvar<1000>[2,2] 1 ± 1.01 3 ± 1.00 2 ± 0.99 4 ± 1.03
-format(x) -
#> [,1] [,2] -#> [1,] "1 ± 1.01" "2 ± 0.99" -#> [2,] "3 ± 1.00" "4 ± 1.03"
-
+
+

Examples

+

+set.seed(5678)
+x = rbind(
+  cbind(rvar(rnorm(1000, 1)), rvar(rnorm(1000, 2))),
+  cbind(rvar(rnorm(1000, 3)), rvar(rnorm(1000, 4)))
+)
+
+print(x)
+#> rvar<1000>[2,2] mean ± sd:
+#>      [,1]      [,2]     
+#> [1,] 1 ± 1.01  2 ± 0.99 
+#> [2,] 3 ± 1.00  4 ± 1.03 
+print(x, summary = "median_mad")
+#> rvar<1000>[2,2] median ± mad:
+#>      [,1]        [,2]       
+#> [1,] 1.0 ± 1.00  2.0 ± 0.98 
+#> [2,] 3.0 ± 1.03  3.9 ± 1.02 
+
+str(x)
+#>  rvar<1000>[2,2]  1 ± 1.01  3 ± 1.00  2 ± 0.99  4 ± 1.03
+
+format(x)
+#>      [,1]       [,2]      
+#> [1,] "1 ± 1.01" "2 ± 0.99"
+#> [2,] "3 ± 1.00" "4 ± 1.03"
+
+
+
+
- - - + + diff --git a/docs/reference/quantile2.html b/docs/reference/quantile2.html index 42ec6f89..57238b77 100644 --- a/docs/reference/quantile2.html +++ b/docs/reference/quantile2.html @@ -1,68 +1,13 @@ - - - - - - - -Compute Quantiles — quantile2 • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Compute Quantiles — quantile2 • posterior - - + + - - -
-
- -
- -
+
@@ -173,84 +109,73 @@

Compute Quantiles

with other summary functions in the posterior package.

-
quantile2(x, probs = c(0.05, 0.95), na.rm = FALSE, ...)
+    
+
quantile2(x, probs = c(0.05, 0.95), na.rm = FALSE, ...)
 
-# S3 method for default
-quantile2(x, probs = c(0.05, 0.95), na.rm = FALSE, names = TRUE, ...)
+# S3 method for default
+quantile2(x, probs = c(0.05, 0.95), na.rm = FALSE, names = TRUE, ...)
 
-# S3 method for rvar
-quantile2(x, probs = c(0.05, 0.95), na.rm = FALSE, names = TRUE, ...)
+# S3 method for rvar +quantile2(x, probs = c(0.05, 0.95), na.rm = FALSE, names = TRUE, ...)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - -
x

(multiple options) One of:

probs

(numeric vector) Probabilities in [0, 1].

na.rm

(logical) Should NA and NaN values be removed from x prior -to computing quantiles? The default is FALSE.

...

Arguments passed to individual methods (if applicable) and then -on to stats::quantile().

names

(logical) Should the result have a names attribute? The +

+

Arguments

+
x
+

(multiple options) One of:

+
probs
+

(numeric vector) Probabilities in [0, 1].

+
na.rm
+

(logical) Should NA and NaN values be removed from x prior +to computing quantiles? The default is FALSE.

+
...
+

Arguments passed to individual methods (if applicable) and then +on to stats::quantile().

+
names
+

(logical) Should the result have a names attribute? The default is TRUE, but use FALSE for improved speed if there are many -values in probs.

- -

Value

- -

A numeric vector of length length(probs). If names = TRUE, it has a -names attribute with names like "q5", "q95", etc, based on the values +values in probs.

+
+
+

Value

+

A numeric vector of length length(probs). If names = TRUE, it has a +names attribute with names like "q5", "q95", etc, based on the values of probs.

+
-

Examples

-
mu <- extract_variable_matrix(example_draws(), "mu") -quantile2(mu) -
#> q5 q95 -#> -0.8536202 9.3873124
-
+
+

Examples

+
mu <- extract_variable_matrix(example_draws(), "mu")
+quantile2(mu)
+#>         q5        q95 
+#> -0.8536202  9.3873124 
+
+
+
+ - - - + + diff --git a/docs/reference/r_scale.html b/docs/reference/r_scale.html index 5f265969..3928fbc5 100644 --- a/docs/reference/r_scale.html +++ b/docs/reference/r_scale.html @@ -1,69 +1,14 @@ - - - - - - - -Rank values — r_scale • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Rank values — r_scale • posterior - - - - - - - - - - + + - - - -
-
- -
- -
+
@@ -175,47 +111,42 @@

Rank values

number of unique values of discrete quantities.

-
r_scale(x)
- -

Arguments

- - - - - - -
x

(numeric) A scalar, vector, matrix, or array of values.

- -

Value

+
+
r_scale(x)
+
+
+

Arguments

+
x
+

(numeric) A scalar, vector, matrix, or array of values.

+
+
+

Value

A numeric array of ranked values with the same size and dimension as the input.

+
+
- - - + + diff --git a/docs/reference/rdo.html b/docs/reference/rdo.html index 45c1a2b7..b301b5fa 100644 --- a/docs/reference/rdo.html +++ b/docs/reference/rdo.html @@ -1,68 +1,13 @@ - - - - - - - -Execute expressions of random variables — rdo • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Execute expressions of random variables — rdo • posterior + + - - - - -
-
- -
- -
+
-

Execute (nearly) arbitrary R expressions that may include rvars, -producing a new rvar.

+

Execute (nearly) arbitrary R expressions that may include rvars, +producing a new rvar.

-
rdo(expr, dim = NULL, ndraws = NULL)
+
+
rdo(expr, dim = NULL, ndraws = NULL)
+
-

Arguments

- - - - - - - - - - - - - - -
expr

(expression) A bare expression that can (optionally) contain -rvars. The expression supports quasiquotation.

dim

(integer vector) One or more integers giving the maximal indices -in each dimension to override the dimensions of the rvar to be created -(see dim()). If NULL (the default), dim is determined by the input. -NOTE: This argument controls the dimensions of the rvar, not the +

+

Arguments

+
expr
+

(expression) A bare expression that can (optionally) contain +rvars. The expression supports quasiquotation.

+
dim
+

(integer vector) One or more integers giving the maximal indices +in each dimension to override the dimensions of the rvar to be created +(see dim()). If NULL (the default), dim is determined by the input. +NOTE: This argument controls the dimensions of the rvar, not the underlying array, so you cannot change the number of draws using this -argument.

ndraws

(positive integer) The number of draws used to construct new -random variables if no rvars are supplied in expr. If NULL, -getOption("posterior.rvar_ndraws") is used (default 4000). If expr -contains rvars, the number of draws in the provided rvars is used -instead of the value of this argument.

- -

Value

- -

An rvar.

-

Details

- +argument.

+
ndraws
+

(positive integer) The number of draws used to construct new +random variables if no rvars are supplied in expr. If NULL, +getOption("posterior.rvar_ndraws") is used (default 4000). If expr +contains rvars, the number of draws in the provided rvars is used +instead of the value of this argument.

+
+
+

Value

+

An rvar.

+
+
+

Details

This function evaluates expr possibly multiple times, once for each draw of -the rvars it contains, then returns a new rvar representing the output of those -expressions. To identify rvars, rdo() searches the calling environment for any variables -named in expr for which is_rvar() evaluates to TRUE. If expr contains no rvars, -then it will be executed ndraws times and an rvar with that many draws returned.

+the rvars it contains, then returns a new rvar representing the output of those +expressions. To identify rvars, rdo() searches the calling environment for any variables +named in expr for which is_rvar() evaluates to TRUE. If expr contains no rvars, +then it will be executed ndraws times and an rvar with that many draws returned.

rdo() is not necessarily fast (in fact in some cases it may be very slow), but -it has the advantage of allowing a nearly arbitrary R expression to be executed against rvars +it has the advantage of allowing a nearly arbitrary R expression to be executed against rvars simply by wrapping it with rdo( ... ). This makes it especially useful as a prototyping tool. If you create code with rdo() and it is unacceptably slow for your application, -consider rewriting it using math operations directly on rvars (which should be fast), -using rvar_rng(), and/or using operations directly on the arrays that back the rvars -(via draws_of()).

-

See also

- -

Other rfun: -rfun(), -rvar_rng()

+consider rewriting it using math operations directly on rvars (which should be fast), +using rvar_rng(), and/or using operations directly on the arrays that back the rvars +(via draws_of()).

+
+
+

See also

+

Other rfun: +rfun(), +rvar_rng()

+
-

Examples

-
-mu <- rdo(rnorm(10, mean = 1:10, sd = 1)) -sigma <- rdo(rgamma(1, shape = 1, rate = 1)) -x <- rdo(rnorm(10, mu, sigma)) -x -
#> rvar<4000>[10] mean ± sd: -#> [1] 1.0 ± 1.7 1.9 ± 1.7 3.0 ± 1.7 4.0 ± 1.6 5.0 ± 1.7 6.0 ± 1.7 -#> [7] 7.0 ± 1.7 8.1 ± 1.7 9.0 ± 1.7 10.0 ± 1.8
-
+
+

Examples

+

+mu <- rdo(rnorm(10, mean = 1:10, sd = 1))
+sigma <- rdo(rgamma(1, shape = 1, rate = 1))
+x <- rdo(rnorm(10, mu, sigma))
+x
+#> rvar<4000>[10] mean ± sd:
+#>  [1]  1.0 ± 1.7   1.9 ± 1.7   3.0 ± 1.7   4.0 ± 1.6   5.0 ± 1.7   6.0 ± 1.7 
+#>  [7]  7.0 ± 1.7   8.1 ± 1.7   9.0 ± 1.7  10.0 ± 1.8 
+
+
+
+
- - - + + diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index df463f6b..776ac8a1 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -1,72 +1,19 @@ - - - - - - - -Objects exported from other packages — reexports • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Objects exported from other packages — reexports • posterior - - - - - - - - - - - - + + -
-
- -
- -
+

These objects are imported from other packages. Follow the links below to see their documentation.

-
-
distributional

cdf, variance

+
distributional
+

cdf, variance

-
-
+
+
- - - + + diff --git a/docs/reference/rename_variables.html b/docs/reference/rename_variables.html index 321496a2..ecc1cbc0 100644 --- a/docs/reference/rename_variables.html +++ b/docs/reference/rename_variables.html @@ -1,67 +1,12 @@ - - - - - - - -Rename variables in draws objects — rename_variables • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Rename variables in draws objects — rename_variables • posterior + + - - - - -
-
- -
- -
+
-

Rename variables in a draws object.

+

Rename variables in a draws object.

+
+ +
+
rename_variables(.x, ...)
+
+# S3 method for draws
+rename_variables(.x, ...)
-
rename_variables(.x, ...)
-
-# S3 method for draws
-rename_variables(.x, ...)
- -

Arguments

- - - - - - - - - - -
.x

(draws) A draws object.

...

One or more expressions, separated by commas, indicating the +

+

Arguments

+
.x
+

(draws) A draws object.

+
...
+

One or more expressions, separated by commas, indicating the variables to rename. The variable names can be unquoted (new_name = old_name) or quoted ("new_name" = "old_name"). For non-scalar variables, all elements can be renamed together ("new_name" = "old_name") -or they can be renamed individually ("new_name[1]" = "old_name[1]").

- -

Value

- -

Returns a draws object of the same format as .x, with variables renamed +or they can be renamed individually ("new_name[1]" = "old_name[1]").

+
+
+

Value

+

Returns a draws object of the same format as .x, with variables renamed according to the expressions provided in ....

-

See also

- - - -

Examples

-
#> [1] "mu" "tau" "theta[1]" "theta[2]" "theta[3]" "theta[4]" -#> [7] "theta[5]" "theta[6]" "theta[7]" "theta[8]"
-x <- rename_variables(x, mean = mu, sigma = tau) -variables(x) -
#> [1] "mean" "sigma" "theta[1]" "theta[2]" "theta[3]" "theta[4]" -#> [7] "theta[5]" "theta[6]" "theta[7]" "theta[8]"
-x <- rename_variables(x, b = `theta[1]`) # or b = "theta[1]" -variables(x) -
#> [1] "mean" "sigma" "b" "theta[2]" "theta[3]" "theta[4]" -#> [7] "theta[5]" "theta[6]" "theta[7]" "theta[8]"
-# rename all elements of 'theta' at once -x <- rename_variables(x, alpha = theta) -variables(x) -
#> [1] "mean" "sigma" "b" "alpha[2]" "alpha[3]" "alpha[4]" -#> [7] "alpha[5]" "alpha[6]" "alpha[7]" "alpha[8]"
-
+
+
+

See also

+ +
+ +
+

Examples

+
x <- as_draws_df(example_draws())
+variables(x)
+#>  [1] "mu"       "tau"      "theta[1]" "theta[2]" "theta[3]" "theta[4]"
+#>  [7] "theta[5]" "theta[6]" "theta[7]" "theta[8]"
+
+x <- rename_variables(x, mean = mu, sigma = tau)
+variables(x)
+#>  [1] "mean"     "sigma"    "theta[1]" "theta[2]" "theta[3]" "theta[4]"
+#>  [7] "theta[5]" "theta[6]" "theta[7]" "theta[8]"
+
+x <- rename_variables(x, b = `theta[1]`) # or b  = "theta[1]"
+variables(x)
+#>  [1] "mean"     "sigma"    "b"        "theta[2]" "theta[3]" "theta[4]"
+#>  [7] "theta[5]" "theta[6]" "theta[7]" "theta[8]"
+
+# rename all elements of 'theta' at once
+x <- rename_variables(x, alpha = theta)
+variables(x)
+#>  [1] "mean"     "sigma"    "b"        "alpha[2]" "alpha[3]" "alpha[4]"
+#>  [7] "alpha[5]" "alpha[6]" "alpha[7]" "alpha[8]"
+
+
+
+
- - - + + diff --git a/docs/reference/repair_draws.html b/docs/reference/repair_draws.html index 2880b0a8..cfecf3b6 100644 --- a/docs/reference/repair_draws.html +++ b/docs/reference/repair_draws.html @@ -1,68 +1,13 @@ - - - - - - - -Repair indices of draws objects — repair_draws • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Repair indices of draws objects — repair_draws • posterior - - + + - - -
-
- -
- -
+
@@ -173,165 +109,161 @@

Repair indices of draws objects

are continuously and consistently numbered.

-
repair_draws(x, order = TRUE, ...)
-
-# S3 method for draws_matrix
-repair_draws(x, order = TRUE, ...)
+    
+
repair_draws(x, order = TRUE, ...)
 
-# S3 method for draws_array
-repair_draws(x, order = TRUE, ...)
+# S3 method for draws_matrix
+repair_draws(x, order = TRUE, ...)
 
-# S3 method for draws_df
-repair_draws(x, order = TRUE, ...)
+# S3 method for draws_array
+repair_draws(x, order = TRUE, ...)
 
-# S3 method for draws_list
-repair_draws(x, order = TRUE, ...)
+# S3 method for draws_df
+repair_draws(x, order = TRUE, ...)
 
-# S3 method for draws_rvars
-repair_draws(x, order = TRUE, ...)
+# S3 method for draws_list
+repair_draws(x, order = TRUE, ...)
 
-# S3 method for rvar
-repair_draws(x, order = TRUE, ...)
+# S3 method for draws_rvars +repair_draws(x, order = TRUE, ...) -

Arguments

- - - - - - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

order

(logical) Should draws be ordered (via order_draws()) before -repairing indices? Defaults to TRUE.

...

Arguments passed to individual methods (if applicable).

- -

Value

+# S3 method for rvar +repair_draws(x, order = TRUE, ...)
+
+
+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
order
+

(logical) Should draws be ordered (via order_draws()) before +repairing indices? Defaults to TRUE.

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

A draws object of the same class as x.

-

See also

- - +
+
+

See also

+ +
-

Examples

-
x <- as_draws_array(example_draws()) -(x <- x[10:5, 3:4, ]) -
#> # A draws_array: 6 iterations, 2 chains, and 10 variables -#> , , variable = mu -#> -#> chain -#> iteration 3 4 -#> 10 8.9 3.81 -#> 9 8.9 0.88 -#> 8 3.5 4.90 -#> 7 3.7 11.82 -#> 6 1.1 2.38 -#> -#> , , variable = tau -#> -#> chain -#> iteration 3 4 -#> 10 5.96 2.7 -#> 9 5.96 15.8 -#> 8 0.52 3.1 -#> 7 1.68 4.3 -#> 6 2.70 2.3 -#> -#> , , variable = theta[1] -#> -#> chain -#> iteration 3 4 -#> 10 13.1 7.52 -#> 9 13.1 9.07 -#> 8 3.7 1.50 -#> 7 5.2 18.87 -#> 6 5.0 0.59 -#> -#> , , variable = theta[2] -#> -#> chain -#> iteration 3 4 -#> 10 4.7 4.3 -#> 9 4.7 11.6 -#> 8 4.1 6.1 -#> 7 4.1 13.0 -#> 6 4.3 1.1 -#> -#> # ... with 1 more iterations, and 6 more variables
repair_draws(x) -
#> # A draws_array: 6 iterations, 2 chains, and 10 variables -#> , , variable = mu -#> -#> chain -#> iteration 1 2 -#> 1 -0.03 5.48 -#> 2 1.06 2.38 -#> 3 3.67 11.82 -#> 4 3.51 4.90 -#> 5 8.85 0.88 -#> -#> , , variable = tau -#> -#> chain -#> iteration 1 2 -#> 1 11.03 3.0 -#> 2 2.70 2.3 -#> 3 1.68 4.3 -#> 4 0.52 3.1 -#> 5 5.96 15.8 -#> -#> , , variable = theta[1] -#> -#> chain -#> iteration 1 2 -#> 1 8.2 -0.91 -#> 2 5.0 0.59 -#> 3 5.2 18.87 -#> 4 3.7 1.50 -#> 5 13.1 9.07 -#> -#> , , variable = theta[2] -#> -#> chain -#> iteration 1 2 -#> 1 3.2 3.2 -#> 2 4.3 1.1 -#> 3 4.1 13.0 -#> 4 4.1 6.1 -#> 5 4.7 11.6 -#> -#> # ... with 1 more iterations, and 6 more variables
-
+
+

Examples

+
x <- as_draws_array(example_draws())
+(x <- x[10:5, 3:4, ])
+#> # A draws_array: 6 iterations, 2 chains, and 10 variables
+#> , , variable = mu
+#> 
+#>          chain
+#> iteration   3     4
+#>        10 8.9  3.81
+#>        9  8.9  0.88
+#>        8  3.5  4.90
+#>        7  3.7 11.82
+#>        6  1.1  2.38
+#> 
+#> , , variable = tau
+#> 
+#>          chain
+#> iteration    3    4
+#>        10 5.96  2.7
+#>        9  5.96 15.8
+#>        8  0.52  3.1
+#>        7  1.68  4.3
+#>        6  2.70  2.3
+#> 
+#> , , variable = theta[1]
+#> 
+#>          chain
+#> iteration    3     4
+#>        10 13.1  7.52
+#>        9  13.1  9.07
+#>        8   3.7  1.50
+#>        7   5.2 18.87
+#>        6   5.0  0.59
+#> 
+#> , , variable = theta[2]
+#> 
+#>          chain
+#> iteration   3    4
+#>        10 4.7  4.3
+#>        9  4.7 11.6
+#>        8  4.1  6.1
+#>        7  4.1 13.0
+#>        6  4.3  1.1
+#> 
+#> # ... with 1 more iterations, and 6 more variables
+repair_draws(x)
+#> # A draws_array: 6 iterations, 2 chains, and 10 variables
+#> , , variable = mu
+#> 
+#>          chain
+#> iteration     1     2
+#>         1 -0.03  5.48
+#>         2  1.06  2.38
+#>         3  3.67 11.82
+#>         4  3.51  4.90
+#>         5  8.85  0.88
+#> 
+#> , , variable = tau
+#> 
+#>          chain
+#> iteration     1    2
+#>         1 11.03  3.0
+#>         2  2.70  2.3
+#>         3  1.68  4.3
+#>         4  0.52  3.1
+#>         5  5.96 15.8
+#> 
+#> , , variable = theta[1]
+#> 
+#>          chain
+#> iteration    1     2
+#>         1  8.2 -0.91
+#>         2  5.0  0.59
+#>         3  5.2 18.87
+#>         4  3.7  1.50
+#>         5 13.1  9.07
+#> 
+#> , , variable = theta[2]
+#> 
+#>          chain
+#> iteration   1    2
+#>         1 3.2  3.2
+#>         2 4.3  1.1
+#>         3 4.1 13.0
+#>         4 4.1  6.1
+#>         5 4.7 11.6
+#> 
+#> # ... with 1 more iterations, and 6 more variables
+
+
+
+ - - - + + diff --git a/docs/reference/resample_draws.html b/docs/reference/resample_draws.html index 3990343d..dd79fcdf 100644 --- a/docs/reference/resample_draws.html +++ b/docs/reference/resample_draws.html @@ -1,68 +1,13 @@ - - - - - - - -Resample draws objects — resample_draws • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Resample draws objects — resample_draws • posterior - - + + - - -
-
- -
- -
+
-

Resample draws objects according to provided weights, for example weights +

Resample draws objects according to provided weights, for example weights obtained through importance sampling.

-
resample_draws(x, ...)
+    
+
resample_draws(x, ...)
 
-# S3 method for draws
-resample_draws(x, weights = NULL, method = "stratified", ndraws = NULL, ...)
+# S3 method for draws +resample_draws(x, weights = NULL, method = "stratified", ndraws = NULL, ...)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

...

Arguments passed to individual methods (if applicable).

weights

(numeric vector) A vector of positive weights of length -ndraws(x). The weights will be internally normalized. If weights is not +

+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
...
+

Arguments passed to individual methods (if applicable).

+
weights
+

(numeric vector) A vector of positive weights of length +ndraws(x). The weights will be internally normalized. If weights is not specified, an attempt will be made to extract any weights already stored in -the draws object (via weight_draws()). How exactly the weights influence -the resampling depends on the method argument.

method

(string) The resampling method to use:

    -
  • "simple": simple random resampling with replacement

  • +the draws object (via weight_draws()). How exactly the weights influence +the resampling depends on the method argument.

    +
    method
    +

    (string) The resampling method to use:

    • "simple": simple random resampling with replacement

    • "simple_no_replace": simple random resampling without replacement

    • "stratified": stratified resampling with replacement

    • "deterministic": deterministic resampling with replacement

    • -
    - -

    Currently, "stratified" is the default as it has comparably low variance +

Currently, "stratified" is the default as it has comparably low variance and bias with respect to ideal resampling. The latter would sample perfectly proportional to the weights, but this is not possible in practice due to the finite number of draws available. For more details about resampling methods, -see Kitagawa (1996).

ndraws

(positive integer) The number of draws to be returned. By +see Kitagawa (1996).

+
ndraws
+

(positive integer) The number of draws to be returned. By default ndraws is set internally to the total number of draws in x if -sensible.

- -

Value

- +sensible.

+
+
+

Value

A draws object of the same class as x.

-

Details

- +
+
+

Details

Upon usage of resample_draws(), chains will automatically be merged -due to subsetting of individual draws (see subset_draws for details). +due to subsetting of individual draws (see subset_draws for details). Also, weights stored in the draws object will be removed in the process, as resampling invalidates existing weights.

-

References

- +
+
+

References

Kitagawa, G., Monte Carlo Filter and Smoother for Non-Gaussian Nonlinear ' State Space Models, Journal of Computational and Graphical Statistics, 5(1):1-25, 1996.

-

See also

- -

resample_draws()

- -

Examples

-
x <- as_draws_df(example_draws()) - -# random weights for justr for demonstration -w <- runif(ndraws(x), 0, 10) +
+
+

See also

+

resample_draws()

+
-# use default stratified sampling -x_rs <- resample_draws(x, weights = w) -
#> Merging chains in order to subset via 'draw'.
#> # A tibble: 10 x 7 -#> variable mean median sd mad q5 q95 -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mu 4.24 4.59 3.45 3.25 -1.17 9.48 -#> 2 tau 4.54 3.49 3.81 3.29 0.307 11.7 -#> 3 theta[1] 7.08 6.23 6.51 5.22 -1.16 19.3 -#> 4 theta[2] 5.37 5.13 4.94 4.03 -2.32 14.2 -#> 5 theta[3] 2.96 4.13 7.31 5.22 -11.1 12.0 -#> 6 theta[4] 5.10 5.24 5.01 4.32 -3.63 12.3 -#> 7 theta[5] 2.89 3.57 5.35 4.54 -7.60 10.8 -#> 8 theta[6] 3.88 4.34 5.34 5.00 -6.04 11.1 -#> 9 theta[7] 6.88 6.73 5.29 4.60 -1.15 15.4 -#> 10 theta[8] 4.60 4.73 5.71 5.23 -5.31 14.5
-# use simple random sampling -x_rs <- resample_draws(x, weights = w, method = "simple") -
#> Merging chains in order to subset via 'draw'.
#> # A tibble: 10 x 7 -#> variable mean median sd mad q5 q95 -#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 mu 3.95 4.08 3.51 4.00 -1.16 8.74 -#> 2 tau 4.25 3.18 3.66 2.66 0.332 11.4 -#> 3 theta[1] 7.04 6.06 6.71 5.72 -1.19 20.1 -#> 4 theta[2] 4.66 4.73 4.68 4.51 -2.60 12.4 -#> 5 theta[3] 2.77 4.16 7.50 5.46 -11.1 11.6 -#> 6 theta[4] 4.99 5.50 4.89 4.49 -2.65 12.2 -#> 7 theta[5] 2.66 3.49 5.34 4.86 -6.86 10.6 -#> 8 theta[6] 3.71 4.07 5.14 4.92 -4.98 10.8 -#> 9 theta[7] 6.45 5.92 5.34 4.60 -1.43 14.8 -#> 10 theta[8] 4.34 4.76 5.56 5.22 -5.29 13.2
-
+
+

Examples

+
x <- as_draws_df(example_draws())
+
+# random weights for justr for demonstration
+w <- runif(ndraws(x), 0, 10)
+
+# use default stratified sampling
+x_rs <- resample_draws(x, weights = w)
+#> Merging chains in order to subset via 'draw'.
+summarise_draws(x_rs, default_summary_measures())
+#> # A tibble: 10 × 7
+#>    variable  mean median    sd   mad      q5   q95
+#>    <chr>    <dbl>  <dbl> <dbl> <dbl>   <dbl> <dbl>
+#>  1 mu        4.24   4.59  3.45  3.25  -1.17   9.48
+#>  2 tau       4.54   3.49  3.81  3.29   0.307 11.7 
+#>  3 theta[1]  7.08   6.23  6.51  5.22  -1.16  19.3 
+#>  4 theta[2]  5.37   5.13  4.94  4.03  -2.32  14.2 
+#>  5 theta[3]  2.96   4.13  7.31  5.22 -11.1   12.0 
+#>  6 theta[4]  5.10   5.24  5.01  4.32  -3.63  12.3 
+#>  7 theta[5]  2.89   3.57  5.35  4.54  -7.60  10.8 
+#>  8 theta[6]  3.88   4.34  5.34  5.00  -6.04  11.1 
+#>  9 theta[7]  6.88   6.73  5.29  4.60  -1.15  15.4 
+#> 10 theta[8]  4.60   4.73  5.71  5.23  -5.31  14.5 
+
+# use simple random sampling
+x_rs <- resample_draws(x, weights = w, method = "simple")
+#> Merging chains in order to subset via 'draw'.
+summarise_draws(x_rs, default_summary_measures())
+#> # A tibble: 10 × 7
+#>    variable  mean median    sd   mad      q5   q95
+#>    <chr>    <dbl>  <dbl> <dbl> <dbl>   <dbl> <dbl>
+#>  1 mu        3.95   4.08  3.51  4.00  -1.16   8.74
+#>  2 tau       4.25   3.18  3.66  2.66   0.332 11.4 
+#>  3 theta[1]  7.04   6.06  6.71  5.72  -1.19  20.1 
+#>  4 theta[2]  4.66   4.73  4.68  4.51  -2.60  12.4 
+#>  5 theta[3]  2.77   4.16  7.50  5.46 -11.1   11.6 
+#>  6 theta[4]  4.99   5.50  4.89  4.49  -2.65  12.2 
+#>  7 theta[5]  2.66   3.49  5.34  4.86  -6.86  10.6 
+#>  8 theta[6]  3.71   4.07  5.14  4.92  -4.98  10.8 
+#>  9 theta[7]  6.45   5.92  5.34  4.60  -1.43  14.8 
+#> 10 theta[8]  4.34   4.76  5.56  5.22  -5.29  13.2 
+
+
+
+ - - - + + diff --git a/docs/reference/reserved_variables.html b/docs/reference/reserved_variables.html index ac762238..d12db960 100644 --- a/docs/reference/reserved_variables.html +++ b/docs/reference/reserved_variables.html @@ -1,67 +1,12 @@ - - - - - - - -Reserved variables — reserved_variables • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Reserved variables — reserved_variables • posterior + + - - - - -
-
- -
- -
+
@@ -171,96 +107,89 @@

Reserved variables

Get names of reserved variables from objects in the posterior package.

-
reserved_variables(x, ...)
-
-# S3 method for default
-reserved_variables(x, ...)
-
-# S3 method for draws_matrix
-reserved_variables(x, ...)
+    
+
reserved_variables(x, ...)
 
-# S3 method for draws_array
-reserved_variables(x, ...)
+# S3 method for default
+reserved_variables(x, ...)
 
-# S3 method for draws_df
-reserved_variables(x, ...)
+# S3 method for draws_matrix
+reserved_variables(x, ...)
 
-# S3 method for draws_list
-reserved_variables(x, ...)
+# S3 method for draws_array
+reserved_variables(x, ...)
 
-# S3 method for draws_rvars
-reserved_variables(x, ...)
+# S3 method for draws_df +reserved_variables(x, ...) -

Arguments

- - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

...

Arguments passed to individual methods (if applicable).

+# S3 method for draws_list +reserved_variables(x, ...) -

Value

+# S3 method for draws_rvars +reserved_variables(x, ...)
+
+
+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

A character vector of reserved variables used in x.

-

Details

- +
+
+

Details

reserved_variables() returns the names of reserved variables in use by an object.

The following variables names are currently reserved for special use cases -in all draws formats:

- -

Further, specific for the draws_df format, there are three additional -reserved variables:

    -
  • .chain: Chain index per draw

  • +in all draws formats:

    Further, specific for the draws_df format, there are three additional +reserved variables:

    • .chain: Chain index per draw

    • .iteration: Iteration index within each chain

    • .draw: Draw index across chains

    • -
    - -

    More reserved variables may be added in the future.

    +

More reserved variables may be added in the future.

+
-

Examples

-
-x <- example_draws() -reserved_variables(x) -
#> character(0)
-# if we add weights, the `.log_weight` reserved variable is used -x <- weight_draws(x, rexp(ndraws(x))) -
#> Loading required namespace: testthat
reserved_variables(x) -
#> [1] ".log_weight"
-
+
+

Examples

+

+x <- example_draws()
+reserved_variables(x)
+#> character(0)
+
+# if we add weights, the `.log_weight` reserved variable is used
+x <- weight_draws(x, rexp(ndraws(x)))
+#> Loading required namespace: testthat
+reserved_variables(x)
+#> [1] ".log_weight"
+
+
+
+ - - - + + diff --git a/docs/reference/rfun.html b/docs/reference/rfun.html index 3205442b..e522ece5 100644 --- a/docs/reference/rfun.html +++ b/docs/reference/rfun.html @@ -1,67 +1,12 @@ - - - - - - - -Create functions of random variables — rfun • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Create functions of random variables — rfun • posterior + + - - - - -
-
- -
- -
+
-

Function that create functions that can accept and/or produce rvars.

+

Function that create functions that can accept and/or produce rvars.

-
rfun(.f, rvar_args = NULL, ndraws = NULL)
+
+
rfun(.f, rvar_args = NULL, ndraws = NULL)
+
-

Arguments

- - - - - - - - - - - - - - -
.f

(multiple options) A function to turn into a function that accepts -and/or produces random variables:

rvar_args

(character vector) The names of the arguments of .f that -should be allowed to accept rvars as arguments. If NULL (the +

+

Arguments

+
.f
+

(multiple options) A function to turn into a function that accepts +and/or produces random variables:

+
rvar_args
+

(character vector) The names of the arguments of .f that +should be allowed to accept rvars as arguments. If NULL (the default), all arguments to .f are turned into arguments that accept -rvars.

ndraws

(positive integer). The number of draws used to construct new -random variables if no rvars are supplied as arguments to the -returned function. If NULL, getOption("posterior.rvar_ndraws") is used +rvars.

+
ndraws
+

(positive integer). The number of draws used to construct new +random variables if no rvars are supplied as arguments to the +returned function. If NULL, getOption("posterior.rvar_ndraws") is used (default 4000). If any arguments to the returned function contain -rvars, the number of draws in the provided rvars is used instead of -the value of this argument.

- -

Value

- +rvars, the number of draws in the provided rvars is used instead of +the value of this argument.

+
+
+

Value

A function with the same argument specification as .f, but which can accept and return -rvars.

-

Details

- -

This function wraps an existing function (.f) such that it returns rvars containing +rvars.

+
+
+

Details

+

This function wraps an existing function (.f) such that it returns rvars containing whatever type of data .f would normally return.

The returned function, when called, executes .f possibly multiple times, once for each draw of -the rvars passed to it, then returns a new -rvar representing the output of those function evaluations. If the arguments contain no rvars, -then .f will be executed ndraws times and an rvar with that many draws returned.

+the rvars passed to it, then returns a new +rvar representing the output of those function evaluations. If the arguments contain no rvars, +then .f will be executed ndraws times and an rvar with that many draws returned.

Functions created by rfun() are not necessarily fast (in fact in some cases they may be very slow), but -they have the advantage of allowing a nearly arbitrary R functions to be executed against rvars +they have the advantage of allowing a nearly arbitrary R functions to be executed against rvars simply by wrapping them with rfun(). This makes it especially useful as a prototyping tool. If you create code with rfun() and it is unacceptably slow for your application, -consider rewriting it using math operations directly on rvars (which should be fast), -using rvar_rng(), and/or using operations directly on the arrays that back the rvars -(via draws_of()).

-

See also

- -

Other rfun: -rdo(), -rvar_rng()

- -

Examples

-
-rvar_norm <- rfun(rnorm) -rvar_gamma <- rfun(rgamma) +consider rewriting it using math operations directly on rvars (which should be fast), +using rvar_rng(), and/or using operations directly on the arrays that back the rvars +(via draws_of()).

+
+
+

See also

+

Other rfun: +rdo(), +rvar_rng()

+
-mu <- rvar_norm(10, mean = 1:10, sd = 1) -sigma <- rvar_gamma(1, shape = 1, rate = 1) -x <- rvar_norm(10, mu, sigma) -x -
#> rvar<4000>[10] mean ± sd: -#> [1] 1.0 ± 1.7 2.0 ± 1.8 3.0 ± 1.7 3.9 ± 1.8 5.0 ± 1.8 6.0 ± 1.7 -#> [7] 7.0 ± 1.7 8.0 ± 1.8 9.0 ± 1.7 10.0 ± 1.7
-
+
+

Examples

+

+rvar_norm <- rfun(rnorm)
+rvar_gamma <- rfun(rgamma)
+
+mu <- rvar_norm(10, mean = 1:10, sd = 1)
+sigma <- rvar_gamma(1, shape = 1, rate = 1)
+x <- rvar_norm(10, mu, sigma)
+x
+#> rvar<4000>[10] mean ± sd:
+#>  [1]  1.0 ± 1.7   2.0 ± 1.8   3.0 ± 1.7   3.9 ± 1.8   5.0 ± 1.8   6.0 ± 1.7 
+#>  [7]  7.0 ± 1.7   8.0 ± 1.8   9.0 ± 1.7  10.0 ± 1.7 
+
+
+
+
- - - + + diff --git a/docs/reference/rhat.html b/docs/reference/rhat.html index b0ed78b5..ebf4683d 100644 --- a/docs/reference/rhat.html +++ b/docs/reference/rhat.html @@ -1,69 +1,14 @@ - - - - - - - -Rhat convergence diagnostic — rhat • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Rhat convergence diagnostic — rhat • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+

Compute the Rhat convergence diagnostic for a single variable as the maximum of rank normalized split-Rhat and rank normalized folded-split-Rhat as -proposed in Vehtari et al. (2019).

+proposed in Vehtari et al. (2021).

-
rhat(x, ...)
-
-# S3 method for default
-rhat(x, ...)
-
-# S3 method for rvar
-rhat(x, ...)
+
+
rhat(x, ...)
 
-    

Arguments

- - - - - - - - - - -
x

(multiple options) One of:

...

Arguments passed to individual methods (if applicable).

+# S3 method for default +rhat(x, ...) -

Value

+# S3 method for rvar +rhat(x, ...)
+
+
+

Arguments

+
x
+

(multiple options) One of:

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

If the input is an array, returns a single numeric value. If any of the draws is non-finite, that is, NA, NaN, Inf, or -Inf, the returned output will be (numeric) NA. Also, if all draws within any of the chains of a -variable are the same (constant), the returned output will be (numeric) NA -as well. The reason for the latter is that, for constant draws, we cannot +variable are the same (constant), the returned output will be (numeric) NAas well. The reason for the latter is that, for constant draws, we cannot distinguish between variables that are supposed to be constant (e.g., a diagonal element of a correlation matrix is always 1) or variables that just happened to be constant because of a failure of convergence or other problems -in the sampling process.

-

If the input is an rvar, returns an array of the same dimensions as the -rvar, where each element is equal to the value that would be returned by -passing the draws array for that element of the rvar to this function.

-

References

- +in the sampling process. +If the input is an rvar, returns an array of the same dimensions as the +rvar, where each element is equal to the value that would be returned by +passing the draws array for that element of the rvar to this function.

+
+
+

References

Aki Vehtari, Andrew Gelman, Daniel Simpson, Bob Carpenter, and -Paul-Christian Bürkner (2019). Rank-normalization, folding, and +Paul-Christian Bürkner (2021). Rank-normalization, folding, and localization: An improved R-hat for assessing convergence of -MCMC. arXiv preprint arXiv:1903.08008.

-

See also

- -

Other diagnostics: -ess_basic(), -ess_bulk(), -ess_quantile(), -ess_sd(), -ess_tail(), -mcse_mean(), -mcse_quantile(), -mcse_sd(), -rhat_basic(), -rstar()

+MCMC (with discussion). Bayesian Data Analysis. 16(2), 667-–718. +doi:10.1214/20-BA1221

+
+
+

See also

+

Other diagnostics: +ess_basic(), +ess_bulk(), +ess_quantile(), +ess_sd(), +ess_tail(), +mcse_mean(), +mcse_quantile(), +mcse_sd(), +rhat_basic(), +rstar()

+
-

Examples

-
mu <- extract_variable_matrix(example_draws(), "mu") -rhat(mu) -
#> [1] 1.021923
-d <- as_draws_rvars(example_draws("multi_normal")) -rhat(d$Sigma) -
#> [,1] [,2] [,3] -#> [1,] 1.001383 1.007945 1.0054123 -#> [2,] 1.007912 1.005208 1.0193824 -#> [3,] 1.005412 1.019382 0.9972943
-
+
+

Examples

+
mu <- extract_variable_matrix(example_draws(), "mu")
+rhat(mu)
+#> [1] 1.021923
+
+d <- as_draws_rvars(example_draws("multi_normal"))
+rhat(d$Sigma)
+#>          [,1]     [,2]      [,3]
+#> [1,] 1.001383 1.007945 1.0054123
+#> [2,] 1.007912 1.005208 1.0193824
+#> [3,] 1.005412 1.019382 0.9972943
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/rhat_basic.html b/docs/reference/rhat_basic.html index 7e30ea66..25b4b5e7 100644 --- a/docs/reference/rhat_basic.html +++ b/docs/reference/rhat_basic.html @@ -1,69 +1,15 @@ - - - - - - - -Basic version of the Rhat convergence diagnostic — rhat_basic • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Basic version of the Rhat convergence diagnostic — rhat_basic • posterior + + - - - - -
-
- -
- -
+

Compute the basic Rhat convergence diagnostic for a single variable as -described in Gelman et al. (2013). For practical applications, we strongly -recommend the improved Rhat convergence diagnostic implemented in rhat().

+described in Gelman et al. (2013) with some changes according to Vehtari et +al. (2021). For practical applications, we strongly recommend the improved +Rhat convergence diagnostic implemented in rhat().

-
rhat_basic(x, ...)
-
-# S3 method for default
-rhat_basic(x, split = TRUE, ...)
-
-# S3 method for rvar
-rhat_basic(x, split = TRUE, ...)
+
+
rhat_basic(x, ...)
 
-    

Arguments

- - - - - - - - - - - - - - -
x

(multiple options) One of:

...

Arguments passed to individual methods (if applicable).

split

(logical) Should the estimate be computed on split chains? The -default is TRUE.

+# S3 method for default +rhat_basic(x, split = TRUE, ...) -

Value

+# S3 method for rvar +rhat_basic(x, split = TRUE, ...)
+
+
+

Arguments

+
x
+

(multiple options) One of:

+
...
+

Arguments passed to individual methods (if applicable).

+
split
+

(logical) Should the estimate be computed on split chains? The +default is TRUE.

+
+
+

Value

If the input is an array, returns a single numeric value. If any of the draws is non-finite, that is, NA, NaN, Inf, or -Inf, the returned output will be (numeric) NA. Also, if all draws within any of the chains of a -variable are the same (constant), the returned output will be (numeric) NA -as well. The reason for the latter is that, for constant draws, we cannot +variable are the same (constant), the returned output will be (numeric) NAas well. The reason for the latter is that, for constant draws, we cannot distinguish between variables that are supposed to be constant (e.g., a diagonal element of a correlation matrix is always 1) or variables that just happened to be constant because of a failure of convergence or other problems -in the sampling process.

-

If the input is an rvar, returns an array of the same dimensions as the -rvar, where each element is equal to the value that would be returned by -passing the draws array for that element of the rvar to this function.

-

References

- +in the sampling process. +If the input is an rvar, returns an array of the same dimensions as the +rvar, where each element is equal to the value that would be returned by +passing the draws array for that element of the rvar to this function.

+
+
+

References

Andrew Gelman, John B. Carlin, Hal S. Stern, David B. Dunson, Aki Vehtari and -Donald B. Rubin (2013). Bayesian Data Analysis, Third Edition. Chapman and +Donald B. Rubin (2013). Bayesian Data Analysis, Third Edition. Chapman and Hall/CRC.

-

See also

- -

Other diagnostics: -ess_basic(), -ess_bulk(), -ess_quantile(), -ess_sd(), -ess_tail(), -mcse_mean(), -mcse_quantile(), -mcse_sd(), -rhat(), -rstar()

+

Aki Vehtari, Andrew Gelman, Daniel Simpson, Bob Carpenter, and +Paul-Christian Bürkner (2021). Rank-normalization, folding, and +localization: An improved R-hat for assessing convergence of +MCMC (with discussion). Bayesian Data Analysis. 16(2), 667-–718. +doi:10.1214/20-BA1221

+
+
+

See also

+

Other diagnostics: +ess_basic(), +ess_bulk(), +ess_quantile(), +ess_sd(), +ess_tail(), +mcse_mean(), +mcse_quantile(), +mcse_sd(), +rhat(), +rstar()

+
-

Examples

-
mu <- extract_variable_matrix(example_draws(), "mu") -rhat_basic(mu) -
#> [1] 0.9979106
-d <- as_draws_rvars(example_draws("multi_normal")) -rhat_basic(d$Sigma) -
#> [,1] [,2] [,3] -#> [1,] 0.9967529 0.9967817 1.0033460 -#> [2,] 0.9967817 0.9950557 0.9998587 -#> [3,] 1.0033460 0.9998587 0.9947308
-
+
+

Examples

+
mu <- extract_variable_matrix(example_draws(), "mu")
+rhat_basic(mu)
+#> [1] 0.9979106
+
+d <- as_draws_rvars(example_draws("multi_normal"))
+rhat_basic(d$Sigma)
+#>           [,1]      [,2]      [,3]
+#> [1,] 0.9967529 0.9967817 1.0033460
+#> [2,] 0.9967817 0.9950557 0.9998587
+#> [3,] 1.0033460 0.9998587 0.9947308
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/rstar-1.png b/docs/reference/rstar-1.png index ed517e8a3ff31a54c52915fda4a3722f0451468d..c62016e3fe5b611f549965055de8c275e62a5c1d 100644 GIT binary patch literal 27232 zcmeFZ2~<;Q*CvWXiIxUREk)*1RLT+rMdqohP*G9PVhDpwG6^9B#V{mHY8f1m6k>tM zBu+pA33Gsu0HPo=sd&N=l7I;42@nR8Kp@FI3E$V>*Q@X9)qmgq@4D-D9~TDBJMVYz zXFq$tFWf%oXb<~d?Ry0U1=y*R$No@I_%2pKVco@z8=yDL%)(jdW5Y!U`(w~2^eov? zlc0}HktaQ(6cjX5WM6CW<8wg@3O^~FI`*4OZ0-~*?qPU{$Cqgi`_!%@Yc?Ij{d^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Llcpn3y$XT0%&h7;3*cv~VTL4Wodr0~tZ6Ps2;d ycbn1<7in4(DMOHd;MD(1GVcE`wpre)+ - - - - - - -Calculate R* convergence diagnostic — rstar • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Calculate R* convergence diagnostic — rstar • posterior - - - - - - - - - - - + + - - -

-
- -
- -
+
@@ -181,71 +117,55 @@

Calculate R* convergence diagnostic

predicting a chain uniformly at random.

-
rstar(
-  x,
-  split = TRUE,
-  uncertainty = FALSE,
-  method = "rf",
-  hyperparameters = NULL,
-  training_proportion = 0.7,
-  nsimulations = 1000,
-  ...
-)
+
+
rstar(
+  x,
+  split = TRUE,
+  uncertainty = FALSE,
+  method = "rf",
+  hyperparameters = NULL,
+  training_proportion = 0.7,
+  nsimulations = 1000,
+  ...
+)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
x

(draws) A draws_df object or one coercible to a draws_df object.

split

(logical) Should the estimate be computed on split chains? The -default is TRUE.

uncertainty

(logical). Indicates whether to provide a vector of R* +

+

Arguments

+
x
+

(draws) A draws_df object or one coercible to a draws_df object.

+
split
+

(logical) Should the estimate be computed on split chains? The +default is TRUE.

+
uncertainty
+

(logical). Indicates whether to provide a vector of R* values representing uncertainty in the calculated value (if TRUE) or a -single value (if FALSE). The default is TRUE.

method

(string) The machine learning classifier to use (must be +single value (if FALSE). The default is TRUE.

+
method
+

(string) The machine learning classifier to use (must be available in the caret package). The default is "rf", which calls -the random forest classifier.

hyperparameters

(named list) Hyperparameter settings passed to the classifier. +the random forest classifier.

+
hyperparameters
+

(named list) Hyperparameter settings passed to the classifier. The default for the random forest classifier (method = "rf") is -list(mtry = floor(sqt(nvariables(x)))). +list(mtry = floor(sqt(nvariables(x)))). The default for the gradient-based model (method = "gbm") is -list(interaction.depth = 3, n.trees = 50, shrinkage = 0.1, n.minobsinnode = 10).

training_proportion

(positive real) The proportion (in (0,1)) of -iterations in used to train the classifier. The default is 0.7.

nsimulations

(positive integer) The number of R* values in the -returned vector if uncertainty is TRUE. The default is 1000.

...

Other arguments passed to caret::train().

- -

Value

- -

A numeric vector of length 1 (by default) or length nsimulations -(if uncertainty = TRUE).

-

Details

- +list(interaction.depth = 3, n.trees = 50, shrinkage = 0.1, n.minobsinnode = 10).

+
training_proportion
+

(positive real) The proportion (in (0,1)) of +iterations in used to train the classifier. The default is 0.7.

+
nsimulations
+

(positive integer) The number of R* values in the +returned vector if uncertainty is TRUE. The default is 1000.

+
...
+

Other arguments passed to caret::train().

+
+
+

Value

+

A numeric vector of length 1 (by default) or length nsimulations(if uncertainty = TRUE).

+
+
+

Details

The rstar() function provides a measure of MCMC convergence based on whether it is possible to determine the chain that generated a particular draw with a probability greater than chance. To do so, it fits a @@ -268,87 +188,92 @@

Details For lower dimensional targets, gradient boosted models (called via method = "gbm") tend to have a higher classification accuracy. On a given MCMC sample, it is recommended to try both of these classifiers.

-

References

- +
+
+

References

Ben Lambert, Aki Vehtari (2020) R*: A robust MCMC convergence diagnostic with uncertainty using gradient-boosted machines. arXiv preprint arXiv:2003.07900.

-

See also

- -

Other diagnostics: -ess_basic(), -ess_bulk(), -ess_quantile(), -ess_sd(), -ess_tail(), -mcse_mean(), -mcse_quantile(), -mcse_sd(), -rhat_basic(), -rhat()

- -

Examples

-
# \donttest{ -if (require("caret", quietly = TRUE)) { - x <- example_draws("eight_schools") - print(rstar(x)) - print(rstar(x, split = FALSE)) - print(rstar(x, method = "gbm")) - # can pass additional arguments to methods - print(rstar(x, method = "gbm", verbose = FALSE)) - - # with uncertainty, returns a vector of R* values - hist(rstar(x, uncertainty = TRUE)) - hist(rstar(x, uncertainty = TRUE, nsimulations = 100)) +
+
+

See also

+

Other diagnostics: +ess_basic(), +ess_bulk(), +ess_quantile(), +ess_sd(), +ess_tail(), +mcse_mean(), +mcse_quantile(), +mcse_sd(), +rhat_basic(), +rhat()

+
- # can use other classification methods in caret library - print(rstar(x, method = "knn")) -} -
#> Warning: package 'caret' was built under R version 4.0.5
#> Warning: package 'ggplot2' was built under R version 4.0.5
#> [1] 1.866667 -#> [1] 1.333333 -#> Iter TrainDeviance ValidDeviance StepSize Improve -#> 1 2.0794 nan 0.1000 -0.0009 -#> 2 2.0070 nan 0.1000 -0.0016 -#> 3 1.9411 nan 0.1000 -0.0005 -#> 4 1.8763 nan 0.1000 -0.0296 -#> 5 1.8258 nan 0.1000 -0.0062 -#> 6 1.7644 nan 0.1000 -0.0023 -#> 7 1.7046 nan 0.1000 -0.0611 -#> 8 1.6626 nan 0.1000 -0.0475 -#> 9 1.6209 nan 0.1000 -0.0613 -#> 10 1.5857 nan 0.1000 -0.0108 -#> 20 1.2606 nan 0.1000 -0.0210 -#> 40 0.8717 nan 0.1000 -0.0412 -#> 50 0.7334 nan 0.1000 -0.0256 -#> -#> [1] 1.466667 -#> [1] 1.466667
#> [1] 1.533333
# } -
+
+

Examples

+
# \donttest{
+if (require("caret", quietly = TRUE)) {
+  x <- example_draws("eight_schools")
+  print(rstar(x))
+  print(rstar(x, split = FALSE))
+  print(rstar(x, method = "gbm"))
+  # can pass additional arguments to methods
+  print(rstar(x, method = "gbm", verbose = FALSE))
+
+  # with uncertainty, returns a vector of R* values
+  hist(rstar(x, uncertainty = TRUE))
+  hist(rstar(x, uncertainty = TRUE, nsimulations = 100))
+
+  # can use other classification methods in caret library
+  print(rstar(x, method = "knn"))
+}
+#> [1] 1.866667
+#> [1] 1.333333
+#> Iter   TrainDeviance   ValidDeviance   StepSize   Improve
+#>      1        2.0794             nan     0.1000   -0.0009
+#>      2        2.0070             nan     0.1000   -0.0016
+#>      3        1.9411             nan     0.1000   -0.0005
+#>      4        1.8763             nan     0.1000   -0.0296
+#>      5        1.8258             nan     0.1000   -0.0062
+#>      6        1.7644             nan     0.1000   -0.0023
+#>      7        1.7046             nan     0.1000   -0.0611
+#>      8        1.6626             nan     0.1000   -0.0475
+#>      9        1.6209             nan     0.1000   -0.0613
+#>     10        1.5857             nan     0.1000   -0.0108
+#>     20        1.2606             nan     0.1000   -0.0210
+#>     40        0.8717             nan     0.1000   -0.0412
+#>     50        0.7334             nan     0.1000   -0.0256
+#> 
+#> [1] 1.466667
+#> [1] 1.466667
+
+
+#> [1] 1.533333
+# }
+
+
+
-
- +
- - + + diff --git a/docs/reference/rvar-dist.html b/docs/reference/rvar-dist.html index e6c6daac..23e29ba7 100644 --- a/docs/reference/rvar-dist.html +++ b/docs/reference/rvar-dist.html @@ -1,69 +1,14 @@ - - - - - - - -Density, CDF, and quantile functions of random variables — rvar-dist • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Density, CDF, and quantile functions of random variables — rvar-dist • posterior - - - - - - - - - - - - - + + -
-
- -
- -
+
-

The probability density function (density()), cumulative distribution -function (cdf()), and quantile function / inverse CDF (quantile()) of -an rvar.

+

The probability density function (density()), cumulative distribution +function (cdf()), and quantile function / inverse CDF (quantile()) of +an rvar.

-
# S3 method for rvar
-density(x, at, ...)
+    
+
# S3 method for rvar
+density(x, at, ...)
 
-# S3 method for rvar
-cdf(x, q, ...)
+# S3 method for rvar
+cdf(x, q, ...)
 
-# S3 method for rvar
-quantile(x, probs, ...)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
x

(rvar) An rvar object.

...

Additional arguments passed onto underlying methods:

q, at

(numeric vector) One or more quantiles.

probs

(numeric vector) One or more probabilities in [0,1].

- -

Value

+# S3 method for rvar +quantile(x, probs, ...)
+
-

If x is a scalar rvar, returns a vector of the same length as the input +

+

Arguments

+
x
+

(rvar) An rvar object.

+
...
+

Additional arguments passed onto underlying methods:

+
q, at
+

(numeric vector) One or more quantiles.

+
probs
+

(numeric vector) One or more probabilities in [0,1].

+
+
+

Value

+

If x is a scalar rvar, returns a vector of the same length as the input (q, at, or probs) containing values from the corresponding function -of the given rvar.

-

If x has length greater than 1, returns an array with dimensions -c(length(y), dim(x)) where y is q, at, or probs, where each +of the given rvar. +If x has length greater than 1, returns an array with dimensions +c(length(y), dim(x)) where y is q, at, or probs, where each result[i,...] is the value of the corresponding function,f(y[i]), for the corresponding cell in the input array, x[...].

+
-

Examples

-
-set.seed(1234) -x = rvar(rnorm(100)) - -density(x, seq(-2, 2, length.out = 10)) -
#> [1] 0.05268921 0.15669674 0.33325128 0.42911534 0.38825093 0.27760481 -#> [7] 0.20794004 0.14720607 0.10387881 0.07011558
cdf(x, seq(-2, 2, length.out = 10)) -
#> [1] 0.02 0.04 0.15 0.34 0.54 0.68 0.81 0.89 0.92 0.96
quantile(x, ppoints(10)) -
#> [1] -1.371156446 -1.107797288 -0.877775358 -0.574614497 -0.476119783 -#> [6] -0.187048613 -0.007696628 0.448815321 0.902987295 1.646284259
-x2 = c(rvar(rnorm(100, mean = -0.5)), rvar(rnorm(100, mean = 0.5))) -density(x2, seq(-2, 2, length.out = 10)) -
#> [,1] [,2] -#> [1,] 0.08849633 0.001641837 -#> [2,] 0.20332937 0.024310255 -#> [3,] 0.33447478 0.081654865 -#> [4,] 0.41944017 0.167732070 -#> [5,] 0.40333595 0.241892638 -#> [6,] 0.28289139 0.309987338 -#> [7,] 0.15847776 0.462678904 -#> [8,] 0.12750072 0.466875791 -#> [9,] 0.07751964 0.234727355 -#> [10,] 0.02149798 0.109987934
cdf(x2, seq(-2, 2, length.out = 10)) -
#> [,1] [,2] -#> [1,] 0.07 0.01 -#> [2,] 0.11 0.01 -#> [3,] 0.25 0.03 -#> [4,] 0.43 0.08 -#> [5,] 0.63 0.16 -#> [6,] 0.79 0.31 -#> [7,] 0.86 0.43 -#> [8,] 0.91 0.69 -#> [9,] 0.97 0.87 -#> [10,] 0.99 0.93
quantile(x2, ppoints(10)) -
#> [,1] [,2] -#> [1,] -2.0034466 -0.6872996 -#> [2,] -1.3541896 -0.2346473 -#> [3,] -1.0276966 0.1308444 -#> [4,] -0.8207823 0.3500387 -#> [5,] -0.5789329 0.6861700 -#> [6,] -0.3647747 0.8192384 -#> [7,] -0.1451222 0.9367486 -#> [8,] 0.1230689 1.1749908 -#> [9,] 0.4371228 1.4569163 -#> [10,] 1.1776442 2.1500961
-
+
+

Examples

+

+set.seed(1234)
+x = rvar(rnorm(100))
+
+density(x, seq(-2, 2, length.out = 10))
+#>  [1] 0.05268921 0.15669674 0.33325128 0.42911534 0.38825093 0.27760481
+#>  [7] 0.20794004 0.14720607 0.10387881 0.07011558
+cdf(x, seq(-2, 2, length.out = 10))
+#>  [1] 0.02 0.04 0.15 0.34 0.54 0.68 0.81 0.89 0.92 0.96
+quantile(x, ppoints(10))
+#>  [1] -1.371156446 -1.107797288 -0.877775358 -0.574614497 -0.476119783
+#>  [6] -0.187048613 -0.007696628  0.448815321  0.902987295  1.646284259
+
+x2 = c(rvar(rnorm(100, mean = -0.5)), rvar(rnorm(100, mean = 0.5)))
+density(x2, seq(-2, 2, length.out = 10))
+#>             [,1]        [,2]
+#>  [1,] 0.08849633 0.001641837
+#>  [2,] 0.20332937 0.024310255
+#>  [3,] 0.33447478 0.081654865
+#>  [4,] 0.41944017 0.167732070
+#>  [5,] 0.40333595 0.241892638
+#>  [6,] 0.28289139 0.309987338
+#>  [7,] 0.15847776 0.462678904
+#>  [8,] 0.12750072 0.466875791
+#>  [9,] 0.07751964 0.234727355
+#> [10,] 0.02149798 0.109987934
+cdf(x2, seq(-2, 2, length.out = 10))
+#>       [,1] [,2]
+#>  [1,] 0.07 0.01
+#>  [2,] 0.11 0.01
+#>  [3,] 0.25 0.03
+#>  [4,] 0.43 0.08
+#>  [5,] 0.63 0.16
+#>  [6,] 0.79 0.31
+#>  [7,] 0.86 0.43
+#>  [8,] 0.91 0.69
+#>  [9,] 0.97 0.87
+#> [10,] 0.99 0.93
+quantile(x2, ppoints(10))
+#>             [,1]       [,2]
+#>  [1,] -2.0034466 -0.6872996
+#>  [2,] -1.3541896 -0.2346473
+#>  [3,] -1.0276966  0.1308444
+#>  [4,] -0.8207823  0.3500387
+#>  [5,] -0.5789329  0.6861700
+#>  [6,] -0.3647747  0.8192384
+#>  [7,] -0.1451222  0.9367486
+#>  [8,]  0.1230689  1.1749908
+#>  [9,]  0.4371228  1.4569163
+#> [10,]  1.1776442  2.1500961
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/rvar-matmult.html b/docs/reference/rvar-matmult.html index 78633828..f4d61400 100644 --- a/docs/reference/rvar-matmult.html +++ b/docs/reference/rvar-matmult.html @@ -1,67 +1,12 @@ - - - - - - - -Matrix multiplication of random variables — rvar-matmult • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Matrix multiplication of random variables — rvar-matmult • posterior + + - - - - -
-
- -
- -
+
@@ -171,98 +107,91 @@

Matrix multiplication of random variables

Matrix multiplication of random variables.

-
x %**% y
- -

Arguments

- - - - - - - - - - -
x

(multiple options) The object to be postmultiplied by y:

- -

If a vector is used, it is treated as a row vector.

y

(multiple options) The object to be premultiplied by x:

- -

If a vector is used, it is treated as a column vector.

- -

Value

- -

An rvar representing the matrix product of x and y.

-

Details

+
+
x %**% y
+
+
+

Arguments

+
x
+

(multiple options) The object to be postmultiplied by y:

If a vector is used, it is treated as a row vector.

+
y
+

(multiple options) The object to be premultiplied by x:

If a vector is used, it is treated as a column vector.

+
+
+

Value

+

An rvar representing the matrix product of x and y.

+
+
+

Details

If x or y are vectors, they are converted into matrices prior to multiplication, with x converted to a row vector and y to a column vector. Numerics and logicals can be multiplied -by rvars and are broadcasted across all draws of the rvar argument. Tensor multiplication -is used to efficiently multiply matrices across draws, so if either x or y is an rvar, -x %**% y will be much faster than rdo(x %*% y).

-

Because rvar is an S3 class and S3 classes cannot properly override %*%, rvars use +by rvars and are broadcasted across all draws of the rvar argument. Tensor multiplication +is used to efficiently multiply matrices across draws, so if either x or y is an rvar, +x %**% y will be much faster than rdo(x %*% y).

+

Because rvar is an S3 class and S3 classes cannot properly override %*%, rvars use %**% for matrix multiplication.

+
-

Examples

-
-# d has mu (mean vector of length 3) and Sigma (3x3 covariance matrix) -d <- as_draws_rvars(example_draws("multi_normal")) -d$Sigma -
#> rvar<100,4>[3,3] mean ± sd: -#> [,1] [,2] [,3] -#> [1,] 1.28 ± 0.17 0.53 ± 0.20 -0.40 ± 0.28 -#> [2,] 0.53 ± 0.20 3.67 ± 0.45 -2.10 ± 0.48 -#> [3,] -0.40 ± 0.28 -2.10 ± 0.48 8.12 ± 0.95
-# trivial example: multiplication by a non-random matrix -d$Sigma %**% diag(1:3) -
#> rvar<100,4>[3,3] mean ± sd: -#> [,1] [,2] [,3] -#> [1,] 1.28 ± 0.17 1.05 ± 0.40 -1.21 ± 0.85 -#> [2,] 0.53 ± 0.20 7.33 ± 0.89 -6.30 ± 1.44 -#> [3,] -0.40 ± 0.28 -4.20 ± 0.96 24.35 ± 2.84
-# Decompose Sigma into R s.t. R'R = Sigma ... -R <- chol(d$Sigma) -# ... and recreate Sigma using matrix multiplication -t(R) %**% R -
#> rvar<100,4>[3,3] mean ± sd: -#> [,1] [,2] [,3] -#> [1,] 1.28 ± 0.17 0.53 ± 0.20 -0.40 ± 0.28 -#> [2,] 0.53 ± 0.20 3.67 ± 0.45 -2.10 ± 0.48 -#> [3,] -0.40 ± 0.28 -2.10 ± 0.48 8.12 ± 0.95
-
+
+

Examples

+

+# d has mu (mean vector of length 3) and Sigma (3x3 covariance matrix)
+d <- as_draws_rvars(example_draws("multi_normal"))
+d$Sigma
+#> rvar<100,4>[3,3] mean ± sd:
+#>      [,1]          [,2]          [,3]         
+#> [1,]  1.28 ± 0.17   0.53 ± 0.20  -0.40 ± 0.28 
+#> [2,]  0.53 ± 0.20   3.67 ± 0.45  -2.10 ± 0.48 
+#> [3,] -0.40 ± 0.28  -2.10 ± 0.48   8.12 ± 0.95 
+
+# trivial example: multiplication by a non-random matrix
+d$Sigma %**% diag(1:3)
+#> rvar<100,4>[3,3] mean ± sd:
+#>      [,1]          [,2]          [,3]         
+#> [1,]  1.28 ± 0.17   1.05 ± 0.40  -1.21 ± 0.85 
+#> [2,]  0.53 ± 0.20   7.33 ± 0.89  -6.30 ± 1.44 
+#> [3,] -0.40 ± 0.28  -4.20 ± 0.96  24.35 ± 2.84 
+
+# Decompose Sigma into R s.t. R'R = Sigma ...
+R <- chol(d$Sigma)
+# ... and recreate Sigma using matrix multiplication
+t(R) %**% R
+#> rvar<100,4>[3,3] mean ± sd:
+#>      [,1]          [,2]          [,3]         
+#> [1,]  1.28 ± 0.17   0.53 ± 0.20  -0.40 ± 0.28 
+#> [2,]  0.53 ± 0.20   3.67 ± 0.45  -2.10 ± 0.48 
+#> [3,] -0.40 ± 0.28  -2.10 ± 0.48   8.12 ± 0.95 
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/rvar-summaries-over-draws.html b/docs/reference/rvar-summaries-over-draws.html index a3483164..b04c4348 100644 --- a/docs/reference/rvar-summaries-over-draws.html +++ b/docs/reference/rvar-summaries-over-draws.html @@ -1,69 +1,14 @@ - - - - - - - -Summaries of random variables within array elements, over draws — rvar-summaries-over-draws • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Summaries of random variables within array elements, over draws — rvar-summaries-over-draws • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
-

Compute summaries within elements of an rvar and over draws of each element, +

Compute summaries within elements of an rvar and over draws of each element, producing an array of the same shape as the input random variable (except in -the case of range(), see Details).

+the case of range(), see Details).

-
E(x, ...)
-
-# S3 method for rvar
-mean(x, ...)
+    
+
E(x, ...)
 
-Pr(x, ...)
+# S3 method for rvar
+mean(x, ...)
 
-# S3 method for default
-Pr(x, ...)
+Pr(x, ...)
 
-# S3 method for logical
-Pr(x, ...)
+# S3 method for default
+Pr(x, ...)
 
-# S3 method for rvar
-Pr(x, ...)
+# S3 method for logical
+Pr(x, ...)
 
-# S3 method for rvar
-median(x, ...)
+# S3 method for rvar
+Pr(x, ...)
 
-# S3 method for rvar
-min(x, ...)
+# S3 method for rvar
+median(x, ...)
 
-# S3 method for rvar
-max(x, ...)
+# S3 method for rvar
+min(x, ...)
 
-# S3 method for rvar
-sum(x, ...)
+# S3 method for rvar
+max(x, ...)
 
-# S3 method for rvar
-prod(x, ...)
+# S3 method for rvar
+sum(x, ...)
 
-# S3 method for rvar
-all(x, ...)
+# S3 method for rvar
+prod(x, ...)
 
-# S3 method for rvar
-any(x, ...)
+# S3 method for rvar
+all(x, ...)
 
-# S3 method for rvar
-Summary(...)
+# S3 method for rvar
+any(x, ...)
 
-# S3 method for rvar
-variance(x, ...)
+# S3 method for rvar
+Summary(...)
 
-var(x, ...)
+# S3 method for rvar
+variance(x, ...)
 
-# S3 method for default
-var(x, ...)
+var(x, ...)
 
-# S3 method for rvar
-var(x, ...)
+# S3 method for default
+var(x, ...)
 
-sd(x, ...)
+# S3 method for rvar
+var(x, ...)
 
-# S3 method for default
-sd(x, ...)
+sd(x, ...)
 
-# S3 method for rvar
-sd(x, ...)
+# S3 method for default
+sd(x, ...)
 
-mad(x, ...)
+# S3 method for rvar
+sd(x, ...)
 
-# S3 method for default
-mad(x, ...)
+mad(x, ...)
 
-# S3 method for rvar
-mad(x, ...)
+# S3 method for default
+mad(x, ...)
 
-# S3 method for rvar
-range(x, ...)
+# S3 method for rvar
+mad(x, ...)
 
-# S3 method for rvar
-is.finite(x)
+# S3 method for rvar
+range(x, ...)
 
-# S3 method for rvar
-is.infinite(x)
+# S3 method for rvar
+is.finite(x)
 
-# S3 method for rvar
-is.nan(x)
+# S3 method for rvar
+is.infinite(x)
 
-# S3 method for rvar
-is.na(x)
+# S3 method for rvar +is.nan(x) -

Arguments

- - - - - - - - - - -
x

(rvar) An rvar.

...

Further arguments passed to underlying functions (e.g., -base::mean() or base::median()), such as na.rm.

- -

Value

+# S3 method for rvar +is.na(x)
+
+
+

Arguments

+
x
+

(rvar) An rvar.

+
...
+

Further arguments passed to underlying functions (e.g., +base::mean() or base::median()), such as na.rm.

+
+
+

Value

A numeric or logical vector with the same dimensions as the given random variable, where each entry in the vector is the mean, median, or variance of the corresponding entry in x.

-

Details

- -

Summaries include expectations (E() or mean()), probabilities (Pr()), -medians (median()), spread (var(), variance(), sd(), mad()), sums and -products (sum(), prod()), extrema and ranges (min(), max(), range()), -logical summaries (all(), any()), and special value predicates (is.finite(), -is.infinite(), is.nan(), is.na()).

+
+
+

Details

+

Summaries include expectations (E() or mean()), probabilities (Pr()), +medians (median()), spread (var(), variance(), sd(), mad()), sums and +products (sum(), prod()), extrema and ranges (min(), max(), range()), +logical summaries (all(), any()), and special value predicates (is.finite(), +is.infinite(), is.nan(), is.na()).

Unless otherwise stated, these functions return a numeric array with the same shape -(same dimensions) as the input rvar, x.

-

range(x) returns an array with dimensions c(2, dim(x)), where the last +(same dimensions) as the input rvar, x.

+

range(x) returns an array with dimensions c(2, dim(x)), where the last dimension contains the minimum and maximum values.

-

is.infinite(x), is.nan(x), and is.na(x) return logical arrays, where each +

is.infinite(x), is.nan(x), and is.na(x) return logical arrays, where each element is TRUE if any draws in its corresponding element in x match -the predicate. Each elements in the result of is.finite(x) is TRUE if +the predicate. Each elements in the result of is.finite(x) is TRUE if all draws in the corresponding element in x are finite.

-

Both E(), mean(), and Pr() return the means of each element in the input. -Pr() additionally checks that the provided rvar +

Both E(), mean(), and Pr() return the means of each element in the input. +Pr() additionally checks that the provided rvar is a logical variable (hence, taking its expectation results in a probability).

For consistency, E() and Pr() are also defined for base arrays so that -they can be used as summary functions in summarise_draws().

-

See also

- -

rvar-summaries-within-draws for summary functions within draws. -rvar-dist for density, CDF, and quantile functions of random variables.

+they can be used as summary functions in summarise_draws().

+
+
+

See also

+

rvar-summaries-within-draws for summary functions within draws. +rvar-dist for density, CDF, and quantile functions of random variables.

Other rvar-summaries: -rvar-summaries-within-draws, -rvar_is_finite()

- -

Examples

-
-set.seed(5678) -x = rvar_rng(rnorm, 4, mean = 1:4, sd = 2) - -# These should all be ~= c(1, 2, 3, 4) -E(x) -
#> [1] 1.004952 1.955997 3.011070 3.963980
mean(x) -
#> [1] 1.004952 1.955997 3.011070 3.963980
median(x) -
#> [1] 0.9557178 1.9170014 3.0024683 3.9274693
-# This ... -Pr(x < 1.5) -
#> [1] 0.59800 0.41100 0.22300 0.10775
# ... should be about the same as this: -pnorm(1.5, mean = 1:4, sd = 2) -
#> [1] 0.5987063 0.4012937 0.2266274 0.1056498
-
+rvar-summaries-within-draws, +rvar_is_finite()

+
+ +
+

Examples

+

+set.seed(5678)
+x = rvar_rng(rnorm, 4, mean = 1:4, sd = 2)
+
+# These should all be ~= c(1, 2, 3, 4)
+E(x)
+#> [1] 1.004952 1.955997 3.011070 3.963980
+mean(x)
+#> [1] 1.004952 1.955997 3.011070 3.963980
+median(x)
+#> [1] 0.9557178 1.9170014 3.0024683 3.9274693
+
+# This ...
+Pr(x < 1.5)
+#> [1] 0.59800 0.41100 0.22300 0.10775
+# ... should be about the same as this:
+pnorm(1.5, mean = 1:4, sd = 2)
+#> [1] 0.5987063 0.4012937 0.2266274 0.1056498
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/rvar-summaries-within-draws.html b/docs/reference/rvar-summaries-within-draws.html index e60f7f17..afdf7e86 100644 --- a/docs/reference/rvar-summaries-within-draws.html +++ b/docs/reference/rvar-summaries-within-draws.html @@ -1,69 +1,14 @@ - - - - - - - -Summaries of random variables over array elements, within draws — rvar-summaries-within-draws • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Summaries of random variables over array elements, within draws — rvar-summaries-within-draws • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
@@ -175,128 +111,125 @@

Summaries of random variables over array elements, within draws

rvar_range(), see Details).

-
rvar_mean(..., na.rm = FALSE)
-
-rvar_median(..., na.rm = FALSE)
+    
+
rvar_mean(..., na.rm = FALSE)
 
-rvar_sum(..., na.rm = FALSE)
+rvar_median(..., na.rm = FALSE)
 
-rvar_prod(..., na.rm = FALSE)
+rvar_sum(..., na.rm = FALSE)
 
-rvar_min(..., na.rm = FALSE)
+rvar_prod(..., na.rm = FALSE)
 
-rvar_max(..., na.rm = FALSE)
+rvar_min(..., na.rm = FALSE)
 
-rvar_sd(..., na.rm = FALSE)
+rvar_max(..., na.rm = FALSE)
 
-rvar_var(..., na.rm = FALSE)
+rvar_sd(..., na.rm = FALSE)
 
-rvar_mad(..., constant = 1.4826, na.rm = FALSE)
+rvar_var(..., na.rm = FALSE)
 
-rvar_range(..., na.rm = FALSE)
+rvar_mad(..., constant = 1.4826, na.rm = FALSE)
 
-rvar_quantile(..., probs, names = FALSE, na.rm = FALSE)
+rvar_range(..., na.rm = FALSE)
 
-rvar_all(..., na.rm = FALSE)
+rvar_quantile(..., probs, names = FALSE, na.rm = FALSE)
 
-rvar_any(..., na.rm = FALSE)
+rvar_all(..., na.rm = FALSE) -

Arguments

- - - - - - - - - - - - - - - - - - - - - - -
...

(rvar) One or more rvars.

na.rm

(logical) Should NAs be removed from the input before -summaries are computed? The default is FALSE.

constant

(scalar real) For rvar_mad(), a scale factor for computing -the median absolute deviation. See the details of stats::mad() for the -justification for the default value.

probs

(numeric vector) For rvar_quantile(), probabilities in [0, 1].

names

(logical) For rvar_quantile(), if TRUE, the result has a -names attribute.

- -

Value

+rvar_any(..., na.rm = FALSE)
+
-

An rvar of length 1 (for range(), length 2; for quantile(), length -equal to length(probs)) with the same number +

+

Arguments

+
...
+

(rvar) One or more rvars.

+
na.rm
+

(logical) Should NAs be removed from the input before +summaries are computed? The default is FALSE.

+
constant
+

(scalar real) For rvar_mad(), a scale factor for computing +the median absolute deviation. See the details of stats::mad() for the +justification for the default value.

+
probs
+

(numeric vector) For rvar_quantile(), probabilities in [0, 1].

+
names
+

(logical) For rvar_quantile(), if TRUE, the result has a +names attribute.

+
+
+

Value

+

An rvar of length 1 (for range(), length 2; for quantile(), length +equal to length(probs)) with the same number of draws as the input rvar(s) containing the summary statistic computed within each draw of the input rvar(s).

-

Details

- +
+
+

Details

These functions compute statistics within each draw of the random variable. -For summaries over draws (such as expectations), see rvar-summaries-over-draws.

+For summaries over draws (such as expectations), see rvar-summaries-over-draws.

Each function defined here corresponds to the base function of the same name -without the rvar_ prefix (e.g., rvar_mean() calls mean() under the hood, etc).

-

See also

- -

rvar-summaries-over-draws for summary functions across draws (e.g. expectations). -rvar-dist for density, CDF, and quantile functions of random variables.

+without the rvar_ prefix (e.g., rvar_mean() calls mean() under the hood, etc).

+
+
+

See also

+

rvar-summaries-over-draws for summary functions across draws (e.g. expectations). +rvar-dist for density, CDF, and quantile functions of random variables.

Other rvar-summaries: -rvar-summaries-over-draws, -rvar_is_finite()

- -

Examples

-
-set.seed(5678) -x = rvar_rng(rnorm, 4, mean = 1:4, sd = 2) +rvar-summaries-over-draws, +rvar_is_finite()

+
-# These will give similar results to mean(1:4), -# median(1:4), sum(1:4), prod(1:4), etc -rvar_mean(x) -
#> rvar<4000>[1] mean ± sd: -#> [1] 2.5 ± 1
rvar_median(x) -
#> rvar<4000>[1] mean ± sd: -#> [1] 2.5 ± 1.1
rvar_sum(x) -
#> rvar<4000>[1] mean ± sd: -#> [1] 9.9 ± 4
rvar_prod(x) -
#> rvar<4000>[1] mean ± sd: -#> [1] 23 ± 103
rvar_range(x) -
#> rvar<4000>[2] mean ± sd: -#> [1] 0.029 ± 1.5 4.935 ± 1.5
rvar_quantile(x, probs = c(0.25, 0.5, 0.75), names = TRUE) -
#> rvar<4000>[3] mean ± sd: -#> 25% 50% 75% -#> 1.3 ± 1.2 2.5 ± 1.1 3.6 ± 1.2
-
+
+

Examples

+

+set.seed(5678)
+x = rvar_rng(rnorm, 4, mean = 1:4, sd = 2)
+
+# These will give similar results to mean(1:4),
+# median(1:4), sum(1:4), prod(1:4), etc
+rvar_mean(x)
+#> rvar<4000>[1] mean ± sd:
+#> [1] 2.5 ± 1 
+rvar_median(x)
+#> rvar<4000>[1] mean ± sd:
+#> [1] 2.5 ± 1.1 
+rvar_sum(x)
+#> rvar<4000>[1] mean ± sd:
+#> [1] 9.9 ± 4 
+rvar_prod(x)
+#> rvar<4000>[1] mean ± sd:
+#> [1] 23 ± 103 
+rvar_range(x)
+#> rvar<4000>[2] mean ± sd:
+#> [1] 0.029 ± 1.5  4.935 ± 1.5 
+rvar_quantile(x, probs = c(0.25, 0.5, 0.75), names = TRUE)
+#> rvar<4000>[3] mean ± sd:
+#>        25%        50%        75% 
+#> 1.3 ± 1.2  2.5 ± 1.1  3.6 ± 1.2  
+
+
+
+ -
- +
- - + + diff --git a/docs/reference/rvar.html b/docs/reference/rvar.html index 055c0c55..1ae73fbd 100644 --- a/docs/reference/rvar.html +++ b/docs/reference/rvar.html @@ -1,67 +1,12 @@ - - - - - - - -Random variables of arbitrary dimension — rvar • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Random variables of arbitrary dimension — rvar • posterior - + + - - - -
-
- -
- -
+
@@ -171,21 +107,20 @@

Random variables of arbitrary dimension

Random variables backed by arrays of arbitrary dimension

-
rvar(
-  x = double(),
-  dim = NULL,
-  dimnames = NULL,
-  nchains = 1L,
-  with_chains = FALSE
-)
+
+
rvar(
+  x = double(),
+  dim = NULL,
+  dimnames = NULL,
+  nchains = 1L,
+  with_chains = FALSE
+)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - -
x

(multiple options) The object to convert to an rvar:

    -
  • A vector of draws from a distribution.

  • +
    +

    Arguments

    +
    x
    +

    (multiple options) The object to convert to an rvar:

    • A vector of draws from a distribution.

    • An array where the first dimension represents draws from a distribution. The resulting rvar will have dimension dim(x)[-1]; that is, everything except the first dimension is used for the shape of the @@ -193,137 +128,130 @@

      Arg distribution (see Examples). Optionally, if with_chains == TRUE, the first dimension indexes the iteration and the second dimension indexes the chain (see with_chains).

    • -
dim

(integer vector) One or more integers giving the maximal indices + +

dim
+

(integer vector) One or more integers giving the maximal indices in each dimension to override the dimensions of the rvar to be created -(see dim()). If NULL (the default), dim is determined by the input. +(see dim()). If NULL (the default), dim is determined by the input. NOTE: This argument controls the dimensions of the rvar, not the underlying array, so you cannot change the number of draws using this -argument.

dimnames

(list) Character vectors giving the names in each dimension +argument.

+
dimnames
+

(list) Character vectors giving the names in each dimension to override the names of the dimensions of the rvar to be created (see -dimnames()). If NULL (the default), this is determined by the input. +dimnames()). If NULL (the default), this is determined by the input. NOTE: This argument controls the names of the dimensions of the -rvar, not the underlying array.

nchains

(positive integer) The number of chains. The default is 1.

with_chains

(logical) Does x include a dimension for chains? +rvar, not the underlying array.

+
nchains
+

(positive integer) The number of chains. The default is 1.

+
with_chains
+

(logical) Does x include a dimension for chains? If FALSE (the default), chains are not included, the first dimension of the input array should index draws, and the nchains argument can be used to determine the number of chains. If TRUE, the nchains argument is ignored and the second dimension of x is used to index chains. -Internally, the array will be converted to a format without the chain index.

- -

Value

- +Internally, the array will be converted to a format without the chain index.

+
+
+

Value

An object of class "rvar" representing a random variable.

-

Details

- +
+
+

Details

The "rvar" class internally represents random variables as arrays of arbitrary dimension, where the first dimension is used to index draws from the distribution. Most mathematical operators and functions are supported, including efficient matrix multiplication and vector and array-style indexing. The intent is that an rvar works as closely as possible to how a base vector/matrix/array does, with a few -differences:

    -
  • The default behavior when subsetting is not to drop extra dimensions (i.e. -the default drop argument for [ is FALSE, not TRUE).

  • +differences:

    • The default behavior when subsetting is not to drop extra dimensions (i.e. +the default drop argument for [ is FALSE, not TRUE).

    • Rather than base R-style recycling, rvars use a limited form of broadcasting: if an operation is being performed on two vectors with different size of the same dimension, the smaller vector will be recycled up to the size of the larger one along that dimension so long as it has size 1.

    • -
    - -

    For functions that expect base numeric arrays and for which rvars cannot be -used directly as arguments, you can use rfun() or rdo() to translate your +

For functions that expect base numeric arrays and for which rvars cannot be +used directly as arguments, you can use rfun() or rdo() to translate your code into code that executes across draws from one or more random variables -and returns a random variable as output. Typically rdo() offers the most +and returns a random variable as output. Typically rdo() offers the most straightforward translation.

-

As rfun() and rdo() incur some performance cost, you can also operate directly -on the underlying array using the draws_of() function. To re-use existing -random number generator functions to efficiently create rvars, use rvar_rng().

-

See also

- -

as_rvar() to convert objects to rvars. See rdo(), rfun(), and -rvar_rng() for higher-level interfaces for creating rvars.

- -

Examples

-
-set.seed(1234) +

As rfun() and rdo() incur some performance cost, you can also operate directly +on the underlying array using the draws_of() function. To re-use existing +random number generator functions to efficiently create rvars, use rvar_rng().

+
+
+

See also

+

as_rvar() to convert objects to rvars. See rdo(), rfun(), and +rvar_rng() for higher-level interfaces for creating rvars.

+
-# To create a "scalar" `rvar`, pass a one-dimensional array or a vector -# whose length (here `4000`) is the desired number of draws: -x <- rvar(rnorm(4000, mean = 1, sd = 1)) -x -
#> rvar<4000>[1] mean ± sd: -#> [1] 1 ± 1
-# Create random vectors by adding an additional dimension: -n <- 4 # length of output vector -x <- rvar(array(rnorm(4000 * n, mean = rep(1:n, each = 4000), sd = 1), dim = c(4000, n))) -x -
#> rvar<4000>[4] mean ± sd: -#> [1] 1 ± 0.99 2 ± 0.99 3 ± 1.00 4 ± 1.02
-# Create a random matrix: -rows <- 4 -cols <- 3 -x <- rvar(array(rnorm(4000 * rows * cols, mean = 1, sd = 1), dim = c(4000, rows, cols))) -x -
#> rvar<4000>[4,3] mean ± sd: -#> [,1] [,2] [,3] -#> [1,] 1.00 ± 0.98 1.00 ± 1.00 0.97 ± 1.00 -#> [2,] 1.00 ± 1.01 1.01 ± 1.02 0.99 ± 0.99 -#> [3,] 1.02 ± 1.01 0.99 ± 1.00 1.00 ± 0.99 -#> [4,] 1.01 ± 1.01 1.02 ± 1.00 1.00 ± 1.01
-# If the input sample comes from multiple chains, we can indicate that using the -# nchains argument (here, 1000 draws each from 4 chains): -x <- rvar(rnorm(4000, mean = 1, sd = 1), nchains = 4) -x -
#> rvar<1000,4>[1] mean ± sd: -#> [1] 0.97 ± 1
-# Or if the input sample has chain information as its second dimension, we can -# use with_chains to create the rvar -x <- rvar(array(rnorm(4000, mean = 1, sd = 1), dim = c(1000, 4)), with_chains = TRUE) -x -
#> rvar<1000,4>[1] mean ± sd: -#> [1] 1 ± 1
-
+
+

Examples

+

+set.seed(1234)
+
+# To create a "scalar" `rvar`, pass a one-dimensional array or a vector
+# whose length (here `4000`) is the desired number of draws:
+x <- rvar(rnorm(4000, mean = 1, sd = 1))
+x
+#> rvar<4000>[1] mean ± sd:
+#> [1] 1 ± 1 
+
+# Create random vectors by adding an additional dimension:
+n <- 4   # length of output vector
+x <- rvar(array(rnorm(4000 * n, mean = rep(1:n, each = 4000), sd = 1), dim = c(4000, n)))
+x
+#> rvar<4000>[4] mean ± sd:
+#> [1] 1 ± 0.99  2 ± 0.99  3 ± 1.00  4 ± 1.02 
+
+# Create a random matrix:
+rows <- 4
+cols <- 3
+x <- rvar(array(rnorm(4000 * rows * cols, mean = 1, sd = 1), dim = c(4000, rows, cols)))
+x
+#> rvar<4000>[4,3] mean ± sd:
+#>      [,1]         [,2]         [,3]        
+#> [1,] 1.00 ± 0.98  1.00 ± 1.00  0.97 ± 1.00 
+#> [2,] 1.00 ± 1.01  1.01 ± 1.02  0.99 ± 0.99 
+#> [3,] 1.02 ± 1.01  0.99 ± 1.00  1.00 ± 0.99 
+#> [4,] 1.01 ± 1.01  1.02 ± 1.00  1.00 ± 1.01 
+
+# If the input sample comes from multiple chains, we can indicate that using the
+# nchains argument (here, 1000 draws each from 4 chains):
+x <- rvar(rnorm(4000, mean = 1, sd = 1), nchains = 4)
+x
+#> rvar<1000,4>[1] mean ± sd:
+#> [1] 0.97 ± 1 
+
+# Or if the input sample has chain information as its second dimension, we can
+# use with_chains to create the rvar
+x <- rvar(array(rnorm(4000, mean = 1, sd = 1), dim = c(1000, 4)), with_chains = TRUE)
+x
+#> rvar<1000,4>[1] mean ± sd:
+#> [1] 1 ± 1 
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/rvar_apply.html b/docs/reference/rvar_apply.html index 062b89ca..6010d5d4 100644 --- a/docs/reference/rvar_apply.html +++ b/docs/reference/rvar_apply.html @@ -1,69 +1,14 @@ - - - - - - - -Random variable resulting from a function applied over margins of an array or random variable — rvar_apply • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Random variable resulting from a function applied over margins of an array or random variable — rvar_apply • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
-

Returns an rvar obtained by applying a function to margins of an array or rvar. -Acts like apply(), except that the function supplied (.f) should return an rvar, -and the final result is always an rvar.

+

Returns an rvar obtained by applying a function to margins of an array or rvar. +Acts like apply(), except that the function supplied (.f) should return an rvar, +and the final result is always an rvar.

-
rvar_apply(.x, .margin, .f, ...)
+
+
rvar_apply(.x, .margin, .f, ...)
+
-

Arguments

- - - - - - - - - - - - - - - - - - -
.x

An array or an rvar.

.margin

(multiple options) The subscripts which the function will be applied over:

    -
  • An integer vector. E.g., for a matrix 1 indicates rows, 2 indicates -columns, c(1, 2) indicates rows and columns.

  • +
    +

    Arguments

    +
    .x
    +

    An array or an rvar.

    +
    .margin
    +

    (multiple options) The subscripts which the function will be applied over:

    • An integer vector. E.g., for a matrix 1 indicates rows, 2 indicates +columns, c(1, 2) indicates rows and columns.

    • A character vector of dimension names if .x has named dimensions.

    • -
.f

(function) The function to be applied. The function .f must -return an rvar and the dimensions of the result of .f applied to each + +

.f
+

(function) The function to be applied. The function .f must +return an rvar and the dimensions of the result of .f applied to each margin of .x must be able to be broadcasted to a common shape (otherwise -the resulting rvar cannot be simplified). See Details.

...

Optional arguments passed to .f.

- -

Value

- -

An rvar.

-

If the result of each call to .f returns an rvar of dimension d after -being broadcast to a common shape, then rvar_apply() returns an rvar of -dimension c(d, dim(.x)[.margin]). If the last dimension of the result would +the resulting rvar cannot be simplified). See Details.

+
...
+

Optional arguments passed to .f.

+
+
+

Value

+

An rvar. +If the result of each call to .f returns an rvar of dimension d after +being broadcast to a common shape, then rvar_apply() returns an rvar of +dimension c(d, dim(.x)[.margin]). If the last dimension of the result would be 1, it is dropped (other dimensions equal to 1 are retained). If d is 0, the result has length 0 but not necessarily the 'correct' dimension.

-

Details

- -

This function acts much like apply(), except that the function passed to it (.f) -must return rvars, and the result is simplified into an rvar. Unlike -apply(), it also keeps the dimensions of the returned values along each margin, +

+
+

Details

+

This function acts much like apply(), except that the function passed to it (.f) +must return rvars, and the result is simplified into an rvar. Unlike +apply(), it also keeps the dimensions of the returned values along each margin, rather than simplifying each margin to a vector, and if the results of .f do -not all have the same dimensions, it applies the rvar broadcasting rules to +not all have the same dimensions, it applies the rvar broadcasting rules to bind results together rather than using vector recycling.

-

If you wish to apply functions over rvars where the result is not intended to -be simplified into an rvar, you can use the standard apply(), lapply(), -sapply(), or vapply() functions.

-

See also

- -

as_rvar() to convert objects to rvars. See rdo(), rfun(), and -rvar_rng() for higher-level interfaces for creating rvars.

- -

Examples

-
-set.seed(3456) -x <- rvar_rng(rnorm, 24, mean = 1:24) -dim(x) <- c(2,3,4) +

If you wish to apply functions over rvars where the result is not intended to +be simplified into an rvar, you can use the standard apply(), lapply(), +sapply(), or vapply() functions.

+
+
+

See also

+

as_rvar() to convert objects to rvars. See rdo(), rfun(), and +rvar_rng() for higher-level interfaces for creating rvars.

+
-# we can find the distributions of marginal means of the above array -# using rvar_mean along with rvar_apply -rvar_apply(x, 1, rvar_mean) -
#> rvar<4000>[2] mean ± sd: -#> [1] 12 ± 0.29 13 ± 0.29
rvar_apply(x, 2:3, rvar_mean) -
#> rvar<4000>[3,4] mean ± sd: -#> [,1] [,2] [,3] [,4] -#> [1,] 1.5 ± 0.70 7.5 ± 0.69 13.5 ± 0.71 19.5 ± 0.70 -#> [2,] 3.5 ± 0.70 9.5 ± 0.71 15.5 ± 0.72 21.5 ± 0.70 -#> [3,] 5.5 ± 0.71 11.5 ± 0.72 17.5 ± 0.71 23.5 ± 0.70
-
+
+

Examples

+

+set.seed(3456)
+x <- rvar_rng(rnorm, 24, mean = 1:24)
+dim(x) <- c(2,3,4)
+
+# we can find the distributions of marginal means of the above array
+# using rvar_mean along with rvar_apply
+rvar_apply(x, 1, rvar_mean)
+#> rvar<4000>[2] mean ± sd:
+#> [1] 12 ± 0.29  13 ± 0.29 
+rvar_apply(x, 2:3, rvar_mean)
+#> rvar<4000>[3,4] mean ± sd:
+#>      [,1]         [,2]         [,3]         [,4]        
+#> [1,]  1.5 ± 0.70   7.5 ± 0.69  13.5 ± 0.71  19.5 ± 0.70 
+#> [2,]  3.5 ± 0.70   9.5 ± 0.71  15.5 ± 0.72  21.5 ± 0.70 
+#> [3,]  5.5 ± 0.71  11.5 ± 0.72  17.5 ± 0.71  23.5 ± 0.70 
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/rvar_is_finite.html b/docs/reference/rvar_is_finite.html index d7de45cd..b358601f 100644 --- a/docs/reference/rvar_is_finite.html +++ b/docs/reference/rvar_is_finite.html @@ -1,68 +1,13 @@ - - - - - - - -Special value predicates for random variables — rvar_is_finite • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Special value predicates for random variables — rvar_is_finite • posterior + + - - - - -
-
- -
- -
+
@@ -173,81 +109,85 @@

Special value predicates for random variables

on all draws within a random variable, returning a random variable.

-
rvar_is_finite(x)
-
-rvar_is_infinite(x)
-
-rvar_is_nan(x)
-
-rvar_is_na(x)
+
+
rvar_is_finite(x)
 
-    

Arguments

- - - - - - -
x

(rvar) An rvar.

+rvar_is_infinite(x) -

Value

+rvar_is_nan(x) -

A logical rvar of the same length as the input.

-

Details

+rvar_is_na(x)
+
-

These functions return a new rvar that is the result of applying -is.finite(), is.infinite(), is.nan(), or is.na() to every draw +

+

Arguments

+
x
+

(rvar) An rvar.

+
+
+

Value

+

A logical rvar of the same length as the input.

+
+
+

Details

+

These functions return a new rvar that is the result of applying +is.finite(), is.infinite(), is.nan(), or is.na() to every draw in the input random variable.

-

See also

- -

rvar-summaries-over-draws for summary functions across draws, including -implementations of is.finite(), is.infinite(), is.nan(), and is.na() for +

+
+

See also

+

rvar-summaries-over-draws for summary functions across draws, including +implementations of is.finite(), is.infinite(), is.nan(), and is.na() for rvars.

Other rvar-summaries: -rvar-summaries-over-draws, -rvar-summaries-within-draws

- -

Examples

-
-x <- rvar(c(1, Inf, -Inf, NaN, NA)) -x -
#> rvar<5>[1] mean ± sd: -#> [1] NaN ± NA
-rvar_is_finite(x) -
#> rvar<5>[1] mean ± sd: -#> [1] 0.2 ± 0.45
rvar_is_infinite(x) -
#> rvar<5>[1] mean ± sd: -#> [1] 0.4 ± 0.55
rvar_is_nan(x) -
#> rvar<5>[1] mean ± sd: -#> [1] 0.2 ± 0.45
rvar_is_na(x) -
#> rvar<5>[1] mean ± sd: -#> [1] 0.4 ± 0.55
-
+rvar-summaries-over-draws, +rvar-summaries-within-draws

+
+ +
+

Examples

+

+x <- rvar(c(1, Inf, -Inf, NaN, NA))
+x
+#> rvar<5>[1] mean ± sd:
+#> [1] NaN ± NA 
+
+rvar_is_finite(x)
+#> rvar<5>[1] mean ± sd:
+#> [1] 0.2 ± 0.45 
+rvar_is_infinite(x)
+#> rvar<5>[1] mean ± sd:
+#> [1] 0.4 ± 0.55 
+rvar_is_nan(x)
+#> rvar<5>[1] mean ± sd:
+#> [1] 0.2 ± 0.45 
+rvar_is_na(x)
+#> rvar<5>[1] mean ± sd:
+#> [1] 0.4 ± 0.55 
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/rvar_rng.html b/docs/reference/rvar_rng.html index 1bd98eae..8868492d 100644 --- a/docs/reference/rvar_rng.html +++ b/docs/reference/rvar_rng.html @@ -1,68 +1,13 @@ - - - - - - - -Create random variables from existing random number generators — rvar_rng • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Create random variables from existing random number generators — rvar_rng • posterior + + - - - - -
-
- -
- -
+
-

Specialized alternative to rdo() or rfun() for creating rvars from -existing random-number generator functions (such as rnorm(), rbinom(), etc).

+

Specialized alternative to rdo() or rfun() for creating rvars from +existing random-number generator functions (such as rnorm(), rbinom(), etc).

-
rvar_rng(.f, n, ..., ndraws = NULL)
+
+
rvar_rng(.f, n, ..., ndraws = NULL)
+
-

Arguments

- - - - - - - - - - - - - - - - - - -
.f

(function) A function (or string naming a function) representing a +

+

Arguments

+
.f
+

(function) A function (or string naming a function) representing a random-number generating function that follows the pattern of base random -number generators (like rnorm(), rbinom(), etc). It must:

    -
  • Have a first argument, n, giving the number of draws to take from the +number generators (like rnorm(), rbinom(), etc). It must:

    • Have a first argument, n, giving the number of draws to take from the distribution

    • Have vectorized parameter arguments

    • Return a single vector of length n

    • -
n

(positive integer) The length of the output rvar vector (not -the number of draws).

...

Arguments passed to .f. These arguments may include rvars, -so long as they are vectors only (no multidimensional rvars are -allowed).

ndraws

(positive integer) The number of draws used to construct the -returned random variable if no rvars are supplied in .... If NULL, -getOption("posterior.rvar_ndraws") is used (default 4000). If ... -contains rvars, the number of draws in the provided rvars is used -instead of the value of this argument.

- -

Value

- -

A single-dimensional rvar of length n.

-

Details

- -

This function unwraps the arrays underlying the input rvars in + +

n
+

(positive integer) The length of the output rvar vector (not +the number of draws).

+
...
+

Arguments passed to .f. These arguments may include rvars, +so long as they are vectors only (no multidimensional rvars are +allowed).

+
ndraws
+

(positive integer) The number of draws used to construct the +returned random variable if no rvars are supplied in .... If NULL, +getOption("posterior.rvar_ndraws") is used (default 4000). If ... +contains rvars, the number of draws in the provided rvars is used +instead of the value of this argument.

+
+
+

Value

+

A single-dimensional rvar of length n.

+
+
+

Details

+

This function unwraps the arrays underlying the input rvars in ... and then passes them to .f, relying on the vectorization of .f -to evaluate it across draws from the input rvars. This is why the arguments +to evaluate it across draws from the input rvars. This is why the arguments of .f must be vectorized. It asks for n times the number of draws -in the input rvars (or ndraws if none are given) draws from the +in the input rvars (or ndraws if none are given) draws from the random number generator .f, then reshapes the output from .f into an -rvar with length n.

-

rvar_rng() is a fast alternative to rdo() or rfun(), but you must +rvar with length n.

+

rvar_rng() is a fast alternative to rdo() or rfun(), but you must ensure that .f satisfies the preconditions described above for the result to be correct. Most base random number generators satisfy these conditions. -It is advisable to test against rdo() or rfun() (which should be correct, +It is advisable to test against rdo() or rfun() (which should be correct, but slower) if you are uncertain.

-

See also

- -

Other rfun: -rdo(), -rfun()

+
+
+

See also

+

Other rfun: +rdo(), +rfun()

+
-

Examples

-
-mu <- rvar_rng(rnorm, 10, mean = 1:10, sd = 1) -sigma <- rvar_rng(rgamma, 1, shape = 1, rate = 1) -x <- rvar_rng(rnorm, 10, mu, sigma) -x -
#> rvar<4000>[10] mean ± sd: -#> [1] 1 ± 1.8 2 ± 1.7 3 ± 1.7 4 ± 1.7 5 ± 1.8 6 ± 1.7 7 ± 1.8 -#> [8] 8 ± 1.7 9 ± 1.7 10 ± 1.7
-
+
+

Examples

+

+mu <- rvar_rng(rnorm, 10, mean = 1:10, sd = 1)
+sigma <- rvar_rng(rgamma, 1, shape = 1, rate = 1)
+x <- rvar_rng(rnorm, 10, mu, sigma)
+x
+#> rvar<4000>[10] mean ± sd:
+#>  [1]  1 ± 1.8   2 ± 1.7   3 ± 1.7   4 ± 1.7   5 ± 1.8   6 ± 1.7   7 ± 1.8 
+#>  [8]  8 ± 1.7   9 ± 1.7  10 ± 1.7 
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/split_chains.html b/docs/reference/split_chains.html index 908bb750..f6397a57 100644 --- a/docs/reference/split_chains.html +++ b/docs/reference/split_chains.html @@ -1,68 +1,13 @@ - - - - - - - -Split Chains — split_chains • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Split Chains — split_chains • posterior - - + + - - -
-
- -
- -
+
@@ -173,61 +109,60 @@

Split Chains

number of chains.

-
split_chains(x, ...)
- -

Arguments

- - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

...

Arguments passed to individual methods (if applicable).

- -

Value

+
+
split_chains(x, ...)
+
+
+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

A draws object of the same class as x.

+
-

Examples

-
#> [1] 100
nchains(x) -
#> [1] 4
-x <- split_chains(x) -niterations(x) -
#> [1] 50
nchains(x) -
#> [1] 8
-
+
+

Examples

+
x <- example_draws()
+niterations(x)
+#> [1] 100
+nchains(x)
+#> [1] 4
+
+x <- split_chains(x)
+niterations(x)
+#> [1] 50
+nchains(x)
+#> [1] 8
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/sub-.draws_array.html b/docs/reference/sub-.draws_array.html index 98f6b8ef..858fbdb7 100644 --- a/docs/reference/sub-.draws_array.html +++ b/docs/reference/sub-.draws_array.html @@ -1,73 +1,18 @@ - - - - - - - -Extract parts of a draws_array object — [.draws_array • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Extract parts of a draws_array object — [.draws_array • posterior - + + - - - -
-
- -
- -
+
@@ -183,49 +119,44 @@

Extract parts of a draws_array object

well.

-
# S3 method for draws_array
-[(x, i, j, ..., drop = FALSE)
- -

Arguments

- - - - - - -
x, i, j, ..., drop

Same as in the default extraction method but with -drop being set to FALSE by default.

- -

Value

+
+
# S3 method for draws_array
+[(x, i, j, ..., drop = FALSE)
+
+
+

Arguments

+
x, i, j, ..., drop
+

Same as in the default extraction method but with +drop being set to FALSE by default.

+
+
+

Value

An object of class "draws_array" unless any of the dimensions was dropped during the extraction.

+
+
-
- +
- - + + diff --git a/docs/reference/sub-.draws_matrix.html b/docs/reference/sub-.draws_matrix.html index cb551cc2..9f14c31f 100644 --- a/docs/reference/sub-.draws_matrix.html +++ b/docs/reference/sub-.draws_matrix.html @@ -1,73 +1,18 @@ - - - - - - - -Extract parts of a draws_matrix object — [.draws_matrix • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Extract parts of a draws_matrix object — [.draws_matrix • posterior - + + - - - -
-
- -
- -
+
@@ -183,49 +119,44 @@

Extract parts of a draws_matrix object

well.

-
# S3 method for draws_matrix
-[(x, i, j, ..., drop = FALSE)
- -

Arguments

- - - - - - -
x, i, j, ..., drop

Same as in the default extraction method but with -drop being set to FALSE by default.

- -

Value

+
+
# S3 method for draws_matrix
+[(x, i, j, ..., drop = FALSE)
+
+
+

Arguments

+
x, i, j, ..., drop
+

Same as in the default extraction method but with +drop being set to FALSE by default.

+
+
+

Value

An object of class "draws_matrix" unless any of the dimensions was dropped during the extraction.

+
+
-
- +
- - + + diff --git a/docs/reference/subset_draws.html b/docs/reference/subset_draws.html index 8fd6f0d7..cccc2ffb 100644 --- a/docs/reference/subset_draws.html +++ b/docs/reference/subset_draws.html @@ -1,67 +1,12 @@ - - - - - - - -Subset draws objects — subset_draws • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Subset draws objects — subset_draws • posterior - - + + - - -
-
- -
- -
+
-

Subset draws objects by variables, iterations, chains, and draws indices.

+

Subset draws objects by variables, iterations, chains, and draws indices.

-
subset_draws(x, ...)
-
-# S3 method for draws_matrix
-subset_draws(
-  x,
-  variable = NULL,
-  iteration = NULL,
-  chain = NULL,
-  draw = NULL,
-  regex = FALSE,
-  unique = TRUE,
-  ...
-)
-
-# S3 method for draws_array
-subset_draws(
-  x,
-  variable = NULL,
-  iteration = NULL,
-  chain = NULL,
-  draw = NULL,
-  regex = FALSE,
-  unique = TRUE,
-  ...
-)
-
-# S3 method for draws_df
-subset_draws(
-  x,
-  variable = NULL,
-  iteration = NULL,
-  chain = NULL,
-  draw = NULL,
-  regex = FALSE,
-  unique = TRUE,
-  ...
-)
-
-# S3 method for draws_list
-subset_draws(
-  x,
-  variable = NULL,
-  iteration = NULL,
-  chain = NULL,
-  draw = NULL,
-  regex = FALSE,
-  unique = TRUE,
-  ...
-)
-
-# S3 method for draws_rvars
-subset_draws(
-  x,
-  variable = NULL,
-  iteration = NULL,
-  chain = NULL,
-  draw = NULL,
-  regex = FALSE,
-  unique = TRUE,
-  ...
-)
-
-# S3 method for draws
-subset(x, ...)
+
+
subset_draws(x, ...)
+
+# S3 method for draws_matrix
+subset_draws(
+  x,
+  variable = NULL,
+  iteration = NULL,
+  chain = NULL,
+  draw = NULL,
+  regex = FALSE,
+  unique = TRUE,
+  ...
+)
+
+# S3 method for draws_array
+subset_draws(
+  x,
+  variable = NULL,
+  iteration = NULL,
+  chain = NULL,
+  draw = NULL,
+  regex = FALSE,
+  unique = TRUE,
+  ...
+)
+
+# S3 method for draws_df
+subset_draws(
+  x,
+  variable = NULL,
+  iteration = NULL,
+  chain = NULL,
+  draw = NULL,
+  regex = FALSE,
+  unique = TRUE,
+  ...
+)
+
+# S3 method for draws_list
+subset_draws(
+  x,
+  variable = NULL,
+  iteration = NULL,
+  chain = NULL,
+  draw = NULL,
+  regex = FALSE,
+  unique = TRUE,
+  ...
+)
+
+# S3 method for draws_rvars
+subset_draws(
+  x,
+  variable = NULL,
+  iteration = NULL,
+  chain = NULL,
+  draw = NULL,
+  regex = FALSE,
+  unique = TRUE,
+  ...
+)
+
+# S3 method for draws
+subset(x, ...)
+
-

Arguments

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

...

Arguments passed to individual methods (if applicable).

variable

(character vector) The variables to select. All elements of -non-scalar variables can be selected at once.

iteration

(integer vector) The iteration indices to select.

chain

(integer vector) The chain indices to select.

draw

(integer vector) The draw indices to be select. Subsetting draw -indices will lead to an automatic merging of chains via merge_chains.

regex

(logical) Should variable should be treated as a +

+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
...
+

Arguments passed to individual methods (if applicable).

+
variable
+

(character vector) The variables to select. All elements of +non-scalar variables can be selected at once.

+
iteration
+

(integer vector) The iteration indices to select.

+
chain
+

(integer vector) The chain indices to select.

+
draw
+

(integer vector) The draw indices to be select. Subsetting draw +indices will lead to an automatic merging of chains via merge_chains.

+
regex
+

(logical) Should variable should be treated as a (vector of) regular expressions? Any variable in x matching at least one -of the regular expressions will be selected. Defaults to FALSE.

unique

(logical) Should duplicated selection of chains, iterations, or +of the regular expressions will be selected. Defaults to FALSE.

+
unique
+

(logical) Should duplicated selection of chains, iterations, or draws be allowed? If TRUE (the default) only unique chains, iterations, and draws are selected regardless of how often they appear in the -respective selecting arguments.

- -

Value

- +respective selecting arguments.

+
+
+

Value

A draws object of the same class as x.

-

Details

- +
+
+

Details

To ensure that multiple consecutive subsetting operations work correctly, -subset() repairs the draws object before and after +subset() repairs the draws object before and after subsetting.

+
-

Examples

-
x <- example_draws() -subset_draws(x, variable = c("mu", "tau")) -
#> # A draws_array: 100 iterations, 4 chains, and 2 variables -#> , , variable = mu -#> -#> chain -#> iteration 1 2 3 4 -#> 1 2.0 3.0 1.79 6.5 -#> 2 1.5 8.2 5.99 9.1 -#> 3 5.8 -1.2 2.56 0.2 -#> 4 6.8 10.9 2.79 3.7 -#> 5 1.8 9.8 -0.03 5.5 -#> -#> , , variable = tau -#> -#> chain -#> iteration 1 2 3 4 -#> 1 2.8 2.80 8.7 3.8 -#> 2 7.0 2.76 2.9 6.8 -#> 3 9.7 0.57 8.4 5.3 -#> 4 4.8 2.45 4.4 1.6 -#> 5 2.8 2.80 11.0 3.0 -#> -#> # ... with 95 more iterations
subset_draws(x, chain = 2) -
#> # A draws_array: 100 iterations, 1 chains, and 10 variables -#> , , variable = mu -#> -#> chain -#> iteration 1 -#> 1 3.0 -#> 2 8.2 -#> 3 -1.2 -#> 4 10.9 -#> 5 9.8 -#> -#> , , variable = tau -#> -#> chain -#> iteration 1 -#> 1 2.80 -#> 2 2.76 -#> 3 0.57 -#> 4 2.45 -#> 5 2.80 -#> -#> , , variable = theta[1] -#> -#> chain -#> iteration 1 -#> 1 6.26 -#> 2 9.32 -#> 3 -0.97 -#> 4 12.45 -#> 5 9.75 -#> -#> , , variable = theta[2] -#> -#> chain -#> iteration 1 -#> 1 1.0 -#> 2 9.4 -#> 3 -1.2 -#> 4 12.5 -#> 5 11.9 -#> -#> # ... with 95 more iterations, and 6 more variables
subset_draws(x, iteration = 5:10, chain = 3:4) -
#> # A draws_array: 6 iterations, 2 chains, and 10 variables -#> , , variable = mu -#> -#> chain -#> iteration 1 2 -#> 1 -0.03 5.48 -#> 2 1.06 2.38 -#> 3 3.67 11.82 -#> 4 3.51 4.90 -#> 5 8.85 0.88 -#> -#> , , variable = tau -#> -#> chain -#> iteration 1 2 -#> 1 11.03 3.0 -#> 2 2.70 2.3 -#> 3 1.68 4.3 -#> 4 0.52 3.1 -#> 5 5.96 15.8 -#> -#> , , variable = theta[1] -#> -#> chain -#> iteration 1 2 -#> 1 8.2 -0.91 -#> 2 5.0 0.59 -#> 3 5.2 18.87 -#> 4 3.7 1.50 -#> 5 13.1 9.07 -#> -#> , , variable = theta[2] -#> -#> chain -#> iteration 1 2 -#> 1 3.2 3.2 -#> 2 4.3 1.1 -#> 3 4.1 13.0 -#> 4 4.1 6.1 -#> 5 4.7 11.6 -#> -#> # ... with 1 more iterations, and 6 more variables
-# extract the first chain twice -subset_draws(x, chain = c(1, 1), unique = FALSE) -
#> # A draws_array: 100 iterations, 2 chains, and 10 variables -#> , , variable = mu -#> -#> chain -#> iteration 1 2 -#> 1 2.0 2.0 -#> 2 1.5 1.5 -#> 3 5.8 5.8 -#> 4 6.8 6.8 -#> 5 1.8 1.8 -#> -#> , , variable = tau -#> -#> chain -#> iteration 1 2 -#> 1 2.8 2.8 -#> 2 7.0 7.0 -#> 3 9.7 9.7 -#> 4 4.8 4.8 -#> 5 2.8 2.8 -#> -#> , , variable = theta[1] -#> -#> chain -#> iteration 1 2 -#> 1 3.96 3.96 -#> 2 0.12 0.12 -#> 3 21.25 21.25 -#> 4 14.70 14.70 -#> 5 5.96 5.96 -#> -#> , , variable = theta[2] -#> -#> chain -#> iteration 1 2 -#> 1 0.271 0.271 -#> 2 -0.069 -0.069 -#> 3 14.931 14.931 -#> 4 8.586 8.586 -#> 5 1.156 1.156 -#> -#> # ... with 95 more iterations, and 6 more variables
-# extract all elements of 'theta' -subset_draws(x, variable = "theta") -
#> # A draws_array: 100 iterations, 4 chains, and 8 variables -#> , , variable = theta[1] -#> -#> chain -#> iteration 1 2 3 4 -#> 1 3.96 6.26 13.3 5.78 -#> 2 0.12 9.32 6.3 2.09 -#> 3 21.25 -0.97 10.6 15.72 -#> 4 14.70 12.45 5.4 2.69 -#> 5 5.96 9.75 8.2 -0.91 -#> -#> , , variable = theta[2] -#> -#> chain -#> iteration 1 2 3 4 -#> 1 0.271 1.0 2.1 5.0 -#> 2 -0.069 9.4 7.3 8.2 -#> 3 14.931 -1.2 5.7 6.0 -#> 4 8.586 12.5 2.8 2.7 -#> 5 1.156 11.9 3.2 3.2 -#> -#> , , variable = theta[3] -#> -#> chain -#> iteration 1 2 3 4 -#> 1 -0.74 0.22 1.4 5.7 -#> 2 0.95 9.68 4.1 3.5 -#> 3 1.83 -1.37 -8.3 3.1 -#> 4 2.67 11.15 -10.8 3.2 -#> 5 3.11 12.72 -27.8 2.6 -#> -#> , , variable = theta[4] -#> -#> chain -#> iteration 1 2 3 4 -#> 1 2.1 -0.73 7.8 4.8 -#> 2 7.3 8.11 4.7 7.8 -#> 3 1.4 -0.79 6.8 6.1 -#> 4 4.4 10.48 6.8 7.9 -#> 5 2.0 9.70 12.3 11.3 -#> -#> # ... with 95 more iterations, and 4 more variables
-
+
+

Examples

+
x <- example_draws()
+subset_draws(x, variable = c("mu", "tau"))
+#> # A draws_array: 100 iterations, 4 chains, and 2 variables
+#> , , variable = mu
+#> 
+#>          chain
+#> iteration   1    2     3   4
+#>         1 2.0  3.0  1.79 6.5
+#>         2 1.5  8.2  5.99 9.1
+#>         3 5.8 -1.2  2.56 0.2
+#>         4 6.8 10.9  2.79 3.7
+#>         5 1.8  9.8 -0.03 5.5
+#> 
+#> , , variable = tau
+#> 
+#>          chain
+#> iteration   1    2    3   4
+#>         1 2.8 2.80  8.7 3.8
+#>         2 7.0 2.76  2.9 6.8
+#>         3 9.7 0.57  8.4 5.3
+#>         4 4.8 2.45  4.4 1.6
+#>         5 2.8 2.80 11.0 3.0
+#> 
+#> # ... with 95 more iterations
+subset_draws(x, chain = 2)
+#> # A draws_array: 100 iterations, 1 chains, and 10 variables
+#> , , variable = mu
+#> 
+#>          chain
+#> iteration    1
+#>         1  3.0
+#>         2  8.2
+#>         3 -1.2
+#>         4 10.9
+#>         5  9.8
+#> 
+#> , , variable = tau
+#> 
+#>          chain
+#> iteration    1
+#>         1 2.80
+#>         2 2.76
+#>         3 0.57
+#>         4 2.45
+#>         5 2.80
+#> 
+#> , , variable = theta[1]
+#> 
+#>          chain
+#> iteration     1
+#>         1  6.26
+#>         2  9.32
+#>         3 -0.97
+#>         4 12.45
+#>         5  9.75
+#> 
+#> , , variable = theta[2]
+#> 
+#>          chain
+#> iteration    1
+#>         1  1.0
+#>         2  9.4
+#>         3 -1.2
+#>         4 12.5
+#>         5 11.9
+#> 
+#> # ... with 95 more iterations, and 6 more variables
+subset_draws(x, iteration = 5:10, chain = 3:4)
+#> # A draws_array: 6 iterations, 2 chains, and 10 variables
+#> , , variable = mu
+#> 
+#>          chain
+#> iteration     1     2
+#>         1 -0.03  5.48
+#>         2  1.06  2.38
+#>         3  3.67 11.82
+#>         4  3.51  4.90
+#>         5  8.85  0.88
+#> 
+#> , , variable = tau
+#> 
+#>          chain
+#> iteration     1    2
+#>         1 11.03  3.0
+#>         2  2.70  2.3
+#>         3  1.68  4.3
+#>         4  0.52  3.1
+#>         5  5.96 15.8
+#> 
+#> , , variable = theta[1]
+#> 
+#>          chain
+#> iteration    1     2
+#>         1  8.2 -0.91
+#>         2  5.0  0.59
+#>         3  5.2 18.87
+#>         4  3.7  1.50
+#>         5 13.1  9.07
+#> 
+#> , , variable = theta[2]
+#> 
+#>          chain
+#> iteration   1    2
+#>         1 3.2  3.2
+#>         2 4.3  1.1
+#>         3 4.1 13.0
+#>         4 4.1  6.1
+#>         5 4.7 11.6
+#> 
+#> # ... with 1 more iterations, and 6 more variables
+
+# extract the first chain twice
+subset_draws(x, chain = c(1, 1), unique = FALSE)
+#> # A draws_array: 100 iterations, 2 chains, and 10 variables
+#> , , variable = mu
+#> 
+#>          chain
+#> iteration   1   2
+#>         1 2.0 2.0
+#>         2 1.5 1.5
+#>         3 5.8 5.8
+#>         4 6.8 6.8
+#>         5 1.8 1.8
+#> 
+#> , , variable = tau
+#> 
+#>          chain
+#> iteration   1   2
+#>         1 2.8 2.8
+#>         2 7.0 7.0
+#>         3 9.7 9.7
+#>         4 4.8 4.8
+#>         5 2.8 2.8
+#> 
+#> , , variable = theta[1]
+#> 
+#>          chain
+#> iteration     1     2
+#>         1  3.96  3.96
+#>         2  0.12  0.12
+#>         3 21.25 21.25
+#>         4 14.70 14.70
+#>         5  5.96  5.96
+#> 
+#> , , variable = theta[2]
+#> 
+#>          chain
+#> iteration      1      2
+#>         1  0.271  0.271
+#>         2 -0.069 -0.069
+#>         3 14.931 14.931
+#>         4  8.586  8.586
+#>         5  1.156  1.156
+#> 
+#> # ... with 95 more iterations, and 6 more variables
+
+# extract all elements of 'theta'
+subset_draws(x, variable = "theta")
+#> # A draws_array: 100 iterations, 4 chains, and 8 variables
+#> , , variable = theta[1]
+#> 
+#>          chain
+#> iteration     1     2    3     4
+#>         1  3.96  6.26 13.3  5.78
+#>         2  0.12  9.32  6.3  2.09
+#>         3 21.25 -0.97 10.6 15.72
+#>         4 14.70 12.45  5.4  2.69
+#>         5  5.96  9.75  8.2 -0.91
+#> 
+#> , , variable = theta[2]
+#> 
+#>          chain
+#> iteration      1    2   3   4
+#>         1  0.271  1.0 2.1 5.0
+#>         2 -0.069  9.4 7.3 8.2
+#>         3 14.931 -1.2 5.7 6.0
+#>         4  8.586 12.5 2.8 2.7
+#>         5  1.156 11.9 3.2 3.2
+#> 
+#> , , variable = theta[3]
+#> 
+#>          chain
+#> iteration     1     2     3   4
+#>         1 -0.74  0.22   1.4 5.7
+#>         2  0.95  9.68   4.1 3.5
+#>         3  1.83 -1.37  -8.3 3.1
+#>         4  2.67 11.15 -10.8 3.2
+#>         5  3.11 12.72 -27.8 2.6
+#> 
+#> , , variable = theta[4]
+#> 
+#>          chain
+#> iteration   1     2    3    4
+#>         1 2.1 -0.73  7.8  4.8
+#>         2 7.3  8.11  4.7  7.8
+#>         3 1.4 -0.79  6.8  6.1
+#>         4 4.4 10.48  6.8  7.9
+#>         5 2.0  9.70 12.3 11.3
+#> 
+#> # ... with 95 more iterations, and 4 more variables
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/thin_draws.html b/docs/reference/thin_draws.html index b764194a..3c4d0320 100644 --- a/docs/reference/thin_draws.html +++ b/docs/reference/thin_draws.html @@ -1,67 +1,12 @@ - - - - - - - -Thin draws objects — thin_draws • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Thin draws objects — thin_draws • posterior - + + - - - -
-
- -
- -
+
-

Thin draws objects to reduce their size and autocorrelation in the chains.

+

Thin draws objects to reduce their size and autocorrelation in the chains.

-
thin_draws(x, thin, ...)
-
-# S3 method for draws
-thin_draws(x, thin, ...)
- -

Arguments

- - - - - - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

thin

(positive integer) The period for selecting draws.

...

Arguments passed to individual methods (if applicable).

- -

Value

+
+
thin_draws(x, thin, ...)
+
+# S3 method for draws
+thin_draws(x, thin, ...)
+
+
+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
thin
+

(positive integer) The period for selecting draws.

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

A draws object of the same class as x.

+
-

Examples

-
#> [1] 100
-x <- thin_draws(x, thin = 5) -niterations(x) -
#> [1] 20
-
+
+

Examples

+
x <- example_draws()
+niterations(x)
+#> [1] 100
+
+x <- thin_draws(x, thin = 5)
+niterations(x)
+#> [1] 20
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/u_scale.html b/docs/reference/u_scale.html index 6037d683..4604270c 100644 --- a/docs/reference/u_scale.html +++ b/docs/reference/u_scale.html @@ -1,70 +1,15 @@ - - - - - - - -Rank uniformization — u_scale • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Rank uniformization — u_scale • posterior - - - - - - - - - - + + - - - -
-
- -
- -
+
@@ -177,52 +113,45 @@

Rank uniformization

[1/(2S), 1-1/(2S)], where S is the number of values.

-
u_scale(x, c = 3/8)
- -

Arguments

- - - - - - - - - - -
x

(numeric) A scalar, vector, matrix, or array of values.

c

(numeric) Fractional offset used in the back-transformation of ranks. -Defaults to 3/8.

- -

Value

+
+
u_scale(x, c = 3/8)
+
+
+

Arguments

+
x
+

(numeric) A scalar, vector, matrix, or array of values.

+
c
+

(numeric) Fractional offset used in the back-transformation of ranks. +Defaults to 3/8.

+
+
+

Value

A numeric array of uniformized values with the same size and dimension as the input.

+
+
-
- +
- - + + diff --git a/docs/reference/weight_draws.html b/docs/reference/weight_draws.html index 2d9a4aa7..462379b2 100644 --- a/docs/reference/weight_draws.html +++ b/docs/reference/weight_draws.html @@ -1,71 +1,16 @@ - - - - - - - -Weight draws objects — weight_draws • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Weight draws objects — weight_draws • posterior - - - - - - - - - + + - - - - -
-
- -
- -
+
-

Add weights to draws objects, with one weight per draw, for use in +

Add weights to draws objects, with one weight per draw, for use in subsequent weighting operations. For reasons of numerical accuracy, weights are stored in the form of unnormalized log-weights (in a variable called -.log_weight). See weights.draws() for details how to extract weights from +.log_weight). See weights.draws() for details how to extract weights from draws objects.

-
weight_draws(x, weights, ...)
+    
+
weight_draws(x, weights, ...)
 
-# S3 method for draws_matrix
-weight_draws(x, weights, log = FALSE, ...)
+# S3 method for draws_matrix
+weight_draws(x, weights, log = FALSE, ...)
 
-# S3 method for draws_array
-weight_draws(x, weights, log = FALSE, ...)
+# S3 method for draws_array
+weight_draws(x, weights, log = FALSE, ...)
 
-# S3 method for draws_df
-weight_draws(x, weights, log = FALSE, ...)
+# S3 method for draws_df
+weight_draws(x, weights, log = FALSE, ...)
 
-# S3 method for draws_list
-weight_draws(x, weights, log = FALSE, ...)
+# S3 method for draws_list
+weight_draws(x, weights, log = FALSE, ...)
 
-# S3 method for draws_rvars
-weight_draws(x, weights, log = FALSE, ...)
+# S3 method for draws_rvars +weight_draws(x, weights, log = FALSE, ...)
+
-

Arguments

- - - - - - - - - - - - - - - - - - -
x

(draws) A draws object or another R object for which the method -is defined.

weights

(numeric vector) A vector of weights of length ndraws(x). +

+

Arguments

+
x
+

(draws) A draws object or another R object for which the method +is defined.

+
weights
+

(numeric vector) A vector of weights of length ndraws(x). Weights will be internally stored on the log scale (in a variable called .log_weight) and will not be normalized, but normalized (non-log) weights -can be returned via the weights.draws() method later.

...

Arguments passed to individual methods (if applicable).

log

(logicla) Are the weights passed already on the log scale? The +can be returned via the weights.draws() method later.

+
...
+

Arguments passed to individual methods (if applicable).

+
log
+

(logicla) Are the weights passed already on the log scale? The default is FALSE, that is, expecting weights to be on the standard -(non-log) scale.

- -

Value

- +(non-log) scale.

+
+
+

Value

A draws object of the same class as x.

-

See also

- - - -

Examples

-
x <- example_draws() - -# sample some random weights for illustration -wts <- rexp(ndraws(x)) -head(wts) -
#> [1] 1.9344030 0.7445487 2.1868616 0.8625128 0.5622111 1.3747321
-# add weights -x <- weight_draws(x, weights = wts) +
+ -# extract weights -head(weights(x)) # defaults to normalized weights -
#> [1] 0.004921318 0.001894208 0.005563598 0.002194320 0.001430322 0.003497458
head(weights(x, normalize=FALSE)) # recover original weights -
#> [1] 1.9344030 0.7445487 2.1868616 0.8625128 0.5622111 1.3747321
head(weights(x, log=TRUE)) # get normalized log-weights -
#> [1] -5.314179 -6.268955 -5.191510 -6.121883 -6.549856 -5.655719
-# add weights which are already on the log scale -log_wts <- log(wts) -head(log_wts) -
#> [1] 0.6597987 -0.2949770 0.7824675 -0.1479052 -0.5758779 0.3182589
-x <- weight_draws(x, weights = log_wts, log = TRUE) -# extract weights -head(weights(x)) -
#> [1] 0.004921318 0.001894208 0.005563598 0.002194320 0.001430322 0.003497458
head(weights(x, log=TRUE, normalize = FALSE)) # recover original log_wts -
#> [1] 0.6597987 -0.2949770 0.7824675 -0.1479052 -0.5758779 0.3182589
-
+
+

Examples

+
x <- example_draws()
+
+# sample some random weights for illustration
+wts <- rexp(ndraws(x))
+head(wts)
+#> [1] 0.12537521 0.51153003 0.43158989 0.01586271 1.98827365 1.42360646
+
+# add weights
+x <- weight_draws(x, weights = wts)
+
+# extract weights
+head(weights(x)) # defaults to normalized weights
+#> [1] 2.943483e-04 1.200939e-03 1.013260e-03 3.724149e-05 4.667947e-03
+#> [6] 3.342256e-03
+head(weights(x, normalize=FALSE)) # recover original weights
+#> [1] 0.12537521 0.51153003 0.43158989 0.01586271 1.98827365 1.42360646
+head(weights(x, log=TRUE)) # get normalized log-weights
+#> [1]  -8.130747  -6.724652  -6.894582 -10.198087  -5.367036  -5.701109
+
+# add weights which are already on the log scale
+log_wts <- log(wts)
+head(log_wts)
+#> [1] -2.0764444 -0.6703490 -0.8402795 -4.1437844  0.6872667  0.3531934
+
+x <- weight_draws(x, weights = log_wts, log = TRUE)
+# extract weights
+head(weights(x))
+#> [1] 2.943483e-04 1.200939e-03 1.013260e-03 3.724149e-05 4.667947e-03
+#> [6] 3.342256e-03
+head(weights(x, log=TRUE, normalize = FALSE)) # recover original log_wts
+#> [1] -2.0764444 -0.6703490 -0.8402795 -4.1437844  0.6872667  0.3531934
+
+
+
+ -
- +
- - + + diff --git a/docs/reference/weights.draws.html b/docs/reference/weights.draws.html index 0a853f40..064878b6 100644 --- a/docs/reference/weights.draws.html +++ b/docs/reference/weights.draws.html @@ -1,68 +1,13 @@ - - - - - - - -Extract Weights from Draws Objects — weights.draws • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Extract Weights from Draws Objects — weights.draws • posterior + + - - - - -
-
- -
- -
+
-

Extract weights from draws objects, with one weight per draw. -See weight_draws for details how to add weights to draws objects.

+

Extract weights from draws objects, with one weight per draw. +See weight_draws for details how to add weights to draws objects.

-
# S3 method for draws
-weights(object, log = FALSE, normalize = TRUE, ...)
- -

Arguments

- - - - - - - - - - - - - - - - - - -
object

(draws) A draws object.

log

(logical) Should the weights be returned on the log scale? -Defaults to FALSE.

normalize

(logical) Should the weights be normalized to sum to 1 on -the standard scale? Defaults to TRUE.

...

Arguments passed to individual methods (if applicable).

- -

Value

+
+
# S3 method for draws
+weights(object, log = FALSE, normalize = TRUE, ...)
+
+
+

Arguments

+
object
+

(draws) A draws object.

+
log
+

(logical) Should the weights be returned on the log scale? +Defaults to FALSE.

+
normalize
+

(logical) Should the weights be normalized to sum to 1 on +the standard scale? Defaults to TRUE.

+
...
+

Arguments passed to individual methods (if applicable).

+
+
+

Value

A vector of weights, with one weight per draw.

-

See also

- - - -

Examples

-
x <- example_draws() - -# sample some random weights for illustration -wts <- rexp(ndraws(x)) -head(wts) -
#> [1] 0.12537521 0.51153003 0.43158989 0.01586271 1.98827365 1.42360646
-# add weights -x <- weight_draws(x, weights = wts) +
+
+

See also

+ +
-# extract weights -head(weights(x)) # defaults to normalized weights -
#> [1] 2.943483e-04 1.200939e-03 1.013260e-03 3.724149e-05 4.667947e-03 -#> [6] 3.342256e-03
head(weights(x, normalize=FALSE)) # recover original weights -
#> [1] 0.12537521 0.51153003 0.43158989 0.01586271 1.98827365 1.42360646
head(weights(x, log=TRUE)) # get normalized log-weights -
#> [1] -8.130747 -6.724652 -6.894582 -10.198087 -5.367036 -5.701109
-# add weights which are already on the log scale -log_wts <- log(wts) -head(log_wts) -
#> [1] -2.0764444 -0.6703490 -0.8402795 -4.1437844 0.6872667 0.3531934
-x <- weight_draws(x, weights = log_wts, log = TRUE) -# extract weights -head(weights(x)) -
#> [1] 2.943483e-04 1.200939e-03 1.013260e-03 3.724149e-05 4.667947e-03 -#> [6] 3.342256e-03
head(weights(x, log=TRUE, normalize = FALSE)) # recover original log_wts -
#> [1] -2.0764444 -0.6703490 -0.8402795 -4.1437844 0.6872667 0.3531934
-
+
+

Examples

+
x <- example_draws()
+
+# sample some random weights for illustration
+wts <- rexp(ndraws(x))
+head(wts)
+#> [1] 1.9344030 0.7445487 2.1868616 0.8625128 0.5622111 1.3747321
+
+# add weights
+x <- weight_draws(x, weights = wts)
+
+# extract weights
+head(weights(x)) # defaults to normalized weights
+#> [1] 0.004921318 0.001894208 0.005563598 0.002194320 0.001430322 0.003497458
+head(weights(x, normalize=FALSE)) # recover original weights
+#> [1] 1.9344030 0.7445487 2.1868616 0.8625128 0.5622111 1.3747321
+head(weights(x, log=TRUE)) # get normalized log-weights
+#> [1] -5.314179 -6.268955 -5.191510 -6.121883 -6.549856 -5.655719
+
+# add weights which are already on the log scale
+log_wts <- log(wts)
+head(log_wts)
+#> [1]  0.6597987 -0.2949770  0.7824675 -0.1479052 -0.5758779  0.3182589
+
+x <- weight_draws(x, weights = log_wts, log = TRUE)
+# extract weights
+head(weights(x))
+#> [1] 0.004921318 0.001894208 0.005563598 0.002194320 0.001430322 0.003497458
+head(weights(x, log=TRUE, normalize = FALSE)) # recover original log_wts
+#> [1]  0.6597987 -0.2949770  0.7824675 -0.1479052 -0.5758779  0.3182589
+
+
+
+
-
- +
- - + + diff --git a/docs/reference/z_scale.html b/docs/reference/z_scale.html index a8cf612f..7b8d4e5b 100644 --- a/docs/reference/z_scale.html +++ b/docs/reference/z_scale.html @@ -1,70 +1,15 @@ - - - - - - - -Rank normalization — z_scale • posterior - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Rank normalization — z_scale • posterior - - - - - - - - - - + + - - - -
-
- -
- -
+
@@ -177,52 +113,45 @@

Rank normalization

ranks via the inverse normal transformation.

-
z_scale(x, c = 3/8)
- -

Arguments

- - - - - - - - - - -
x

(numeric) A scalar, vector, matrix, or array of values.

c

(numeric) Fractional offset used in the back-transformation of ranks. -Defaults to 3/8.

- -

Value

+
+
z_scale(x, c = 3/8)
+
+
+

Arguments

+
x
+

(numeric) A scalar, vector, matrix, or array of values.

+
c
+

(numeric) Fractional offset used in the back-transformation of ranks. +Defaults to 3/8.

+
+
+

Value

A numeric array of rank normalized values with the same size and dimension as the input.

+
+
-
- +
- - + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index d875e996..493a5371 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,8 +1,35 @@ + + https://mc-stan.org/posterior/404.html + + + https://mc-stan.org/posterior/LICENSE-text.html + + + https://mc-stan.org/posterior/LICENSE.html + + + https://mc-stan.org/posterior/articles/index.html + + + https://mc-stan.org/posterior/articles/posterior.html + + + https://mc-stan.org/posterior/articles/rvar.html + + + https://mc-stan.org/posterior/authors.html + https://mc-stan.org/posterior/index.html + + https://mc-stan.org/posterior/news/index.html + + + https://mc-stan.org/posterior/pull_request_template.html + https://mc-stan.org/posterior/reference/as_rvar.html @@ -21,6 +48,12 @@ https://mc-stan.org/posterior/reference/diagnostics.html + + https://mc-stan.org/posterior/reference/dot-ess.html + + + https://mc-stan.org/posterior/reference/dot-rhat.html + https://mc-stan.org/posterior/reference/draws-index.html @@ -75,6 +108,12 @@ https://mc-stan.org/posterior/reference/extract_variable_matrix.html + + https://mc-stan.org/posterior/reference/fold_draws.html + + + https://mc-stan.org/posterior/reference/index.html + https://mc-stan.org/posterior/reference/is_rvar.html @@ -120,6 +159,9 @@ https://mc-stan.org/posterior/reference/quantile2.html + + https://mc-stan.org/posterior/reference/r_scale.html + https://mc-stan.org/posterior/reference/rdo.html @@ -135,6 +177,9 @@ https://mc-stan.org/posterior/reference/resample_draws.html + + https://mc-stan.org/posterior/reference/reserved-variables.html + https://mc-stan.org/posterior/reference/reserved_variables.html @@ -153,15 +198,24 @@ https://mc-stan.org/posterior/reference/rvar-dist.html + + https://mc-stan.org/posterior/reference/rvar-functions.html + https://mc-stan.org/posterior/reference/rvar-matmult.html + + https://mc-stan.org/posterior/reference/rvar-summaries-by-draw.html + https://mc-stan.org/posterior/reference/rvar-summaries-over-draws.html https://mc-stan.org/posterior/reference/rvar-summaries-within-draws.html + + https://mc-stan.org/posterior/reference/rvar-summaries.html + https://mc-stan.org/posterior/reference/rvar.html @@ -174,9 +228,6 @@ https://mc-stan.org/posterior/reference/rvar_rng.html - - https://mc-stan.org/posterior/reference/r_scale.html - https://mc-stan.org/posterior/reference/split_chains.html @@ -198,19 +249,13 @@ https://mc-stan.org/posterior/reference/vctrs-compat.html - - https://mc-stan.org/posterior/reference/weights.draws.html - https://mc-stan.org/posterior/reference/weight_draws.html - https://mc-stan.org/posterior/reference/z_scale.html - - - https://mc-stan.org/posterior/articles/posterior.html + https://mc-stan.org/posterior/reference/weights.draws.html - https://mc-stan.org/posterior/articles/rvar.html + https://mc-stan.org/posterior/reference/z_scale.html