\documentstyle[psbox,ps,11pt,fullpage]{article}

\input epsf

\begin{document}
\header{MAS.622}{5}
\problem{1}

% Graphs
% Class 1, v			vc1.eps
% Class 2, v			vc2.eps
% Classs 1 density, h=.03	c1hlow.eps
% Classs 1 density, h=.48	c1hmid.eps
% Classs 1 density, h=2.0	c1hhigh.eps
% Classs 2 density, h=.03	c2hlow.eps
% Classs 2 density, h=.8	c2hmid.eps
% Classs 2 density, h=2.5	c2hhigh.eps
% Both densities superimposed	bothdens.eps

% Discriminant, k=2		disck2.eps
% Discriminant, k=2		disck14.eps
% Discriminant, k=2		disck18.eps
%				vld.eps

Using Parzen Windows, an evidence curve for a range of values of h was
found using the following Matlab code.  The evidence curve for class 1
appears in Figure \ref{vc1} and for class 2 in Figure \ref{vc2}.

\begin{verbatim}
train = train1;
gn = 1./(sqrt(2*pi));
for hct = 1:100
h = hct/50;
lpsum = 0;
for lo = 1:20
	x = train(lo);
	density = 0;
	for s = 1:20
		if(s ~= lo)
			density = density + (gn./h)*exp(((-1/2).*(train(s)-x).^2)./(h*h));
		end
	end
	lpsum = lpsum + log(density);
end
	v(hct) = lpsum/20;
	hv(hct) = h;
end

\end{verbatim}

\begin{figure}[hbtp]
\begin{center}
\mbox{\epsfysize=3in \epsfbox{vc1.eps}}
\end{center}
\caption{Evidence curve for class 1 for varying values of h}
\label{vc1}
\end{figure}

\begin{figure}[hbtp]
\begin{center}
\mbox{\epsfysize=3in \epsfbox{vc2.eps}}
\end{center}
\caption{Evidence curve for class 2 for varying values of h}
\label{vc2}
\end{figure}

Picking 3 values of h from different parts of the curve, we'll use .03
.48 and 2.0 for class 1, and .03, .8 and 2.5 for class 2.  These
density estimates appear in Figures \ref{c1low}, \ref{c1mid},
\ref{c1high}, \ref{c2low}, \ref{c2mid}, and \ref{c2high} respectively and were determined using the following Matlab code.

\begin{verbatim}
gn = 1./(sqrt(2*pi));
train = train1;
h = .48;
density = zeros(100,1);
for xct = 1:100
x = xct/10;
	for s = 1:20
		density(xct) = density(xct) + (gn./h)*exp(((-1/2).*(train(s)-x).^2)./(h*h));
		xv(xct) = x;
	end
end
\end{verbatim}

\begin{figure}[hbtp]
\begin{center}
\mbox{\epsfysize=3in \epsfbox{c1hlow.eps}}
\end{center}
\caption{Class 1 Density estimate, h = .03}
\label{c1low}
\end{figure}

\begin{figure}[hbtp]
\begin{center}
\mbox{\epsfysize=3in \epsfbox{c1hmid.eps}}
\end{center}
\caption{Class 1 Density estimate, h = .48}
\label{c1mid}
\end{figure}

\begin{figure}[hbtp]
\begin{center}
\mbox{\epsfysize=3in \epsfbox{c1hhigh.eps}}
\end{center}
\caption{Class 1 Density estimate, h = 2.0}
\label{c1high}
\end{figure}

\begin{figure}[hbtp]
\begin{center}
\mbox{\epsfysize=3in \epsfbox{c2hlow.eps}}
\end{center}
\caption{Class 2 Density estimate, h = .03}
\label{c2low}
\end{figure}

\begin{figure}[hbtp]
\begin{center}
\mbox{\epsfysize=3in \epsfbox{c2hmid.eps}}
\end{center}
\caption{Class 2 Density estimate, h = .8}
\label{c2mid}
\end{figure}

\begin{figure}[hbtp]
\begin{center}
\mbox{\epsfysize=3in \epsfbox{c1hhigh.eps}}
\end{center}
\caption{Class 2 Density estimate, h = 2.5}
\label{c2high}
\end{figure}

Using these densities to obtain a minimum error rate classifier yields
a classifier that misclassifies test samples 22.5\% of the time for
samples actually in class 2 and 21\% of the time for samples actually
in class 1.

\problem{2}

\end{document}
