## Course Materials for Applied Mathematics 169, Semester I, 2000

This site contains current material for AM169 in Semester I, 2000-01.

Updated this week: A new reference about Bayes Nets and Expert Systems has been added. Also, two pdf files describing Assignments 7 and 8 are included.

Han's regular office hours are on Monday, 12:30-1:30 in Room 106 at 180 George Street and on Tuesday, 1:30-4:00 in Room 110 at 182 George Street. (These locations may change occasionally, depending on availability of rooms.)

Matlab m-files and Notes concerning Assignment 2, Monte Carlo Methods

In Problem 2, the inverse tangent function should be taken to have the interval [0,2*pi) as its range of values. arctan(y/x) is simply the angle between the positive x-axis and the ray from the origin to the point (x,y). We require that angle to be in [0,2*pi).

The m-file g2.m provided here implements this convention in the way that it uses the Matlab function atan2().

The integrals in Problem 2 can be solved by formal integration by expressing them in polar coordinates.

To help you validate your programs, the true value of the integral in part 2a is 80.6730, right?

The next reference contains a tutorial on Dynamic Programming on graphs and focuses on exactly the type of problems we have been studying for MRFs: MAP estimation of the most likely state under a posterior (or marginal) distribution.

The tutorial is contained in Section 2, pages 4 through 15. You may find other sections of this article interesting, but Section 2 is particularly germane.

The Reverand Bayes

Matlab m-files and Data concerning Assignment 6, MAP Estimation and Dynamic Programming:

When developing your dynamic programming solution for this asignment, it may be helpful to test and validate the correctness of your solution by testing it on simulated data. Two Matlab m-files are provided here to facilitate simulation experiments.

The m-file markovchain.m simulates a 2-state Markov chain with the same transition probability matrix as assumed in this assignment. You can use x=markovchain(nnodes) to simulate a "true" x fitting the model. The argument nnodes is the number of terms in the sequence X_1, X_2, ... to be generated.

The m-file addnoise.m adds zero-mean Gaussian noise with standard deviation sigma to generate a sequence of observations Y_k = X_k + NOISE. The Matlab command y=addnoise(x,nnodes,sigma) generates the y-vector. (Of course, values for the arguments x, nnodes and sigma need to be provided.)

Summary of Assignment 6 (due Wednesday, November 15): The random vectors X and Y are the "hidden states" and the "observed states" of a Hidden Markov Model (HMM). A priori, X is a 2-state Markov Chain with transition probabilities P_00=0.99, P_01=0.01, P_10=0.04 and P_11=0.96. Given the X's, the components of Y are (conditionally) independent Gaussian random variables, Y_i has (conditional) expected value X_i, and standard deviation sigma=0.6. Y_i is observed for i=1,2,...,200.

The ASCII file obs.mat contains the observed data for Assignment 6. Downlaod and store this file in a directory that is in your Matlab path. Then bring it into your active workspace by using the Matlab command "load obs.mat -ascii". Assign y=obs, and estimate the "hidden states" x; i.e., compute the MAP estimate using dynamic programming.

• Download obs.mat, Matlab file containing the observation vector y to be used to estimate the most likely x.

The following link provides a nice and elementary discussion of Bayes Nets by Eugene Charniak.

Matlab m-files and Notes concerning Assignment 9, Expert Medical System

The m-files provided here are described on the handout for this assignment. They compute all of the necessary conditional probability distributions for the DAG.

(A pdf file of the assignemnt per se will also be provided in the next few hours.)