Resources for the Tilted Beta and Tilted Beta-Binomial Distributions

Computational Resources for Bayesian Inference

I've created these components which can be added to WinBUGS for easier and faster Bayesian computation with the tilted beta and tilted beta-binomial distributions. After the components are installed, the tilted beta distribution and tilted beta-binomial distribution can be used in WinBUGS like the pre-packaged distributions (with the exception of censored variables, see below).

You will need the latest version of WinBUGS (1.4.3). You will also need to install the WBDev environment. The location of this at the time of writing is https://www.mrc-bsu.cam.ac.uk/software/bugs/the-bugs-project-winbugs/winbugs-development/winbugs-development-interface-wbdev/. Follow the installation instructions. Also, I recommend installing the shared components.

Once you have done the above, place the code files (.ocf) in your ../WBDev/Code folder. Next locate your ../WBDev/Rsrc/Distributions.odc file. Open this file and add the following statements to the last line before the END statement.
s ~ "dtilted.beta"(s, s, s, s) "WBDevTiltedBeta.Install"
s ~ "dtilted.betabinomial"(s, s, s, s, s) "WBDevTiltedBetaBinomial.Install"

Save the file. When you restart WinBUGS, you should be able to invoke the distributions as mentioned in the PDF documentation. Please see the PDF documentation for details such as parameterization and syntax.

If you have any feedback or use these in your research, feel free to get in touch. Download here. Version 1.1, Updated 9-29-2021 (see below).

Notes: Version 1.1 of these resources should have improved numerical stability at small values of the likelihood. It looks like WinBUGS' evaluation of the exponential function is accurate down to at least exp(-714). Between there and exp(-745) it starts to get less accurate. WinBUGS cannot evaluate exp(-746) and reports it as negative infinity. Check it yourself by running the following code in WinBUGS and inspecting the Node Info tool for findlogexp.

#WinBUGS numerical test for logarithmic and exponential functions
model
{
for( i in 1 : 1000 ) {
  findexp[i] <- exp(-i)
  findlogexp[i] <- log(findexp[i]) }
}

Version 1.1 is able to evaluate much smaller likelihoods.