Book Image

Learning Bayesian Models with R

By : Hari Manassery Koduvely
Book Image

Learning Bayesian Models with R

By: Hari Manassery Koduvely

Overview of this book

Table of Contents (16 chapters)
Learning Bayesian Models with R
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Exercises


  1. By using the definition of conditional probability, show that any multivariate joint distribution of N random variables has the following trivial factorization:
  2. The bivariate normal distribution is given by:

    Here:

    By using the definition of conditional probability, show that the conditional distribution can be written as a normal distribution of the form where and .

  3. By using explicit integration of the expression in exercise 2, show that the marginalization of bivariate normal distribution will result in univariate normal distribution.

  4. In the following table, a dataset containing the measurements of petal and sepal sizes of 15 different Iris flowers are shown (taken from the Iris dataset, UCI machine learning dataset repository). All units are in cms:

    Sepal Length

    Sepal Width

    Petal Length

    Petal Width

    Class of Flower

    5.1

    3.5

    1.4

    0.2

    Iris-setosa

    4.9

    3

    1.4

    0.2

    Iris-setosa

    4.7

    3.2

    1.3

    0.2

    Iris-setosa

    4.6

    3.1

    1.5

    0.2

    Iris-setosa

    5

    3.6

    1.4

    0.2

    Iris-setosa

    7

    3.2

    4.7

    1.4

    Iris-versicolor

    6.4

    3.2

    4.5

    1.5

    Iris-versicolor

    6.9

    3.1

    4.9

    1.5

    Iris-versicolor

    5.5

    2.3

    4

    1.3

    Iris-versicolor

    6.5

    2.8

    4.6

    1.5

    Iris-versicolor

    6.3

    3.3

    6

    2.5

    Iris-virginica

    5.8

    2.7

    5.1

    1.9

    Iris-virginica

    7.1

    3

    5.9

    2.1

    Iris-virginica

    6.3

    2.9

    5.6

    1.8

    Iris-virginica

    6.5

    3

    5.8

    2.2

    Iris-virginica

    Answer the following questions:

    1. What is the probability of finding flowers with a sepal length more than 5 cm and a sepal width less than 3 cm?

    2. What is the probability of finding flowers with a petal length less than 1.5 cm; given that petal width is equal to 0.2 cm?

    3. What is the probability of finding flowers with a sepal length less than 6 cm and a petal width less than 1.5 cm; given that the class of the flower is Iris-versicolor?