DatasetsGenerating datasets ready for use with SBC and working with them. 


Combine multiple datasets together. 

Generate datasets. 

Create new 

Subset an 

Create a brms generator. 

Wrap a function the creates a complete dataset. 

Generate datasets via a function that creates a single dataset. 

Calculate prior standard deviation of a dataset 

BackendsRepresent various inference engines you can use with SBC. 

Build a backend based on the 

Build a brms backend, reusing the compiled model from a previously created 

Backend based on sampling via 

Backend based on variational approximation via 

S3 generic to get backendspecific default thinning for rank computation. 

Get hash used to identify cached results. 

S3 generic to let backends signal that they produced independent draws. 

A mock backend. 

Create a JAGS backend using 

SBC backend using the 

SBC backend using the 

S3 generic using backend to fit a model to data. 

S3 generic to get backendspecific diagnostics. 

S3 generic converting a fitted model to a 

Computation & resultsFunctions related to running the SBC computation and handling the results. 

Fit datasets and evaluate diagnostics and SBC metrics. 

Check diagnostics and issue warnings when those fail. 

Create an 

Subset the results. 

Create a definition of generated quantities evaluated in R. 

Recompute SBC statistics given a single fit. 

Recompute SBC statistics without refitting models. 

Combine multiple SBC results together. 

Calculate ranks given variable values within a posterior distribution. 

Get diagnostic messages for 

S3 generic to get backendspecific diagnostics. 

Determines the default chunk size. 

Determines the default cores per single fit. 

Plotting & SummarisingPlotting and summarising results 

Maybe not export in the end? Useful for debugging 

Plot the ECDFbased plots. 

Prior/posterior contraction plot. 

Plot the observed coverage and its uncertainty. 

Plot rank histogram of an SBC results. 

Plot the simulated "true" values versus posterior estimates 

Guess the number of bins for 

Compute observed coverage of posterior credible intervals. 

ExamplesFunctions to let you easily test the pacakge 

Construct a backend to be used in the examples. 

Construct a generator used in the examples. 

Combine an example backend with an example generator to provide full results that can be used to test other functions in the package. 

Print the Stan code of a model used in the examples. 

Miscellaneous 

wasserstein distance between binned samples 

Cumulative JensenShannon divergence 

Combine two named lists and overwrite elements with the same name using the value from args2 

Max difference between binned samples with the same length 

Distance between binned draws (rank for SBC) and discrete uniform 

Summarize relational property of overall prior and posterior draws 