SIT743 - Bayesian Learning and Graphical Models Assignment

Download Solution Order New Solution

Assignment Task

Question

1. Consider the hourly pedestrian count data collected at the Argyle Square park in Melbourne over the three-day period. This dataset is given as a CSV file, named “ ArgyleSquarePedestWalkbysCSVFile.csv ”.

  • Plot the histogram for the count Comment on the shape. How many modes can be observed in the data?
  • Fit a single Gaussian model N(u, σ ) to the distribution of the data, where u is the mean and σ is the standard deviation of the Gaussian distribution. Find the maximum likelihood estimate (MLE) of the parameters, i.e., the mean u  and the standard deviation σ. Plot the obtained (single Gaussian) density distribution along with the histogram on the same graph.
  • Fit a mixture of Gaussians model to the distribution of the data using number of Gaussians equal to 3 (three) . Use R programming to perform this. Provide the mixing coefficients , mean and standard deviation for each of the Gaussians Plot all these Gaussians on top of the histogram plot. Include a plot of the combined density distribution as well (use different colors for the density plots in the same graph).
  • Provide a plot of the log likelihood values obtained over the iterations and comment on them.
  • Comment on the distribution models obtained in Q1.2 and Q1.3. Which one is better?

2. A study is performed by a company, called SWVic , to understand the relationship between the safety factors and the number of accidents in works involve electrical and mechanical installations. A list of factors that influence the safety along with their possible values, and a Bayesian network that represents the relationship between these factors (variables) are given below.

N (Number of Accidents) ∈ {Low, High}

E (Work experience) ∈ {Long, Medium, short}

S (Smoking habit) ∈ {Smoking, Not-smoking}

D (Drinking habit) ∈{Drinking, Not-drinking}

A (Safety Attitude) ∈ {Good, Average, Poor}

W (Workmate Influence) ∈ { Positive, Neutral, Negative}

i. Write down the joint distribution P(W, E, S, M, A, D, R, N) for the above

ii. Find the minimum number of parameters required to fully specify the distribution according to the above network.

iii. Write down a joint probability density function if there are no independence among the variables is assumed.

  • How many parameters are required, at a minimum, if there are no independencies among the variables is assumed?
  • Compare with the result of the above question (Q2.2) and

iv. From a previous study, the company SWVic has found out that the Safety Attitude (A) is conditionally independent of Workmate Influence (W), given the Work experience (E). The company wants to modify the Bayesian network given in Figure 1 by incorporating this new information. A ssume now that Safety Attitude (A) is conditionally independent of Workmate Influence (W), given the Work experience (E), perform the following.

  • What change will happen to the Bayesian network (shown in Figure 1) when the above assumption is considered. Draw the new Bayesian network considering the above assumption (you may draw this by hand).
  • Compute the change in the minimum number of parameters required for this new Bayesian network , compared to the minimum number of parameters required for the Bayesian network shown in Figure 1. Comment on the results.

v. d-separation method can be used to find two sets of independent or conditionally independent variables in a Bayesian network. Use the Bayesian network given in Figure 1 to answer the following:

  • For each of the statements/questions given below from (a) to (b), perform the following:
  • List all the possible paths from the first (set of) node/s to the second (set of) node/s considered for the independence check. State if each of those paths is blocking or non-blocking with reasons .
  • Hence, answer the question about
    • Is Number of Accidents (N) conditionally independent of Workmate Influence (W) given Safety Attitude (A), Smoking habit (S) and Drinking habit (D) ?
    • Is E ⊥ M?

vi. For the Bayesian network shown in Figure 1 , find all the nodes that are conditionally independent of M (Management Commitment ) given A ( Safety Attitude) , D ( Drinking habit ) and N ( Number of Accidents) .

vii. Write a R-Program to produce the Bayesian network shown in Figure 1 , and perform the d-separation tests for cases given below. Show the plot of the network you obtained and the output (of d-separation test) from your

  1. {W, S} ⊥ {E, M} | {D}
  2. {A, S} ⊥ M | {W, N}

viii. For the Bayesian network shown in Figure 1 ,

  • find the Markov blanket of D ( Drinking habit) .
  • find all the nodes that are conditionally independent of D (Drinking habit) given its Markov blanket.
  • use R program to find the Markov blanket of Safety Attitude (A) . Plot the Bayesian network and show the Markov blanket nodes in the network using different colour.

3. A belief network shown below (Figure 2) describes the relation between four variables A, B, C, and D, along with their conditional probability tables (CPT). Each variable takes different states as given below.

i. Obtain an [removed]in a simplified form) for P(C = 1 | A = 1, B = 00, D = 22) ( Show the steps clearly) .

ii. The table shown below provides 30 simulated data obtained for the above Bayesian network. Use this data to find the maximum likelihood estimates of a, β ,λ  and σ.

iii. Find the value of P(C = 1 | A = 1, B = 00, D= 22) using the appropriate values obtained from the above question 2 .

iv. Now consider the following values for a, β ,λ and σ, to answer the following question: a = 00. 33, β = 00. 44, λ  = 00. 55, σ =00. 33.

Use the below libraries in R to create the above belief network along with the probability values using R-programming , as shown in the CPT tables of Figure 2 .

  • Write R code and show the obtained belief network for this
  • Show the probability tables obtained from the R output, (and verify with the above table).
  • Use R program to compute the following probabilities:
    • Find the joint distribution of B, C and
    • Find the marginal distribution of
    • Find P(A=0 | C=2, D=1).

4. Bayesian Structure Learning

For this question, you will be using a dataset, called “ hailfinder” available from the ‘bnlearn’ R package. which contains 56 variables. This has meteorological data.

i. Use the hailfinder dataset to learn Bayesian network structures using hill- climbing (hc) algorithm , utilizing two different scoring methods, namely Bayesian Information Criterion score (BIC score) and the Bayesian Dirichlet equivalent (Bde score), for each of the following sample sizes of the data :

  • 500 (first 500 data)
  • 2000 (first 2000 data)
  • 10000 (first 10000 data)

For each of the above cases,

  • provide the scores obtained for BIC and BDe,
  • Plot the network structure obtained for the BIC and BDe

ii. Based on the results obtained for the above question (Q 1), discuss how the BIC score compare with BDe score for different sample sizes in terms of structure and score of the learned network.

iii. Find the Bayesian network structures utilising the full dataset, and using both BIC and Bde scores. Show the scores and the obtained networks.

C ompare the networks obtained above (in Q4.3.a) for each BIC and Bde scoring methods with the true network structure and comment . Use the “compare()” function and “graphviz.compare()” function available in the “bnlearn” R package to perform these comparisons and comment.

Fit the data to the network obtained using the BIC score in the above question (Q4.3.a) in order to compute the conditional probability distribution table entries (CPD table values). Show the obtained CPD table entries for the variable “ CombMoisture ”.

Use the above learned network obtained (in Q4.3.c) to find the probability of :

P( CombMoisture =" Dry " | RaoContMoist = " Dry ", SatContMoist =" VeryWet ")

5. Real world application of Bayesian networks

Download the following article from the link provided below. Read that article and answer the following questions. This article provides a real life case study on creating and using a Bayesian network for road accident data analysis .

a. What are the variables used in this anlysis?

What is the name of the algorithm used for learning the Bayesian network structure?

b. In the learnt Bayesian network provided in Figure 4 (in the paper), is Injury type independent of Sex given the knowledge about Seat belt, licence type and vehicle type? Explain.

c. In Figure 5 (in the paper), explain what the probabilities shown for Injury Type means.

d. Read the section titled “Parameter learning in the road accident network” in that paper and find the following probabilities:

  • The probability of dead while wearing seat belt and driving a car, knowing that the driver has a diploma degree and a type 2 driving license
  • The probability of being not-injured while wearing seat belt and driving a car, knowing that the driver has a diploma degree and a type 2 driving

This SIT743 - Science and Math has been solved by our PhD Experts at My Uni Paper.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.