% This is a simple LaTex sample document that gives a submission format
%   for IEEE PAMI-TC conference submissions.  Use at your own risk.

% Make two column format for LaTex 2e.\
\documentclass[12pt]{article} %,twocolumn

%\usepackage{times,amsmath,amsfonts}

% Use following instead for LaTex 2.09 (may need some other mods as well).
%\documentstyle[times,twocolumn]{article}
\usepackage[dvips]{graphicx,graphics}
% Set dimensions of columns, gap between columns, and paragraph indent
\setlength{\textheight}{10in} \setlength{\textwidth}{6in}
%\setlength{\columnsep}{0.3125in} \setlength{\topmargin}{0in}
\setlength{\headheight}{0in} \setlength{\headsep}{-1in}
\setlength{\parindent}{1pc}
\setlength{\oddsidemargin}{-.3in}  % Centers text.
\setlength{\evensidemargin}{-.3in}

% Add the period after section numbers.  Adjust spacing.
\newcommand{\Section}[1]{\vspace{-8pt}\section{\hskip -1em.~~#1}\vspace{-3pt}}
\newcommand{\SubSection}[1]{\vspace{-3pt}\subsection{\hskip -1em.~~#1}
        \vspace{-3pt}}
\newcommand{\bqn}{\begin{eqnarray}}
\newcommand{\eqn}{\end{eqnarray}}
\newcommand {\diff}[1] {\frac{\partial}{\partial #1}}
\newcommand{\jacob}[3]{\frac{\partial^2 #3}{\partial #1 \partial #2}}
\newcommand{\der}[2]{\frac{\partial #2}{\partial #1}}
\begin{document}

% Make title bold and 14 pt font (Latex default is non-bold, 16pt)
\title{Stat 471: Homework 02}
% For single author (just remove % characters)
\author{Moo K. Chung\\
mchung@stat.wisc.edu}
% For two authors (default example)
\maketitle \thispagestyle{empty}

{\bf Due Date:} October 10, 1:20pm. No late assignments will be
accepted or graded. There will be $10\%$ bonus points for
exceptional solutions. Do not use any built in random number
generators other than your own random number generators.

\begin{enumerate}

\item (Computational) The data in
http://www.stat.wisc.edu/~mchung/teaching/data/strength.data is
from Blakely {\em et al} (1995, Journal Personnel Psychology).
There are two measurements $\tt{arm}$ and $\tt{grip}$ that measure
the strength of construction workers. Check if two measurements
follow a bivariate normal distribution.

\item Based on standard normal random number generator you built
in homework 1, write a function that generate 4D random vector
$X=(x_1,x_2,x_3,x_4)'$ whose components are normally distributed
with the following covariance matrix
$${\bf Cov}({\bf vec}(X))= \left(%
\begin{array}{cc}
  2 & 1 \\
  1 & 2 \\
\end{array}%
\right) \otimes \left(%
\begin{array}{cc}
  1 & 0 \\
  0 & 1 \\
\end{array}%
\right).$$


\item If the singular value decomposition of $X$ is $X=UDV'$ (see
Lecture 8), show that $VD^{-}U'$ is the Moore-Penrose generalized
inverse of $X$.

\item Using data in problem 1, fit the data with the following
model $$\tt{grip} = \alpha_0\phi_0(\tt{arm}) +
\alpha_1\phi_1(\tt{arm}) + \epsilon,$$ where $\phi_1$ and $\phi_2$
are the first two Hermite polynomials. What is the expected grip
strength when the person has the arm strength of $200$ pounds?
Compare your model with the linear model $\tt{grip}= \beta_0 +
\beta_1 \tt{arm} + \epsilon$ studied in Lecture 9.

\item Compute the digits of the constant $e$ upto 3 decimal places
only using the exponential random number generator studied in
Lecture 2 and the concept of Monte-Carlo integration.
\end{enumerate}

\end{document}
