CS 188 Spring 2019 Inroducion o Arificial Inelligence Wrien HW 10 Due: Monday 4/22/2019 a 11:59pm (submi via Gradescope). Leave self assessmen boxes blank for his due dae. Self assessmen due: Monday 4/29/2019 a 11:59pm (submi via Gradescope) For he self assessmen, fill in he self assessmen boxes in your original submission (you can download a PDF copy of your submission from Gradescope be sure o delee any exra ile pages ha Gradescope aaches). For each subpar where your original answer was correc, wrie correc. Oherwise, wrie and explain he correc answer. Do no leave any boxes empy. If you did no submi he homework (or skipped some quesions) bu wish o receive credi for he selfassessmen, we ask ha you firs complee he homework wihou looking a he soluions, and hen perform he self assessmen aferwards. Policy: Can be solved in groups (acknowledge collaboraors) bu mus be wrien up individually Submission: Your submission should be a PDF ha maches his emplae. Each page of he PDF should align wih he corresponding page of he emplae (page 1 has name/collaboraors, quesion 1 begins on page 2, ec.). Do no reorder, spli, combine, or add exra pages. The inenion is ha you prin ou he emplae, wrie on he page in pen/pencil, and hen scan or ake picures of he pages o make your submission. You may also fill ou his emplae digially (e.g. using a able.) Firs name Las name SID Collaboraors 1
Q1. Paricle Filering: Where are he Two Cars? As before, we are rying o esimae he locaion of cars in a ciy, bu now, we model wo cars joinly, i.e. car i for i {1, 2}. The modified HMM model is as follows: he locaion of car i S (i) he noisy locaion of he car i from he signal srengh a a nearby cell phone ower G (i) he noisy locaion of car i from GPS X (1) 1 X (1) X (1) +1 S (1) S (2) 1 G (1) S (1) S (1) 1 G (1) +1 G (1) +1 1 G (2) S (2) S (2) 1 G (2) +1 G (2) +1 X (2) 1 X (2) X (2) +1 d D(d) E L (d) E N (d) E G (d) -4 0.05 0 0.02 0-3 0.10 0 0.04 0.03-2 0.25 0.05 0.09 0.07-1 0.10 0.10 0.20 0.15 0 0 0.70 0.30 0.50 1 0.10 0.10 0.20 0.15 2 0.25 0.05 0.09 0.07 3 0.10 0 0.04 0.03 4 0.05 0 0.02 0 The signal srengh from one car ges noisier if he oher car is a he same locaion. Thus, he observaion S (i) depends on he curren sae of he oher car X (j), j i. The ransiion is modeled using a drif model D, he GPS observaion G (i) using he error model E G, and he observaion S (i) using one of he error models E L or E N, depending on he car s speed and he relaive locaion of boh cars. These drif and error models are in he able above. The ransiion and observaion models are: P (S (i) P ( 1, X(i) P (G (i) 1 ) = D(X(i), X (j) ) = 1 ) { E N ( S (i) ), if 1 2 or X(i) = X (j) E L ( ) = E G ( G (i) ). S (i) ), oherwise Throughou his problem you may give answers eiher as unevaluaed numeric expressions (e.g. 0.1 0.5) or as numeric values (e.g. 0.05). The quesions are decoupled. (a) Assume ha a = 3, we have he single paricle 3 = 1, X (2) 3 = 2). (i) Wha is he probabiliy ha his paricle becomes 4 = 3, X (2) 4 = 3) afer passing i hrough he dynamics model? also Answer: (ii) Assume ha here are no sensor readings a = 4. Wha is he join probabiliy ha he original single paricle (from = 3) becomes 4 = 3, X (2) 4 = 3) and hen becomes 5 = 4, X (2) 5 = 4)? Answer: Self assessmen If correc, wrie correc in he box. Oherwise, wrie and explain he correc answer. 2
For he remaining of his problem, we will be using 2 paricles a each ime sep. (b) A = 6, we have paricles [ 6 = 3, X (2) 6 = 0), 6 = 3, X (2) 6 = 5)]. Suppose ha afer weighing, resampling, and ransiioning from = 6 o = 7, he paricles become [ 7 = 2), 7 = 1)]. (i) A = 7, you ge he observaions S (1) 7 = 2, G (1) 7 = 2, S (2) 7 = 2, G (2) 7 = 2. Wha is he weigh of each paricle? Paricle Weigh 7 = 2) 7 = 1) (ii) Suppose boh cars cell phones died so you only ge he observaions G (1) 7 = 2, G (2) 7 = 2. Wha is he weigh of each paricle? Paricle Weigh 7 = 2) 7 = 1) Self assessmen If correc, wrie correc in he box. Oherwise, wrie and explain he correc answer. (c) To decouple his quesion, assume ha you go he following weighs for he wo paricles. Paricle Weigh 7 = 2) 0.09 7 = 1) 0.01 Wha is he belief for he locaion of car 1 and car 2 a = 7? Locaion P 7 ) P (X(2) 7 ) 7 = 1 7 = 2 7 = 4 Self assessmen If correc, wrie correc in he box. Oherwise, wrie and explain he correc answer. 3
Q2. Naive Bayes Your friend claims ha he can wrie an effecive Naive Bayes spam deecor wih only hree feaures: he hour of he day ha he email was received (H {1, 2,, 24}), wheher i conains he word viagra (W {yes, no}), and wheher he email address of he sender is Known in his address book, Seen before in his inbox, or Unseen before (E {K, S, U}). (a) Flesh ou he following informaion abou his Bayes ne: Graph srucure: Parameers: Size of he se of parameers: Self assessmen If correc, wrie correc in he box. Oherwise, wrie and explain he correc answer. Suppose now ha you labeled hree of he emails in your mailbox o es his idea: spam or ham? H W E spam 3 yes S ham 14 no K ham 15 no K (b) Use he hree insances o esimae he maximum likelihood parameers. Self assessmen If correc, wrie correc in he box. Oherwise, wrie and explain he correc answer. (c) Using he maximum likelihood parameers, find he prediced class of a new daapoin wih H = 3, W = no, E = U. Self assessmen If correc, wrie correc in he box. Oherwise, wrie and explain he correc answer. 4
(d) Now use he hree o esimae he parameers using Laplace smoohing and k = 2. Do no forge o smooh boh he class prior parameers and he feaure values parameers. Self assessmen If correc, wrie correc in he box. Oherwise, wrie and explain he correc answer. (e) Using he parameers obained wih Laplace smoohing, find he prediced class of a new daapoin wih H = 3, W = no, E = U. Self assessmen If correc, wrie correc in he box. Oherwise, wrie and explain he correc answer. (f) You observe ha you end o receive spam emails in baches. In paricular, if you receive one spam message, he nex message is more likely o be a spam message as well. Specify a new graphical ha mos naurally capures his phenomenon. Graph srucure: Parameers: Size of he se of parameers: Self assessmen If correc, wrie correc in he box. Oherwise, wrie and explain he correc answer. 5