[SOLVED] C python statistic network Bayesian Final Exam

$25

File Name: C_python_statistic_network_Bayesian_Final_Exam.zip
File Size: 433.32 KB

5/5 - (1 vote)

Final Exam
Due Dec 21.
1. The ASIA Bayesian network is a famous toy Bayesian network introduced in Lauritzen and Spiegelhalter, Journal of the Royal Statistical Society, Series B, 1988. The article is attached. See Figure 2 for the network and the start of section 4 for a description of the node meanings. The following website has a nice interface through which you can play with a fitted version of the model
https://www.bayesserver.com/examples/networks/asia
The network has 8 nodes. A sample X R8 from the network is decomposed as follows
X = (A,S,T,C,B,E,R,D) (1)
= (Asia, smoker, tuberculosis, cancer, bronchitis, either, x-ray, dyspnoea)
Each Xi {0,1}, e.g. a person is either a smoker (0) or not (1).
(a) Table 1 in the paper provides the parameters to the model. Show that given these parameters, P(X) is completely de- termined for all X in the sample space of X.
(b) The paper presents the problem of computing P (R = 1|A, S, D), with the intuition that knowledge of the probability of a positive X-ray will help a doctor determine if taking an x-ray is worthwhile. Compute P(R = 1|A = 1,S = 0,D =
1) in two different ways,
i. Construct a Metropolis-Hastings sampler (or if you want to try, a Gibbs sampler) for X. Use the sampler to es- timate P(R = 1|A,S,D). (Use only 1 run of your MH sampler and dont forget to allow a burn-in time).
ii. Using the relation,
P(R = 1|A = 1,S = 0,D = 1) = P(R = 1,A = 1,S = 0,D = 1),
1
P (A = 1, S = 0, D = 1) (2)

write down formulas for both the numerator and the de- nominator (these will be summations) and use R/Python to evaluate the formulas and, in turn, compute P (R = 1|A = 1,S = 0,D = 1). (Note: The small size of the network allows us to apply this explicit approach, but it would not be possible for a larger network)
(A third way of computing the probability, which is actu- ally the main point of the article, is by using versions of the backward/forward equations. We wont explore that here, but take a look at the paper if youre interested.)
2. Attached you will find the file grades.csv. The file contains the homework grades and final exam grade of 147 students who took an undergraduate class in Numerical Analysis, with each row corresponding to the grades of a particular student. Let X = (X1, X2, . . . , X14, XF ) be a random variable representing the 14 homework grades and final exam grade of a student.
Every semester, the Deans office asks me to identify students that are in danger of receiving less than a C in the class. This request is typically made after 6 homeworks have been graded. Also, often students who are doing poorly after a few home- works ask me what their chances are of getting a good grade. A students grade is determined by the following weighted total:
WEIGHTED TOTAL = 0.70*AVERAGE_HW_GRADE+ 0.30*FINAL_EXAM_GRADE
(The weighted total is therefore between 0 and 100.) Your goal
in this problem is to write a function WeightedTotalDistribution(X_16) that returns the distribution of the weighted total conditioned
on the first six homework grades, which are passed to the func-
tion in the variable X_16.
Each row in grades.csv contains the 14 homework grades, the final exam grade, and the resultant weighted total determined by the formula above.
(a) To get a feel for the data, do the following and discuss what the results imply for the dataset.
i. Apply PCA to the data.
ii. Compute the correlation of the coordinates of X. (You
can use your functions correlation function).
2

iii. Compute the mutual information of the coordinates of X. To do this, bin the data into bins covering val- ues ranging from 0 0.05, 0.05 .0.10,. . . 0.95 1.0. When computing the mutual information, use the re- lation 0log0 = 0
(b) Based on part (a), suggest an appropriate parameterized distribution for X and estimate the parameters given the data. Then code the function WeightedTotalDistribution.
(c) How good is the students average over the first 6 home- work at predicting the weighted total?
3

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] C python statistic network Bayesian Final Exam
$25