\documentclass[12pt]{article} %\usepackage{amsbsy} % for \boldsymbol and \pmb \usepackage{graphicx} % To include pdf files! \usepackage{amsmath} \usepackage{amsbsy} \usepackage{amsfonts} \usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref} % For links \usepackage{fullpage} %\pagestyle{empty} % No page numbers \begin{document} %\enlargethispage*{1000 pt} \begin{center} {\Large \textbf{STA 2101/442 Assignment 1 (Mostly Review)}}\footnote{This assignment was prepared by \href{http://www.utstat.toronto.edu/~brunner}{Jerry Brunner}, Department of Statistics, University of Toronto. It is licensed under a \href{http://creativecommons.org/licenses/by-sa/3.0/deed.en_US} {Creative Commons Attribution - ShareAlike 3.0 Unported License}. Use any part of it as you like and share the result freely. The \LaTeX~source code is available from the course website: \href{http://www.utstat.toronto.edu/~brunner/oldclass/appliedf12} {\texttt{http://www.utstat.toronto.edu/$^\sim$brunner/oldclass/appliedf12}}} \vspace{1 mm} \end{center} \noindent Except for Question~\ref{darwin}, the questions are practice for the quiz on Friday Sept. 21st, and are not to be handed in \begin{enumerate} \item The random variable $X$ has density $f(x) = \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha) \Gamma(\beta)} x^{\alpha-1}(1-x)^{\beta-1}$ for $00$ and $\beta>0$. Find $E(X)$; show your work. \item Let $X_1, \ldots, X_n$ be a random sample from a distribution with mean $\mu$ and variance $\sigma^2$. \begin{enumerate} \item Show that the sample variance $S^2=\frac{\sum_{i=1}^n(X_i-\overline{X})^2}{n-1}$ is an unbiased estimator of $\sigma^2$. \item Denote the sample standard deviation by $S = \sqrt{S^2}$. Assume that the data come from a continuous distribution, so it's easy to see that $Var(S) \neq 0$. Show that $S$ is a \emph{biased} estimator of $\sigma$. \end{enumerate} \item For each of the following distributions, derive a general expression for the Maximum Likelihood Estimator (MLE); don't bother with the second derivative test. Then use the data to calculate a numerical estimate; you should bring a calculator to the quiz in case you have to do something like this. \begin{enumerate} \item $p(x)=\theta(1-\theta)^x$ for $x=0,1,\ldots$, where $0<\theta<1$. Data: \texttt{4, 0, 1, 0, 1, 3, 2, 16, 3, 0, 4, 3, 6, 16, 0, 0, 1, 1, 6, 10}. Answer: 0.2061856 % Geometric .25, thetahat = 1/xbar \item $f(x) = \frac{\alpha}{x^{\alpha+1}}$ for $x>1$, where $\alpha>0$. Data: \texttt{1.37, 2.89, 1.52, 1.77, 1.04, 2.71, 1.19, 1.13, 15.66, 1.43} Answer: 1.469102 % Pareto alpha = 1 (one over uniform) alphahat = 1/mean(log(x)) \item $f(x) = \frac{\tau}{\sqrt{2\pi}} e^{-\frac{\tau^2 x^2}{2}}$, for $x$ real, where $\tau>0$. Data: \texttt{1.45, 0.47, -3.33, 0.82, -1.59, -0.37, -1.56, -0.20 } Answer: 0.6451059 % Normal mean zero tauhat = sqrt(1/mean(x^2)) \item $f(x) = \frac{1}{\theta} e^{-x/\theta}$ for $x>0$, where $\theta>0$. Data: \texttt{0.28, 1.72, 0.08, 1.22, 1.86, 0.62, 2.44, 2.48, 2.96} Answer: 1.517778 % Exponential, true theta=2, thetahat = xbar \end{enumerate} \item Let $X_1, \ldots, X_n$ be a random sample from a normal distribution with mean $\mu$ and variance $\sigma^2$, so that $T = \frac{\sqrt{n}(\overline{X}-\mu)}{S} \sim t(n-1)$. This is something you don't need to prove. \begin{enumerate} \item Derive a $(1-\alpha)100\%$ confidence interval for $\mu$. ``Derive" means show all the high school algebra. \item Show that using a $t$-test, $H_0:\mu=\mu_0$ is rejected at significance level $\alpha$ if and only the $(1-\alpha)100\%$ confidence interval for $\mu$ does not include $\mu_0$. \item Suppose that a random sample from a normal distribution yields a 95\% confidence interval for $\mu$ of $(6.25,11.34)$. Does this mean $Pr\{6.25<\mu<11.34\}=0.95$? Answer Yes or No and briefly explain. \end{enumerate} \item \label{darwin} In Chapter One of Davison's \emph{Statistical models}, look at the data that Charles Darwin gave to his cousin Francis Galton to analyze (Galton is responsible for the term ``regression" as it is used in Statistics). Using R, do a reasonable analysis to determine whether heights of maize plants depend on the method of fertilization. Bring your printout to the quiz; you may be asked to hand it in. Be ready to \begin{itemize} \item Describe the data set in in clear language. What are the variables? What are the cases? \item State your model and your null hypothesis, in symbols. \item Justify your choice of model in terms of how the data were collected. \item Express your conclusion in plain, non-statistical language that a biologist could understand. \end{itemize} Remember, the computer assignments in this course are \emph{not group projects}. You are expected to do the work yourself. There is more than one correct answer. I did the analysis four different ways, and I consider all of them correct. I can think of about five more acceptable ways that I did not try. The number of bad ways to analyze the data is virtually unlimited. % Collaboration on the computer assignments is an academic offense. \item \label{firstmat} Which statement is true? (Quantities in boldface are matrices of constants.) \begin{enumerate} \item $\mathbf{A(B+C) = AB+AC}$ \item $\mathbf{A(B+C) = BA+CA}$ \item Both a and b \item Neither a nor b \end{enumerate} \item Which statement is true? \begin{enumerate} \item $a\mathbf{(B+C)}=a\mathbf{B} + a\mathbf{C}$ \item $a\mathbf{(B+C)}=\mathbf{B}a + \mathbf{C}a$ \item Both a and b \item Neither a nor b \end{enumerate} \pagebreak \item Which statement is true? \begin{enumerate} \item $\mathbf{(B+C)A = AB+AC}$ \item $\mathbf{(B+C)A = BA+CA}$ \item Both a and b \item Neither a nor b \end{enumerate} \item Which statement is true? \begin{enumerate} \item $\mathbf{(AB)^\prime = A^\prime B^\prime}$ \item $\mathbf{(AB)^\prime = B^\prime A^\prime}$ \item Both a and b \item Neither a nor b \end{enumerate} \item Which statement is true? \begin{enumerate} \item $\mathbf{A^{\prime\prime} = A }$ \item $\mathbf{A^{\prime\prime\prime} = A^\prime }$ \item Both a and b \item Neither a nor b \end{enumerate} \item Suppose that the square matrices $\mathbf{A}$ and $\mathbf{B}$ both have inverses. Which statement is true? \begin{enumerate} \item $\mathbf{(AB)}^{-1} = \mathbf{A}^{-1}\mathbf{B}^{-1}$ \item $\mathbf{(AB)}^{-1} = \mathbf{B}^{-1}\mathbf{A}^{-1}$ \item Both a and b \item Neither a nor b \end{enumerate} \item Which statement is true? \begin{enumerate} \item $\mathbf{(A+B)^\prime = A^\prime + B^\prime}$ \item $\mathbf{(A+B)^\prime = B^\prime + A^\prime }$ \item $\mathbf{(A+B)^\prime = (B+A)^\prime}$ \item All of the above \item None of the above \end{enumerate} \pagebreak \item Which statement is true? \begin{enumerate} \item $(a+b)\mathbf{C} = a\mathbf{C}+ b\mathbf{C}$ \item $(a+b)\mathbf{C} = \mathbf{C}a+ \mathbf{C}b$ \item $(a+b)\mathbf{C} = \mathbf{C}(a+b)$ \item All of the above \item None of the above \end{enumerate} \item Let $\mathbf{A}$ be a square matrix with the determinant of $\mathbf{A}$ (denoted $|\mathbf{A}|$) equal to zero. What does this tell you about $\mathbf{A}^{-1}$? No proof is required here. \item Recall that $\mathbf{A}$ symmetric means $\mathbf{A=A^\prime}$. Let $\mathbf{X}$ be an $n$ by $p$ matrix. Prove that $\mathbf{X^\prime X}$ is symmetric. \item Recall that an inverse of the matrix $\mathbf{A}$ (denoted $\mathbf{A}^{-1}$) is defined by two properties: $\mathbf{A}^{-1}\mathbf{A=I}$ and $\mathbf{AA}^{-1}=\mathbf{I}$. Prove that inverses are unique, as follows. Let $\mathbf{B}$ and $\mathbf{C}$ both be inverses of $\mathbf{A}$. Show that $\mathbf{B=C}$. \item Let $\mathbf{X}$ be an $n$ by $p$ matrix with $n \neq p$. Why is it incorrect to say that $(\mathbf{X^\prime X})^{-1}= \mathbf{X}^{-1}\mathbf{X}^{\prime -1}$? \item Suppose that the square matrices $\mathbf{A}$ and $\mathbf{B}$ both have inverses. Prove that $\mathbf{(AB)}^{-1} = \mathbf{B}^{-1}\mathbf{A}^{-1}$. You have two things to show. \item \label{ivt} Let $\mathbf{A}$ be a non-singular square matrix. Prove $(\mathbf{A}^{-1})^\prime=(\mathbf{A}^\prime)^{-1}$. \item Using Question~\ref{ivt}, prove that the if the inverse of a symmetric matrix exists, it is also symmetric. \item \label{ss} Let $\mathbf{a}$ be an $n \times 1$ matrix of real constants. How do you know $\mathbf{a}^\prime\mathbf{a}\geq 0$? \item Let $\mathbf{X}$ be an $n \times p$ matrix of constants. Recall the definition of linear independence. The columns of $\mathbf{X}$ are said to be \emph{linearly dependent} if there exists a $p \times 1$ vector $\mathbf{v} \neq \mathbf{0}$ with $\mathbf{Xv} = \mathbf{0}$. We will say that the columns of $\mathbf{X}$ are linearly \emph{independent} if $\mathbf{Xv} = \mathbf{0}$ implies $\mathbf{v} = \mathbf{0}$. \begin{enumerate} \item Show that if the columns of $\mathbf{X}$ are linearly dependent, then the columns of $\mathbf{X}^\prime\mathbf{X}$ are also linearly dependent. \item Show that if the columns of $\mathbf{X}$ are linearly dependent, then the \emph{rows} of $\mathbf{X}^\prime\mathbf{X}$ are linearly dependent. \item Show that if the columns of $\mathbf{X}$ are linearly independent, then the columns of $\mathbf{X}^\prime\mathbf{X}$ are also linearly independent. Use Problem~\ref{ss} and the definition of linear independence. % Proof: Given that if Xv=0 then v=0. Let (X'X)v=0 => v'X'Xv = v'0 = 0 % But v'X'Xv = (Xv)'(Xv) = 0, so by the preceding problem Xv=0. % Hence by def of linear independence, v=0. Done. \end{enumerate} \item Let $\mathbf{A}$ be a square matrix. Show that if the columns of $\mathbf{A}$ are linearly dependent, $\mathbf{A}^{-1}$ cannot exist. Hint: $\mathbf{v}$ cannot be both zero and not zero at the same time. \item Recall the \emph{spectral decomposition} of a square symmetric matrix (For example, a variance-covariance matrix). Any such matrix $\boldsymbol{\Sigma}$ can be written as $\boldsymbol{\Sigma} = \mathbf{P} \boldsymbol{\Lambda} \mathbf{P}^\prime$, where $\mathbf{P}$ is a matrix whose columns are the (orthonormal) eigenvectors of $\boldsymbol{\Sigma}$, $\boldsymbol{\Lambda}$ is a diagonal matrix of the corresponding (non-negative) eigenvalues, and $\mathbf{P}^\prime\mathbf{P} =~\mathbf{P}\mathbf{P}^\prime =~\mathbf{I}$. \begin{enumerate} \item Let $\boldsymbol{\Sigma}$ be a square symmetric matrix with eigenvalues that are all strictly positive. \begin{enumerate} \item What is $\boldsymbol{\Lambda}^{-1}$? \item Show $\boldsymbol{\Sigma}^{-1} = \mathbf{P} \boldsymbol{\Lambda}^{-1} \mathbf{P}^\prime$ \end{enumerate} \item Let $\boldsymbol{\Sigma}$ be a square symmetric matrix, and this time some of the eigenvalues might be zero. \begin{enumerate} \item What do you think $\boldsymbol{\Lambda}^{1/2}$ might be? \item Define $\boldsymbol{\Sigma}^{1/2}$ as $\mathbf{P} \boldsymbol{\Lambda}^{1/2} \mathbf{P}^\prime$. Show $\boldsymbol{\Sigma}^{1/2}$ is symmetric. \item Show $\boldsymbol{\Sigma}^{1/2}\boldsymbol{\Sigma}^{1/2} = \boldsymbol{\Sigma}$. \end{enumerate} \item Now return to the situation where the eigenvalues of the square symmetric matrix $\boldsymbol{\Sigma}$ are all strictly positive. Define $\boldsymbol{\Sigma}^{-1/2}$ as $\mathbf{P} \boldsymbol{\Lambda}^{-1/2} \mathbf{P}^\prime$, where the elements of the diagonal matrix $\boldsymbol{\Lambda}^{-1/2}$ are the reciprocals of the corresponding elements of $\boldsymbol{\Lambda}^{1/2}$. \begin{enumerate} \item Show that the inverse of $\boldsymbol{\Sigma}^{1/2}$ is $\boldsymbol{\Sigma}^{-1/2}$, justifying the notation. \item Show $\boldsymbol{\Sigma}^{-1/2} \boldsymbol{\Sigma}^{-1/2} = \boldsymbol{\Sigma}^{-1}$. \end{enumerate} \item The (square) matrix $\boldsymbol{\Sigma}$ is said to be \emph{positive definite} if $\mathbf{a}^\prime \boldsymbol{\Sigma} \mathbf{a} > 0$ for all vectors $\mathbf{a} \neq \mathbf{0}$. Show that the eigenvalues of a symmetric positive definite matrix are all strictly positive. Hint: the $\mathbf{a}$ you want is an eigenvector. \item Let $\boldsymbol{\Sigma}$ be a symmetric, positive definite matrix. Putting together a couple of results you have proved above, establish that $\boldsymbol{\Sigma}^{-1}$ exists. \end{enumerate} \end{enumerate} \end{document}