SIT743 Multivariate and Categorical Data Analysis Assignment-2 Total Marks = 100, Weighting - 40% Due date: 25th September 2019 by 11.30 PM...

Hi please find the attached files


SIT743 Multivariate and Categorical Data Analysis Assignment-2 Total Marks = 100, Weighting - 40% Due date: 25th September 2019 by 11.30 PM --------------------------------------------------------------------------------------------------------------- INSTRUCTIONS: • For this assignment, you need to submit the following TWO files. 1. A written document (A single pdf only) covering all of the items described in the questions. All answers to the questions must be written in this document, i.e, not in the other files (code files) that you will be submitting. All the relevant results (outputs, figures) obtained by executing your R code must be included in this document. For questions that involve mathematical formulas, you may write the answers manually (hand written answers), scan it to pdf and combine with your answer document. Submit a combined single pdf of your answer document. 2. A separate “.R” file or ‘.txt’ file containing your code (R-code script) that you implemented to produce the results. Name the file as “name-StudentID-Ass2- Code.R" (where `name' is replaced with your name - you can use your surname or first name, and StudentID with your student ID). • All the documents and files should be submitted (uploaded) via SIT 743 Clouddeakin Assignment Dropbox by the due date and time. • Zip files are NOT accepted. All two files should be uploaded separately to the CloudDeakin. • E-mail or manual submissions are NOT allowed. Photos of the document are NOT allowed. ================================================================= Assignment tasks Q1) [32 Marks] A survey has been conducted in Melbourne to study the travel mode choice (M) behavior of people. The list of factors that influence the travel mode choice, along with their possible values, is provided below. A Bayesian network that has been created based on the survey results is shown below, which represents the relationship between these various factors (variables). J (Occupation) ∈{Student, Employee, Individual, Others} A (Age) ∈{<18, 18-35,="" 36-55,="">55} S (Salary – monthly in dollars) ∈ {<2000, 2000-6000,="" 6000-10000,="">10000} V (owning a private car) ∈ {Yes, No} Page 1 of 7 W (Trip purpose) ∈ {Commute to work, other} D (Trip distance in km) ∈ {<1, 1-3,="" 3-6,="">6} P (Trip time period) ∈ {Peak hour, Off-peak hour} U (Trip duration in mins) ∈ {<30, 30-60,="">60} M (Travel mode choice) ∈ {Walking, Bicycle, Public transport, Car} 1.1) Write down the joint distribution ??(??, W, S, A, P, V, D, U, M) for the above network. 1.2) Find the minimum number of parameters required to fully specify the distribution according to the above network. 1.3) 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 (Q1.2) and comment. 1.4) d-separation method can be used to find two sets of independent or conditionally independent variables in a Bayesian network. For each of the statements given below from (a) to (c), perform the following: • List all the possible paths from the first (set of) node/s to the second (set of) node/s. • State if each of those paths is blocking or non-blocking with reasons. Page 2 of 7 • Hence, mention if the statement is true or false. a) ?? ⊥ V | ∅ (W is marginally independent of V) b) ?? ⊥ M | {D, W} (A is conditionally independent of M given {D, W}) c) {??,??} ⊥ D | V 1.5) Write a R-Program to produce the above Bayesian network, and perform the d-separation tests for all of the above cases mentioned in Q1.4 (a) to (c). Show the plot of the network you obtained and the output (of d-separation test) from your program. 1.6) Show the step by step process to perform variable elimination to compute ??(?? | ?? = ???????? − ????????, ?? = ??????, ?? = ???????? ????????, ?? = < ).="" use="" the="" following="" variable="" ordering="" for="" the="" elimination="" process:="" j,="" w,="" a,="" u.="" [marks="" 2+5+3+11+3+8="32]" q2)="" [16="" marks]="" implementing="" a="" bayesian="" network="" in="" r="" and="" performing="" inference="" a="" belief="" network="" models="" the="" relation="" between="" the="" variables="" oil;="" inf;="" eh;="" bp;="" rt,="" which="" stand="" for="" the="" price="" of="" oil,="" inflation="" rate,="" economy="" health,="" british="" petroleum="" stock="" price,="" and="" retailer="" stock="" price="" respectively.="" each="" variable="" takes="" different="" states="" as="" given="" below.="" (????????????????="" ℎ????????ℎ)="" ∈="" {??????,ℎ????ℎ}="" (??????????="" )="" ∈="" {??????,ℎ????ℎ}="" (??????????????????="" )="" ∈="" {??????,ℎ????ℎ}="" (????????????ℎ="" )="" ∈="" {??????,="" (????),??????????="" (????),ℎ????ℎ}="" (????????????????="" )="" ∈="" {??????,ℎ????ℎ}="" the="" belief="" network="" that="" models="" these="" variables="" has="" (probability)="" tables="" as="" shown="" below.="" page="" 3="" of="" 7="" 2.1)="" use="" the="" below="" libraries="" in="" r="" to="" create="" this="" belief="" network="" in="" r="" along="" with="" the="" probability="" values="" as="" shown="" in="" the="" above="" table.="" you="" may="" use="" the="" following="" libraries="" for="" this:="" source("https://bioconductor.org/bioclite.r")="" bioclite("rbgl")="" library(rbgl)="" library(grbase)="" library(grain)="" bioclite("rgraphviz")="" #define="" the="" appropriate="" network="" and="" use="" the="" “compilecpt()”function="" to="" compile="" list="" of="" conditional="" probability="" tables="" and="" create="" the="" network.="" a)="" show="" the="" obtained="" belief="" network="" for="" this="" distribution="" b)="" show="" the="" probability="" tables="" obtained="" from="" the="" r="" output,="" (and="" verify="" with="" the="" above="" table).="" 2.2)="" use="" r="" program="" to="" compute="" the="" following="" probabilities:="" a)="" given="" that="" the="" oil="" price="" is="" low="" and="" the="" retailer="" stock="" price="" is="" low,="" what="" is="" the="" most="" possible="" state="" of="" the="" british="" petroleum="" stock="" price?="" b)="" given="" that="" the="" inflation="" rate="" is="" low,="" what="" is="" the="" probability="" that="" retailer="" stock="" price="" is="" high?="" c)="" find="" the="" marginal="" distribution="" of="" .="" d)="" find="" the="" joint="" distribution="" of="" inflation,="" and="" british="" petroleum="" stock="" price.="" [marks:="" (3+5)="" +="" (2+2+2+2)="16]" page="" 4="" of="" 7="" q3)="" [16="" marks]="" consider="" five="" binary="" variables="" a,="" b,="" c,="" d,="" e.="" the="" directed="" acyclic="" graph="" (dag)="" shown="" below="" describes="" the="" relationship="" between="" these="" variables="" along="" with="" their="" conditional="" probability="" tables="" (cpt).="" 3.1)="" in="" the="" above="" network,="" state="" why="" a="" is="" independent="" of="" b,="" i.e.,="" a⊥b.="" 3.2)="" hence,="" find="" an="" expression="" (in="" a="" simplified="" form)="" for="" (??="??|??" =="" ,??="??)" in="" terms="" of="" .="" 3.3)="" the="" table="" shown="" below="" provides="" 20="" simulated="" data="" obtained="" for="" the="" above="" bayesian="" network.="" use="" this="" data="" to="" find="" the="" maximum="" likelihood="" estimates="" of="" ,="" ,="" and="" .="" page="" 5="" of="" 7="" 3.4)="" find="" the="" value="" of="" (??="??|??" =="" ,??="??)" using="" the="" values="" obtained="" for="" from="" the="" above="" question="" q3.3.="" [marks="" 2+="" 8="" +="" 4="" +="" 2="16]" q4)="" bayesian="" structure="" learning="" [30="" marks]="" for="" this="" question,="" you="" will="" be="" using="" a="" dataset,="" called="" “child”,="" which="" contains="" 20="" variables.="" this="" dataset="" provides="" information="" about="" diagnosing="" congenital="" heart="" disease="" in="" a="" new="" born="" "blue="" baby".="" the="" csv="" file="" (“child10k.csv”)="" containing="" the="" dataset="" can="" be="" downloaded="" from="" clouddeakin.="" use="" the="" following="" r="" code="" to="" load="" the="" child="" dataset:="" childdata=""><- read.csv(file="child10k.csv", header=true, sep=",") the true network structure of this dataset can be viewed (plot) using the following r code. use r programming, as appropriate, to answers the following questions. 4.1) use the child 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: a) 100 (first 100 data) b) 500 (first 500 data) c) 1000 (first 1000 data) d) 5000 (first 5000 data) library(bnlearn) #create and plot the network structure. modelstring = paste0("[birthasphyxia][disease|birthasphyxia][lvh|disease][ductflow|disease]", "[cardiacmixing|disease][lungparench|disease][lungflow|disease][sick|disease]", "[hypdistrib|ductflow:cardiacmixing][hypoxiaino2|cardiacmixing:lungparench]", "[co2|lungparench][chestxray|lungparench:lungflow][grunting|lungparench:sick]", "[lvhreport|lvh][age|disease:sick][lowerbodyo2|hypdistrib:hypoxiaino2]", "[ruqo2|hypoxiaino2][co2report|co2][xrayreport|chestxray][gruntingreport|grunting]") dag = model2network(modelstring) par(mfrow = c(1,1)) #source("https://bioconductor.org/bioclite.r") #bioclite("rgraphviz") graphviz.plot(dag) page 6 of 7 for each of the above cases, • provide the scores obtained for bic and bde, • plot the network structure obtained for the bic and bde scores. 4.2) based on the results obtained for the above question (q 4.1), discuss how the bic score compare with bde score for different sample sizes in terms of structure and score of the learned network. 4.3) a) find the bayesian network structures utilising the full dataset, and using both bic and bde scores. show the scores and the obtained networks. b) compare 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 the read.csv(file="CHILD10k.csv" ,="" header="TRUE," sep="," )="" the="" true="" network="" structure="" of="" this="" dataset="" can="" be="" viewed="" (plot)="" using="" the="" following="" r="" code.="" use="" r="" programming,="" as="" appropriate,="" to="" answers="" the="" following="" questions.="" 4.1)="" use="" the="" child="" 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:="" a)="" 100="" (first="" 100="" data)="" b)="" 500="" (first="" 500="" data)="" c)="" 1000="" (first="" 1000="" data)="" d)="" 5000="" (first="" 5000="" data)="" library(bnlearn)="" #create="" and="" plot="" the="" network="" structure.="" modelstring="paste0("[BirthAsphyxia][Disease|BirthAsphyxia][LVH|Disease][DuctFlow|Disease]"," "[cardiacmixing|disease][lungparench|disease][lungflow|disease][sick|disease]",="" "[hypdistrib|ductflow:cardiacmixing][hypoxiaino2|cardiacmixing:lungparench]",="" "[co2|lungparench][chestxray|lungparench:lungflow][grunting|lungparench:sick]",="" "[lvhreport|lvh][age|disease:sick][lowerbodyo2|hypdistrib:hypoxiaino2]",="" "[ruqo2|hypoxiaino2][co2report|co2][xrayreport|chestxray][gruntingreport|grunting]")="" dag="model2network(modelstring)" par(mfrow="c(1,1))" #source("https://bioconductor.org/bioclite.r")="" #bioclite("rgraphviz")="" graphviz.plot(dag)="" page="" 6="" of="" 7="" for="" each="" of="" the="" above="" cases,="" •="" provide="" the="" scores="" obtained="" for="" bic="" and="" bde,="" •="" plot="" the="" network="" structure="" obtained="" for="" the="" bic="" and="" bde="" scores.="" 4.2)="" based="" on="" the="" results="" obtained="" for="" the="" above="" question="" (q="" 4.1),="" discuss="" how="" the="" bic="" score="" compare="" with="" bde="" score="" for="" different="" sample="" sizes="" in="" terms="" of="" structure="" and="" score="" of="" the="" learned="" network.="" 4.3)="" a)="" find="" the="" bayesian="" network="" structures="" utilising="" the="" full="" dataset,="" and="" using="" both="" bic="" and="" bde="" scores.="" show="" the="" scores="" and="" the="" obtained="" networks.="" b)="" compare="" 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="">
Sep 23, 2021SIT743Deakin University
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here