The codes below help learn and implement Bayesian Linear Regression in R.
Part 1: Here, we start with ordinary least square regression and then formulate and solve Bayesian linear regression with Zellner's g-prior.
Click here for the Rcode. The R code uses the data example pbc.vote from BaM package of R:
Click here to download csvfile containing the data.
Click here to download the pdf containing description of variables in the data.
Part 2: We demonstrate how the ideas of part 1 can be easily extended to modeling non-linear functional relationships.
click here for the Rcode.
Part 3: In part 2, we used cross validation criteria to determine the smoothing parameter. Here, we demonstrate a Bayesian formulation to determine the smoothing parameter.
click here for the Rcode
Part 3: In part 2, we used cross validation criteria to determine the smoothing parameter. Here, we demonstrate a Bayesian formulation to determine the smoothing parameter.
click here for the Rcode