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 dowload 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
Page Updated on : 27-01-2020 08:00:50 | Copyright © 2024 Indian Institute of Management Ahmedabad | by IIMA Web Group |