Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Bayesian Models with R

You're reading from   Learning Bayesian Models with R Become an expert in Bayesian Machine Learning methods using R and apply them to solve real-world big data problems

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher Packt
ISBN-13 9781783987603
Length 168 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Hari Manassery Koduvely Hari Manassery Koduvely
Author Profile Icon Hari Manassery Koduvely
Hari Manassery Koduvely
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Introducing the Probability Theory FREE CHAPTER 2. The R Environment 3. Introducing Bayesian Inference 4. Machine Learning Using Bayesian Inference 5. Bayesian Regression Models 6. Bayesian Classification Models 7. Bayesian Models for Unsupervised Learning 8. Bayesian Neural Networks 9. Bayesian Modeling at Big Data Scale Index

Probability distributions

In both classical and Bayesian approaches, a probability distribution function is the central quantity, which captures all of the information about the relationship between variables in the presence of uncertainty. A probability distribution assigns a probability value to each measurable subset of outcomes of a random experiment. The variable involved could be discrete or continuous, and univariate or multivariate. Although people use slightly different terminologies, the commonly used probability distributions for the different types of random variables are as follows:

  • Probability mass function (pmf) for discrete numerical random variables
  • Categorical distribution for categorical random variables
  • Probability density function (pdf) for continuous random variables

One of the well-known distribution functions is the normal or Gaussian distribution, which is named after Carl Friedrich Gauss, a famous German mathematician and physicist. It is also known by the name bell curve because of its shape. The mathematical form of this distribution is given by:

Probability distributions

Here, Probability distributions is the mean or location parameter and Probability distributions is the standard deviation or scale parameter (Probability distributions is called variance). The following graphs show what the distribution looks like for different values of location and scale parameters:

Probability distributions

One can see that as the mean changes, the location of the peak of the distribution changes. Similarly, when the standard deviation changes, the width of the distribution also changes.

Many natural datasets follow normal distribution because, according to the central limit theorem, any random variable that can be composed as a mean of independent random variables will have a normal distribution. This is irrespective of the form of the distribution of this random variable, as long as they have finite mean and variance and all are drawn from the same original distribution. A normal distribution is also very popular among data scientists because in many statistical inferences, theoretical results can be derived if the underlying distribution is normal.

Now, let us look at the multidimensional version of normal distribution. If the random variable is an N-dimensional vector, x is denoted by:

Probability distributions

Then, the corresponding normal distribution is given by:

Probability distributions

Here, Probability distributions corresponds to the mean (also called location) and Probability distributions is an N x N covariance matrix (also called scale).

To get a better understanding of the multidimensional normal distribution, let us take the case of two dimensions. In this case, Probability distributions and the covariance matrix is given by:

Probability distributions

Here, Probability distributions and Probability distributions are the variances along Probability distributions and Probability distributions directions, and Probability distributions is the correlation between Probability distributions and Probability distributions. A plot of two-dimensional normal distribution for Probability distributions, Probability distributions, and Probability distributions is shown in the following image:

Probability distributions

If Probability distributions, then the two-dimensional normal distribution will be reduced to the product of two one-dimensional normal distributions, since Probability distributions would become diagonal in this case. The following 2D projections of normal distribution for the same values of Probability distributions and Probability distributions but with Probability distributions and Probability distributions illustrate this case:

Probability distributions

The high correlation between x and y in the first case forces most of the data points along the 45 degree line and makes the distribution more anisotropic; whereas, in the second case, when the correlation is zero, the distribution is more isotropic.

We will briefly review some of the other well-known distributions used in Bayesian inference here.

You have been reading a chapter from
Learning Bayesian Models with R
Published in: Oct 2015
Publisher: Packt
ISBN-13: 9781783987603
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime