Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given the Bayesian Networks Inference example discussed in the class, answer the following questions. 1 ) The class example includes four random variables: Rain, Maintenance,

Given the Bayesian Networks Inference example discussed in the class, answer the following questions.
1) The class example includes four random variables: Rain, Maintenance, Train and Appointment. Their dependency relations are: Maintenance depends on Rain, Train depends on Rain and Maintenance, Appointment depends on Train. Construct the Bayesian network and visualize it.(Tip: you can use pgmpy, pomegranate or any popular Python library to construct the Bayesian network, and use matplotlib or other library to visualize the network structure).
2) Based on the constructed Bayesian network, make the following inferences: (1) P (Rain=heavy,
Maintenance=yes),(2) P(Appointment=attend | Rain=none, Maintenance=no)
2
3) Suppose the probability of attending or missing todays Appointment is not dependent on Train, but
only dependent on yesterdays Appointment. Given the initial state [1,0] as the probability
distribution of attend and miss, and the transition matrix P =[[0.9,0.1],[0.5,0.5]], what is the
probability distribution of attend and miss ten days later? (Tip: Simulate the Markov chain over n
steps).
Conditional Probability Tables used for 1) and 2):
P(Rain)=(
"none": 0.7,
"light": 0.2,
"heavy": 0.1
)
P(Maintenance| Rain)=([
["none", "yes", 0.4],
["none","no",0.6],
["light", "yes", 0.2],
["light","no",0.8],
["heavy", "yes", 0.1],
["heavy","no",0.9]
])
P(Train | Rain, Maintenance)=([
["none", "yes", "on time", 0.8],
["none", "yes", "delayed", 0.2],
["none","no","on time", 0.9],
["none","no", "delayed", 0.1],
["light", "yes", "on time", 0.6],
["light", "yes", "delayed", 0.4],
["light","no","on time", 0.7],
["light","no", "delayed", 0.3],
["heavy", "yes", "on time", 0.4],
["heavy", "yes", "delayed", 0.6],
["heavy","no","on time", 0.5],
["heavy","no", "delayed", 0.5],
])
P(Appointment)=([
["on time", "attend", 0.9],
["on time", "miss", 0.1],
["delayed", "attend", 0.6],
["delayed", "miss", 0.4]
])
the transition matrix used for 3):
P = $0.90.1
0.50.5*
It means P(attend -> attend)=0.9, P(attend -> miss)=0.1, P(miss ->
attend)=0.5, P(miss -> miss)=0.5
Coding Style: define a function for each question. please use python3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications Dexa 2022 Workshops 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 In Computer And Information Science 33

Authors: Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil ,Bernhard Moser ,Alfred Taudes ,Atif Mashkoor ,Johannes Sametinger ,Jorge Martinez-Gil ,Florian Sobieczky ,Lukas Fischer ,Rudolf Ramler ,Maqbool Khan ,Gerald Czech

1st Edition

ISBN: 3031143426, 978-3031143427

More Books

Students also viewed these Databases questions