%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------------------------------------------------------------------------
% Simualtion Exercises ***************************************************
% ------------------------------------------------------------------------
% Submitted:      Dr. Eric Suess, Statistics 6401, Fall 2012
% ------------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[12]{report}

\usepackage{latexsym}
\usepackage[centertags]{amsmath}
\usepackage{amsfonts}
\usepackage{newlfont}
%\usepackage{graphicx,fullpage,subfigure,pstricks}

\setlength{\oddsidemargin}{-0.4cm}
\setlength{\evensidemargin}{0cm}
\setlength{\topmargin}{-0.75cm}
\setlength{\textheight}{8.9in}
\setlength{\textwidth}{6.5in}
\renewcommand{\baselinestretch}{1}
\setlength{\parskip}{3mm}
\setlength{\parindent}{0mm} % indented paragraphs just don't

%\pagestyle{plain}

\begin{document}
\pagestyle{myheadings}
\markright{Statistics 6401, Fall 2012}

{\large
\begin{center}
\textbf{Simulation Exercises}
\end{center}}

\begin{enumerate}
\item
(L.L.N.) Demonstrate the Law of Large Numbers for the Normal Distribution.
\begin{itemize}
\item
Sample $n$ = 1000 Standard Normal random values and put them in a vector z.
\item
Write an R function to compute the cumulative mean.
\item
Create a vector $\mathbf{x} = (1, 2, ..., n)$.
\item
Compute the cumulative mean vector $y$ from $z$ and $x$.
\item
Approximate the probability that $|y| > \epsilon$.
\item
Hint: Here is the R code needed for writing the cummean function.
\begin{verbatim}
cummean = function(w){
        n = length(w)
        y = numeric(n)
        x = c(1:n)
        y = cumsum(w)
        y = y/x
        return(y)
}
\end{verbatim}
\end{itemize}
\item
(C.L.T.) Demonstrate the Central Limit Theorem for the Normal and Exponential Distributions.
\begin{itemize}
\item
Sample $k = 1000$ samples of size $n = 30$ from the $Normal(5,2)$.
\item
Compute the means for each of the $k$ samples.
\item
Draw a histogram of these $k$ sample means.
\item
Describe the shape of the histogram.
\item
Do the above steps again with the $Exp(\lambda = 1/3)$.
\end{itemize}
\item
Demonstrate the independence of the sample mean and variance when sampling from the $Normal(5,2)$.
\begin{itemize}
\item
Sample $k = 1000$ samples of size $n = 30$ from the $Normal(5,2)$.
\item
Compute the sample means and standard deviations for each of the $k$ samples.
\item
Plot the sample means versus the sample standard deviations.
\item
Compute the correlation between the sample means and standard deviations.
\item
Do the above steps again with the $Exp(\lambda = 1/3)$.
\end{itemize}
\end{enumerate}

\end{document}
% ------------------------------------------------------------------------
