Package: posterior 1.6.0
posterior: Tools for Working with Posterior Distributions
Provides 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: (a) Efficiently convert between many different useful formats of draws (samples) from posterior or prior distributions. (b) Provide consistent methods for operations commonly performed on draws, for example, subsetting, binding, or mutating draws. (c) Provide various summaries of draws in convenient formats. (d) Provide lightweight implementations of state of the art posterior inference diagnostics. References: Vehtari et al. (2021) <doi:10.1214/20-BA1221>.
Authors:
posterior_1.6.0.tar.gz
posterior_1.6.0.zip(r-4.5)posterior_1.6.0.zip(r-4.4)posterior_1.6.0.zip(r-4.3)
posterior_1.6.0.tgz(r-4.4-any)posterior_1.6.0.tgz(r-4.3-any)
posterior_1.6.0.tar.gz(r-4.5-noble)posterior_1.6.0.tar.gz(r-4.4-noble)
posterior_1.6.0.tgz(r-4.4-emscripten)posterior_1.6.0.tgz(r-4.3-emscripten)
posterior.pdf |posterior.html✨
posterior/json (API)
NEWS
# Install 'posterior' in R: |
install.packages('posterior', repos = c('https://stan-dev.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/stan-dev/posterior/issues
Last updated 8 days agofrom:d0f8b762b5. Checks:OK: 7. Indexed: yes.
Target | Result | Date |
---|---|---|
Doc / Vignettes | OK | Nov 11 2024 |
R-4.5-win | OK | Nov 11 2024 |
R-4.5-linux | OK | Nov 11 2024 |
R-4.4-win | OK | Nov 11 2024 |
R-4.4-mac | OK | Nov 11 2024 |
R-4.3-win | OK | Nov 11 2024 |
R-4.3-mac | OK | Nov 11 2024 |
Exports:%**%%in%as_drawsas_draws_arrayas_draws_dfas_draws_listas_draws_matrixas_draws_rvarsas_rvaras_rvar_factoras_rvar_integeras_rvar_logicalas_rvar_numericas_rvar_orderedautocorrelationautocovariancebind_drawscdfchain_idsdefault_convergence_measuresdefault_mcse_measuresdefault_summary_measuresdiagdissentdraw_idsdraws_arraydraws_dfdraws_listdraws_matrixdraws_ofdraws_of<-draws_rvarsdropEentropyess_basicess_bulkess_meaness_medianess_quantileess_sdess_tailexample_drawsextract_variableextract_variable_arrayextract_variable_matrixfor_each_drawis_drawsis_draws_arrayis_draws_dfis_draws_listis_draws_matrixis_draws_rvarsis_rvaris_rvar_factoris_rvar_orderediteration_idsmadmatchmcse_meanmcse_medianmcse_quantilemcse_sdmerge_chainsmodal_categorymutate_variablesnchainsndrawsniterationsnvariablesorder_drawspareto_convergence_ratepareto_diagspareto_khatpareto_khat_thresholdpareto_min_sspareto_smoothPrps_convergence_rateps_khat_thresholdps_min_ssps_tail_lengthquantile2r_scalerdorename_variablesrepair_drawsresample_drawsreserved_variablesrfunrhatrhat_basicrhat_nestedrstarrvarrvar_allrvar_anyrvar_applyrvar_factorrvar_ifelservar_is_finitervar_is_infinitervar_is_narvar_is_nanrvar_madrvar_maxrvar_meanrvar_medianrvar_minrvar_orderedrvar_prodrvar_quantilervar_rangervar_rngrvar_sdrvar_sumrvar_varsdset_variablessplit_chainssubset_drawssummarise_drawssummarize_drawsthin_drawsu_scalevarvariablesvariables<-varianceweight_drawsz_scale
Dependencies:abindbackportscheckmateclidistributionalfansigenericsgluelifecyclemagrittrmatrixStatsnumDerivpillarpkgconfigrlangtensorAtibbleutf8vctrs
Pareto-khat diagnostics
Rendered frompareto_diagnostics.Rmd
usingknitr::rmarkdown
on Nov 11 2024.Last update: 2024-06-28
Started: 2024-06-28
rvar: The Random Variable Datatype
Rendered fromrvar.Rmd
usingknitr::rmarkdown
on Nov 11 2024.Last update: 2023-11-19
Started: 2021-03-25
The posterior R package
Rendered fromposterior.Rmd
usingknitr::rmarkdown
on Nov 11 2024.Last update: 2024-06-28
Started: 2021-05-22
Readme and manuals
Help Manual
Help page | Topics |
---|---|
Tools for working with posterior (and prior) distributions | posterior-package posterior |
Coerce to a random variable | as_rvar as_rvar_integer as_rvar_logical as_rvar_numeric |
Coerce to a factor random variable | as_rvar_factor as_rvar_ordered |
Bind 'draws' objects together | bind_draws bind_draws.draws_array bind_draws.draws_df bind_draws.draws_list bind_draws.draws_matrix bind_draws.draws_rvars |
Cholesky decomposition of random matrix | chol.rvar |
Matrix diagonals (including for random variables) | diag,rvar-method |
List of available convergence diagnostics | convergence diagnostics |
Dissention | dissent dissent.default dissent.rvar |
Transform to 'draws' objects | as_draws draws is_draws |
The 'draws_array' format | as_draws_array as_draws_array.default as_draws_array.draws_array as_draws_array.draws_df as_draws_array.draws_list as_draws_array.draws_matrix as_draws_array.draws_rvars as_draws_array.mcmc as_draws_array.mcmc.list draws_array is_draws_array |
The 'draws_df' format | as_draws_df as_draws_df.data.frame as_draws_df.default as_draws_df.draws_array as_draws_df.draws_df as_draws_df.draws_list as_draws_df.draws_matrix as_draws_df.draws_rvars as_draws_df.mcmc as_draws_df.mcmc.list draws_df is_draws_df |
The 'draws_list' format | as_draws_list as_draws_list.default as_draws_list.draws_array as_draws_list.draws_df as_draws_list.draws_list as_draws_list.draws_matrix as_draws_list.draws_rvars as_draws_list.mcmc as_draws_list.mcmc.list draws_list is_draws_list |
The 'draws_matrix' format | as_draws_matrix as_draws_matrix.default as_draws_matrix.draws_array as_draws_matrix.draws_df as_draws_matrix.draws_list as_draws_matrix.draws_matrix as_draws_matrix.draws_rvars as_draws_matrix.mcmc as_draws_matrix.mcmc.list draws_matrix is_draws_matrix |
Get/set array of draws underlying a random variable | draws_of draws_of<- |
The 'draws_rvars' format | as_draws_rvars as_draws_rvars.default as_draws_rvars.draws_array as_draws_rvars.draws_df as_draws_rvars.draws_list as_draws_rvars.draws_matrix as_draws_rvars.draws_rvars as_draws_rvars.list as_draws_rvars.mcmc as_draws_rvars.mcmc.list draws_rvars is_draws_rvars |
Summaries of 'draws' objects | default_convergence_measures default_mcse_measures default_summary_measures draws_summary summarise_draws summarise_draws.draws summarise_draws.rvar summarize_draws summary.draws summary.rvar |
Index 'draws' objects | chain_ids draws-index draw_ids iteration_ids nchains ndraws niterations |
Drop redundant dimensions | drop,rvar-method |
Normalized entropy | entropy entropy.default entropy.rvar |
Basic version of the effective sample size | ess_basic ess_basic.default ess_basic.rvar |
Bulk effective sample size (bulk-ESS) | ess_bulk ess_bulk.default ess_bulk.rvar |
Effective sample size for the mean | ess_mean ess_mean.default ess_mean.rvar |
Effective sample sizes for quantiles | ess_median ess_quantile ess_quantile.default ess_quantile.rvar |
Effective sample size for the standard deviation | ess_sd ess_sd.default ess_sd.rvar |
Tail effective sample size (tail-ESS) | ess_tail ess_tail.default ess_tail.rvar |
Example 'draws' objects | example_draws |
Extract draws of a single variable | extract_variable extract_variable.default extract_variable.draws extract_variable.draws_df extract_variable.draws_list extract_variable.draws_rvars |
Extract array of a single (possibly indexed) variable | extract_variable_array extract_variable_array.default extract_variable_array.draws |
Extract matrix of a single variable | extract_variable_matrix extract_variable_matrix.default extract_variable_matrix.draws extract_variable_matrix.draws_df extract_variable_matrix.draws_list extract_variable_matrix.draws_rvars |
Loop over draws | for_each_draw |
Is 'x' a random variable? | is_rvar |
Is 'x' a factor random variable? | is_rvar_factor is_rvar_ordered |
Value Matching | %in% match match.default match.rvar |
Monte Carlo standard error for the mean | mcse_mean mcse_mean.default mcse_mean.rvar |
Monte Carlo standard error for quantiles | mcse_median mcse_quantile mcse_quantile.default mcse_quantile.rvar |
Monte Carlo standard error for the standard deviation | mcse_sd mcse_sd.default mcse_sd.rvar |
Merge chains of 'draws' objects | merge_chains merge_chains.draws_array merge_chains.draws_df merge_chains.draws_list merge_chains.draws_matrix merge_chains.draws_rvars merge_chains.rvar |
Modal category | modal_category modal_category.default modal_category.rvar |
Mutate variables in 'draws' objects | mutate_variables mutate_variables.draws_array mutate_variables.draws_df mutate_variables.draws_list mutate_variables.draws_matrix mutate_variables.draws_rvars |
Order 'draws' objects | order_draws order_draws.draws_array order_draws.draws_df order_draws.draws_list order_draws.draws_matrix order_draws.draws_rvars order_draws.rvar |
Pareto smoothing diagnostics | pareto_convergence_rate pareto_convergence_rate.default pareto_convergence_rate.rvar pareto_diags pareto_diags.default pareto_diags.rvar pareto_khat_threshold pareto_khat_threshold.default pareto_khat_threshold.rvar pareto_min_ss pareto_min_ss.default pareto_min_ss.rvar |
Pareto khat diagnostic | pareto_khat pareto_khat.default pareto_khat.rvar |
Pareto smoothing | pareto_smooth pareto_smooth.default pareto_smooth.rvar |
Print 'draws_array' objects | print.draws_array |
Print 'draws_df' objects | print.draws_df |
Print 'draws_list' objects | print.draws_list |
Print 'draws_matrix' objects | print.draws_matrix |
Print 'draws_rvars' objects | print.draws_rvars |
Print summaries of 'draws' objects | print.draws_summary |
Print or format a random variable | format.rvar print.rvar str.rvar |
Pareto convergence rate | ps_convergence_rate |
Pareto k-hat threshold | ps_khat_threshold |
Pareto-smoothing minimum sample-size | ps_min_ss |
Pareto tail length | ps_tail_length |
Compute Quantiles | quantile2 quantile2.default quantile2.rvar |
Execute expressions of random variables | rdo |
Rename variables in 'draws' objects | rename_variables rename_variables.draws |
Repair indices of 'draws' objects | repair_draws repair_draws.draws_array repair_draws.draws_df repair_draws.draws_list repair_draws.draws_matrix repair_draws.draws_rvars repair_draws.rvar |
Resample 'draws' objects | resample_draws resample_draws.draws resample_draws.rvar |
Reserved variables | reserved_variables reserved_variables.default reserved_variables.draws_array reserved_variables.draws_df reserved_variables.draws_list reserved_variables.draws_matrix reserved_variables.draws_rvars |
Create functions of random variables | rfun |
Rhat convergence diagnostic | rhat rhat.default rhat.rvar |
Basic version of the Rhat convergence diagnostic | rhat_basic rhat_basic.default rhat_basic.rvar |
Nested Rhat convergence diagnostic | rhat_nested rhat_nested.default rhat_nested.rvar |
Calculate R* convergence diagnostic | rstar |
Random variables of arbitrary dimension | rvar |
Random variable resulting from a function applied over margins of an array or random variable | rvar_apply |
Factor random variables of arbitrary dimension | rvar_factor rvar_ordered |
Random variable ifelse | rvar_ifelse |
Special value predicates for random variables | rvar_is_finite rvar_is_infinite rvar_is_na rvar_is_nan |
Create random variables from existing random number generators | rvar_rng |
Density, CDF, and quantile functions of random variables | cdf.rvar cdf.rvar_factor cdf.rvar_ordered density.rvar density.rvar_factor quantile.rvar quantile.rvar_factor quantile.rvar_ordered rvar-dist |
Matrix multiplication of random variables | %**% matrixOps.rvar rvar-matmult |
Random variable slicing | rvar-slice [.rvar [<-.rvar [[.rvar [[<-.rvar |
Summaries of random variables within array elements, over draws | all.rvar any.rvar E is.finite.rvar is.infinite.rvar is.na.rvar is.nan.rvar mad mad.default mad.rvar mad.rvar_ordered max.rvar mean.rvar median.rvar min.rvar Pr Pr.default Pr.logical Pr.rvar prod.rvar range.rvar rvar-summaries-over-draws sd sd.default sd.rvar sum.rvar Summary.rvar var var.default var.rvar variance.rvar |
Summaries of random variables over array elements, within draws | rvar-summaries-within-draws rvar_all rvar_any rvar_mad rvar_max rvar_mean rvar_median rvar_min rvar_prod rvar_quantile rvar_range rvar_sd rvar_sum rvar_var |
Split Chains | split_chains |
Subset 'draws' objects | subset.draws subset_draws subset_draws.draws_array subset_draws.draws_df subset_draws.draws_list subset_draws.draws_matrix subset_draws.draws_rvars subset_draws.rvar |
Thin 'draws' objects | thin thin_draws thin_draws.draws thin_draws.rvar |
Get variable names from 'draws' objects | nvariables variables variables.draws_array variables.draws_df variables.draws_list variables.draws_matrix variables.draws_rvars |
Set variable names in 'draws' objects | set_variables variables<- variables<-.draws_array variables<-.draws_df variables<-.draws_list variables<-.draws_matrix variables<-.draws_rvars |
Weight 'draws' objects | weight_draws weight_draws.draws_array weight_draws.draws_df weight_draws.draws_list weight_draws.draws_matrix weight_draws.draws_rvars |
Extract Weights from Draws Objects | weights.draws |