Package: BSL 3.2.5

Leah F. South

BSL: Bayesian Synthetic Likelihood

Bayesian synthetic likelihood (BSL, Price et al. (2018) <doi:10.1080/10618600.2017.1302882>) is an alternative to standard, non-parametric approximate Bayesian computation (ABC). BSL assumes a multivariate normal distribution for the summary statistic likelihood and it is suitable when the distribution of the model summary statistics is sufficiently regular. This package provides a Metropolis Hastings Markov chain Monte Carlo implementation of four methods (BSL, uBSL, semiBSL and BSLmisspec) and two shrinkage estimators (graphical lasso and Warton's estimator). uBSL (Price et al. (2018) <doi:10.1080/10618600.2017.1302882>) uses an unbiased estimator to the normal density. A semi-parametric version of BSL (semiBSL, An et al. (2018) <arxiv:1809.05800>) is more robust to non-normal summary statistics. BSLmisspec (Frazier et al. 2019 <arxiv:1904.04551>) estimates the Gaussian synthetic likelihood whilst acknowledging that there may be incompatibility between the model and the observed summary statistic. Shrinkage estimation can help to decrease the number of model simulations when the dimension of the summary statistic is high (e.g., BSLasso, An et al. (2019) <doi:10.1080/10618600.2018.1537928>). Extensions to this package are planned. For a journal article describing how to use this package, see An et al. (2022) <doi:10.18637/jss.v101.i11>.

Authors:Ziwen An [aut], Leah F. South [aut, cre], Christopher C. Drovandi [aut]

BSL_3.2.5.tar.gz
BSL_3.2.5.tar.gz(r-4.5-noble)BSL_3.2.5.tar.gz(r-4.4-noble)
BSL.pdf |BSL.html
BSL/json (API)
NEWS

# Install 'BSL' in R:
install.packages('BSL', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:
  • cell - Cell biology example
  • ma2 - An MA(2) model
  • mgnk - The multivariate G&K example
  • toad - Toad example

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

2.48 score 3 stars 9 scripts 294 downloads 13 mentions 36 exports 53 dependencies

Last updated 2 years agofrom:f23046345c. Checks:OK: 2. Indexed: yes.

TargetResultDate
Doc / VignettesOKOct 31 2024
R-4.5-linux-x86_64OKOct 31 2024

Exports:bslcell_priorcell_simcell_sumcombinePlotsBSLcor2covestimateLoglikeestimateWhiteningMatrixgaussianRankCorrgaussianSynLikegaussianSynLikeGhuryeOlkingetGammagetLoglikegetPenaltygetThetama2_priorma2_simma2_sim_vecma2_summgnk_simmgnk_sumnewModelobsMat2deltaxplotselectPenaltysemiparaKernelEstimateshowsim_toadsimulate_cellsimulationsummarysummStatsynLikeMisspectoad_priortoad_simtoad_sum

Dependencies:ADGofTestclicodacodetoolscolorspacecopulacorpcordigestdoRNGfansifarverforeachggplot2glassogluegridExtragslgtableisobanditeratorslabelinglatticelifecyclemagrittrMASSMatrixmgcvmunsellmvtnormnlmenumDerivpcaPPpillarpkgconfigpsplineR6rbibutilsRColorBrewerRcppRcppArmadilloRdpackrlangrngtoolsscalesstablediststringistringrtibbleutf8vctrsviridisLitewhiteningwithr

Readme and manuals

Help Manual

Help pageTopics
Bayesian synthetic likelihoodBSL-package BSL
Performing BSL, uBSL, semiBSL and BSLmisspecbsl
S4 class ``BSL''.BSL-class BSLclass getGamma,BSL-method getLoglike,BSL-method getTheta,BSL-method plot,BSL,ANY-method show,BSL-method summary,BSL-method
Cell biology examplecell cell_prior cell_sim cell_sum
Plot the densities of multiple ``bsl'' class objects.combinePlotsBSL
Convert a correlation matrix to a covariance matrixcor2cov
Estimate the synthetic likelihoodestimateLoglike
Estimate the Whitening matrix to be used in the ``wBSL'' method of Priddle et al. (2021)estimateWhiteningMatrix
Gaussian rank correlationgaussianRankCorr
Estimate the Gaussian synthetic (log) likelihoodgaussianSynLike
Estimate the Gaussian synthetic (log) likelihood with an unbiased estimatorgaussianSynLikeGhuryeOlkin
Obtain the gamma samples (the latent parameters for BSLmisspec method) from a "BSL" objectgetGamma
Obtain the log-likelihoods from a "BSL" objectgetLoglike
Obtain the selected penalty values from a "PENALTY" objectgetPenalty
Obtain the samples from a "BSL" objectgetTheta
An MA(2) modelma2 ma2_prior ma2_sim ma2_sim_vec ma2_sum
The multivariate G&K examplemgnk mgnk_sim mgnk_sum
S4 class ``MODEL''MODEL MODEL-class newModel simulation,MODEL-method summStat,ANY,MODEL-method
Convert an observation matrix to a vector of n-day displacementsobsMat2deltax
S4 class ``PENALTY''getPenalty,BSL-method PENALTY PENALTY-class PENALTYclass plot,PENALTY,ANY-method show,PENALTY-method
Selecting the Penalty ParameterselectPenalty
Estimate the semi-parametric synthetic (log) likelihoodsemiparaKernelEstimate
The simulation function for the toad examplesim_toad
Simulation function of the cell biology examplesimulate_cell
Run simulations with a give "MODEL" objectsimulation
Compute the summary statistics with the given datasummStat
Estimate the Gaussian synthetic (log) likelihood whilst acknowledging model incompatibilitysynLikeMisspec
Toad exampletoad toad_prior toad_sim toad_sum