Final Project, Part II

To begin, read the sections on Maximum likelihood parameter estimation from complete data and Maximum likelihood parameter estimation with missing values, and (as in the warmup exercise), try and get the sample code to run in Matlab.

The file learn_sprinkler.m contains code from the BNT tutorial, implementing these two types of learning, as well as the more complicated K2 algorithm for Structure Learning (when you need to learn not only the conditional probability tables but also the internal structure of the network). Experiment with different sample sizes to see how many samples it takes before all three learning algorithms work reasonably well, where "reasonably well" means that it learns the structure (Learning Structure reports a value of 1 at the last iteration), and at least some of the learned proabilities are close to the originals. (As usual, an efficient way to do this is to start with a small number, like 5, and then double it until you get good results.) Put the answer in a writeup file (PDF) to be turned it with the lab. Your answer should say how many iterations it took to learn the structure, as well as a providing a comparison of a few sample learned-versus-origional probablities.

Next, combine the relevant code from your

So, at the end of this lab, you should turn in

Firing a Howitzer requires moving it from its Down (resting) state, to its Pre-firing state, and
then to its Firing state.^{1} Each of these moves takes a single time step.
After firing, the Howitzer always moves to the Down state. If Melvin is in Staunton and his
Howitzer was in the Pre-fire state
on the previous step, he will always fire the Howitzer. Otherwise, the Howitzer will switch between
its Down and Pre-fire states with 50/50 probability.

The main goal of this part of the assignment is for you to understand how to translate a verbal description of a process like this one into a DBN DAG and conditional probability tables (CPTs). So at a minimum you should turn in a picture of the DAG (generated as you did in last week's lab), as well as the CPTs. You will need four variables: Location (town) and State at the present time step and the next time step. Your DAG should reflect the fact that the current location influences the next location, the current Howitzer state influence the next state, and the next location influences the next state. There are no other dependencies in the model.

To try out the game, type **play(@human)** in Matlab to run the game using human guidance. Then
take a look at the files in the **@agent** directory. These files contain a
partially-implemented agent that uses a DBN to predict the Howitzer's next location and state and
makes a decision based
on the prediction. In the file **agent.m**, you should add some code based on the DAG and
CPT's that you came up with in the previous section. In the file **getcmd.m**, you should add
code to run inference on your DBN. Happy hunting! The **XXX** comments show you where to
add your code. You should not modify any of the existing code.