Skip to Content
Learning Probabilistic Graphical Models in R
book

Learning Probabilistic Graphical Models in R

by David Bellot
April 2016
Beginner to intermediate
250 pages
5h 38m
English
Packt Publishing
Content preview from Learning Probabilistic Graphical Models in R

Bayesian linear models

In this section, we are going to extend the standard linear regression model using the Bayesian paradigm. One of the goals is to put prior knowledge on the parameters of the models to help to solve the over-fitting problem.

Over-fitting a model

One immense benefit of going Bayesian when doing a linear model is to have better control of the parameters. Let's do an initial experiment to see what happens when the parameters are completely out of control.

We are going to generate a simple model in R and look at the parameters when they are fitted with the standard approach for linear models.

Let's first generate some data points at random to obtain 10 variables and plot them:

N <- 30 x <- runif(N, -2, 2) X <- cbind(rep(1, N), x, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Bayesian Models with R

Learning Bayesian Models with R

Hari Manassery Koduvely
Deep Learning for Chest Radiographs

Deep Learning for Chest Radiographs

Yashvi Chandola, Jitendra Virmani, H.S Bhadauria, Papendra Kumar

Publisher Resources

ISBN: 9781784392055Supplemental Content