These codes are conseptually the same as in those used in the manuscript X. The important parts are creation of the matrices needed by the priors, implementation of the priors, and caching of the intermediate values in RAM-within-Gibbs and AM-within-Gibbs, otherwise the codes should be self-explanatory.