%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ------------------------------------------------------------------------
% Project PARTI Stat 6401*************************************************
% ------------------------------------------------------------------------
% Submitted:      Dr. Eric Suess, Statistics 6401, Fall 2012
% Submitted Date: October 29, 2012
% Accepted Date:  October 29, 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, Winter 2012}

\large
\begin{center}
\textbf{Project II}
\end{center}

\noindent {\bf Instructions:} Complete one of the following suggested probability projects.

\begin{enumerate}
\item
Read Example E {\it Bayesian Inference}, Rice page 94 - 95.  

Re-work the problem using a $Beta(\alpha,\beta)$ prior instead of the $Unif(0,1)$ prior used in the example.  Use

\begin{equation}
f_\Theta(\theta) = \frac{\Gamma(\alpha + \beta)}{\Gamma(\alpha)\Gamma(\beta)} \theta^{\alpha-1} (1 - \theta)^{\beta-1}
\end{equation}

for $0 \le \theta \le 1$.  Determine the posterior density $f_{\Theta|X}(\theta|x)$.

\item
Read Example C {\it Random Walk}, Rice page 140 - 142.

Write an R program to simulate Brownian Motion for $n = 250$ values.  Plot the values.  Repeat 10 times.  Compare your pictures to the last 250 closing values of a stock traded on the NYSE.  Compare your pictures to the last 250 points of a major stock market average such as the DJIA.

\item
Read Example B, rice page 154.

Simulate n = 200 values from the BVN(0, 0, 2, 3, .75).  Fit the linear model with only the slope coefficient.  Compare the the estimate to the $\rho = 0.75$.

\item
Monte Carlo Integration.

Let $U_1, U_2, ... , U_n$ be independent uniform random values from the interval $[a,b]$.  These values have density $f(u) = 1 / (b-a)$ on that interval.  Then

\begin{equation}
E[g(U_i)] = \int_a^b g(u) \frac{1}{b-a} \  du
\end{equation}

so the original integral 

\begin{equation}
\int_a^b g(x) \  dx
\end{equation}

can be approximated by $(b-a)$ times a sample mean of $g(U_i)$.

Use Monte Carlo integration to estimate the following integrals.
Compare with the exact answers, if known.

\begin{enumerate}  
\item 
\begin{equation}
\int_0^1 x \  dx
\end{equation}

\item
\begin{equation}
\int_1^\pi e^x \  dx
\end{equation}

\item
\begin{equation}
\int_0^\infty e^{-x} \  dx
\end{equation}

\item
\begin{equation}
\int_0^1 \frac{1}{\sqrt{2\pi}} e^{-x^2/2} \  dx
\end{equation}

\item
\begin{equation}
\int_0^2 \frac{1}{\sqrt{2\pi}} e^{-x^2/2} \  dx
\end{equation}

\item
\begin{equation}
\int_0^3 \frac{1}{\sqrt{2\pi}} e^{-x^2/2} \  dx
\end{equation}

\end{enumerate}

\item
If you have another idea for a project, please propose it during office hours for approval.

\end{enumerate}


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