Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Learning Probabilistic Graphical Models in R
Learning Probabilistic Graphical Models in R

Learning Probabilistic Graphical Models in R: Familiarize yourself with probabilistic graphical models through real-world problems and illustrative code examples in R

eBook
€15.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Learning Probabilistic Graphical Models in R

Chapter 2. Exact Inference

After building a graphical model, one of the main tasks one wants to perform is putting questions and queries to the model. There are many ways to use graphical models and the representation they give from a joint probability distribution. For example, we can study interactions between random variables. We can also see if any correlation or causality is captured by the model. Moreover, as probability models governing the random variables are parameterized, it means that their probability distribution is fully known through being familiar with some numerical parameters. We might be interested in knowing the values of those parameters when other variables are observed.

The main focus of this chapter is on introducing algorithms to query a distribution that uses the model and observations on a subset of variables in order to discover the posterior probability distribution on another subset. It is not necessary to observe and query all the variables. In fact...

Building graphical models

The design of a graphical model usually takes into consideration two different aspects. First of all, we need to identify the variables involved in the model. The variables can refer to facts we can observe or measure, such as a temperature, a price, a distance, a number of items, an interval of time, or any other value. A variable can also represent a simple fact that can be true or false.

At the same time, and this is why we're building such models, the variables can capture parts of the problem that we cannot directly measure or estimate but that are related to the problem. For example, a physician is able to see and measure a set of symptoms for a patient. However diseases are not facts that can be directly observed. They can only be deduced from the observation of several symptoms. Let's take the common cold. It is natural to say that someone has a cold, and in practice everybody understands what it means. However, there is no such thing such as...

Variable elimination

The previous example is quite impressive and seems to be complex. In the following sections we are going to see how to deal with such complex problems and how to perform inference on them, whatever the model is. In practice, we will see that things are not as idyllic as they seem to be and there are a few restrictions. Moreover, as we saw in the first chapter, when one solves the problem of inference, one has to deal with the NP-hard problem, which leads to algorithms that have an exponential time complexity.

Nevertheless there are dynamic programming algorithms that can be used to achieve a high degree of efficiency in many problems of inference.

We recall that inference means the computing of a posterior distribution of a subset of variables, given observed values of another subset of the variables of the model. Solving this problem in general means we can choose any disjoint subsets.

Let Variable elimination be the set of all the variables in the graphical model and let Y and E be two...

Sum-product and belief updates

When computing the distribution of one variable (or a subset of variables), the main operation is the marginalization, which consists of summing over a variable (or a subset of variables) to eliminate it from the main expression. If we call ϕ a factor in the factorization of the joint distribution, we can use the following properties to generalize and improve the variable elimination algorithm we saw in the previous section:

  • Commutativity: Sum-product and belief updates
  • Associativity: Sum-product and belief updates
  • And if Sum-product and belief updates

If again we apply it to the joint distribution P(ABCD) from the previous section, we again obtain:

Sum-product and belief updates

In the end, the main expression that comes again and again is the sum-product over a factor, which can be written as Sum-product and belief updates.

So in general, if we can find a good ordering of the factors or the variables in the case of a directed graphical model as we saw until now, we can, by applying the previous sum-product formula, eliminate step by step each variable until we obtain the desired subset.

The ordering must...

The junction tree algorithm

In this section we will have an overview of the main algorithm in probabilistic graphical models. It is called the junction tree algorithm. The name arises from the fact that, before performing numerical computations, we will transform the graph of the probabilistic graphical model into a tree with a set of properties that allow the efficient computation of posterior probabilities.

One of the main aspects is that this algorithm will not only compute the posterior distribution of the variables in the query, but also the posterior distribution of all other variables that are not observed. Therefore, for the same computational price, one can have any posterior distribution.

In order to achieve such a result, the junction tree algorithm will combine the efficiency of belief propagation and the sum-product as we saw before and the generality of the variable elimination procedure. Indeed, variable elimination works on any type of tree (but not on graphs with loops) and...

Examples of probabilistic graphical models

In this last section we will show several examples of PGM that are good candidates for exact inference. The goal of this section is to show realistic yet simple examples of what can be done and to provide the reader with ideas for developing his or her own models.

The sprinkler example

This is an historical example which has been used in many textbooks. It is rather simple and shows a simple reasoning.

Let's say we look at our garden and see the grass is wet. We want to know why the grass is wet. There are two possibilities: either it was raining before or we forgot to turn off the sprinkler. Moreover, we can observe the sky. If it's cloudy, chances are it was raining before. However, if it was cloudy then presumably we didn't turn on the sprinkler, so it is more likely, in this case, we would have not forgotten to turn off the sprinkler.

This is a little example of causal reasoning that can be represented by a PGM. We identify four...

Building graphical models


The design of a graphical model usually takes into consideration two different aspects. First of all, we need to identify the variables involved in the model. The variables can refer to facts we can observe or measure, such as a temperature, a price, a distance, a number of items, an interval of time, or any other value. A variable can also represent a simple fact that can be true or false.

At the same time, and this is why we're building such models, the variables can capture parts of the problem that we cannot directly measure or estimate but that are related to the problem. For example, a physician is able to see and measure a set of symptoms for a patient. However diseases are not facts that can be directly observed. They can only be deduced from the observation of several symptoms. Let's take the common cold. It is natural to say that someone has a cold, and in practice everybody understands what it means. However, there is no such thing such as a cold, but...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Predict and use a probabilistic graphical models (PGM) as an expert system
  • Comprehend how your computer can learn Bayesian modeling to solve real-world problems
  • Know how to prepare data and feed the models by using the appropriate algorithms from the appropriate R package

Description

Probabilistic graphical models (PGM, also known as graphical models) are a marriage between probability theory and graph theory. Generally, PGMs use a graph-based representation. Two branches of graphical representations of distributions are commonly used, namely Bayesian networks and Markov networks. R has many packages to implement graphical models. We’ll start by showing you how to transform a classical statistical model into a modern PGM and then look at how to do exact inference in graphical models. Proceeding, we’ll introduce you to many modern R packages that will help you to perform inference on the models. We will then run a Bayesian linear regression and you’ll see the advantage of going probabilistic when you want to do prediction. Next, you’ll master using R packages and implementing its techniques. Finally, you’ll be presented with machine learning applications that have a direct impact in many fields. Here, we’ll cover clustering and the discovery of hidden information in big data, as well as two important methods, PCA and ICA, to reduce the size of big problems.

Who is this book for?

This book is for anyone who has to deal with lots of data and draw conclusions from it, especially when the data is noisy or uncertain. Data scientists, machine learning enthusiasts, engineers, and those who curious about the latest advances in machine learning will find PGM interesting.

What you will learn

  • Understand the concepts of PGM and which type of PGM to use for which problem
  • Tune the model's parameters and explore new models automatically
  • Understand the basic principles of Bayesian models, from simple to advanced
  • Transform the old linear regression model into a powerful probabilistic model
  • Use standard industry models but with the power of PGM
  • Understand the advanced models used throughout today s industry
  • See how to compute posterior distribution with exact and approximate inference algorithms

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 29, 2016
Length: 250 pages
Edition : 1st
Language : English
ISBN-13 : 9781784397418
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Apr 29, 2016
Length: 250 pages
Edition : 1st
Language : English
ISBN-13 : 9781784397418
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 101.97
Learning Probabilistic Graphical Models in R
€29.99
Learning Bayesian Models with R
€29.99
R Machine Learning By Example
€41.99
Total 101.97 Stars icon
Banner background image

Table of Contents

9 Chapters
1. Probabilistic Reasoning Chevron down icon Chevron up icon
2. Exact Inference Chevron down icon Chevron up icon
3. Learning Parameters Chevron down icon Chevron up icon
4. Bayesian Modeling – Basic Models Chevron down icon Chevron up icon
5. Approximate Inference Chevron down icon Chevron up icon
6. Bayesian Modeling – Linear Models Chevron down icon Chevron up icon
7. Probabilistic Mixture Models Chevron down icon Chevron up icon
A. Appendix Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.7
(3 Ratings)
5 star 66.7%
4 star 0%
3 star 0%
2 star 0%
1 star 33.3%
Franck Jun 26, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very clear book with good examples. Well explained / detailed while staying practical. A reference to own and use ! Definitely recommended.
Amazon Verified review Amazon
andrebo7 May 16, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is an excellent introduction to the theory of probabilistic graphical models and their implementation in R. One of the hallmarks of great writing is when the author anticipates questions the reader has and provides well thought out explanations. This is the case with Bellot's book. Highly recommended!
Amazon Verified review Amazon
Charles Saunders Dec 22, 2018
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
This is a December 2018 update - DO NOT BUY THIS OR ANY OTHER PACKT PUBLISHING BOOK UNLESS YOU CAN VERIFY THERE IS AN ERRATA FILE TO ACCOMPANY IT. PACKT PUBLISHING DOES NOT PRODUCE RELIABLE TEXTS. MY STUDENTS HAVE HAD A TERRIBLE TIME WITH PACKT BOOKS – THE COMPANY DOES RESPOND TO ANY QUESTIONS/REQUESTS - THE UNIVERSITY WHERE I TEACH IS NOW LOOKING CLOSELY AT THE VALIDITY OF THESE PUBLICATIONS.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.