#LyX 2.0 created this file. For more info see http://www.lyx.org/ \lyxformat 413 \begin_document \begin_header \textclass sweavel-beamer \begin_preamble \usepackage{dcolumn} \usepackage{booktabs} % use 'handout' to produce handouts %\documentclass[handout]{beamer} \usepackage{wasysym} \usepackage{pgfpages} \newcommand{\vn}[1]{\mbox{{\it #1}}}\newcommand{\vb}{\vspace{\baselineskip}}\newcommand{\vh}{\vspace{.5\baselineskip}}\newcommand{\vf}{\vspace{\fill}}\newcommand{\splus}{\textsf{S-PLUS}}\newcommand{\R}{\textsf{R}} \usepackage{graphicx} \usepackage{listings} \lstset{tabsize=2, breaklines=true,style=Rstyle} \usetheme{Antibes} % or ... %\setbeamercovered{transparent} % or whatever (possibly just delete it) %\mode %{ % \usetheme{KU} % \usecolortheme{dolphin} %dark blues %} % In document Latex options: \fvset{listparameters={\setlength{\topsep}{0em}}} \def\Sweavesize{\scriptsize} \def\Rcolor{\color{black}} \def\Rbackground{\color[gray]{0.95}} \newcommand\makebeamertitle{\frame{\maketitle}}% \setbeamertemplate{frametitle continuation}[from second] \renewcommand\insertcontinuationtext{...} %\usepackage{handoutWithNotes} %\pgfpagesuselayout{3 on 1 with notes}[letterpaper, border shrink=5mm] \expandafter\def\expandafter\insertshorttitle\expandafter{% \insertshorttitle\hfill\insertframenumber\,/\,\inserttotalframenumber} \end_preamble \use_default_options false \master DistributionReview-1-lecture.lyx \begin_modules sweave \end_modules \maintain_unincluded_children false \language english \language_package default \inputencoding auto \fontencoding global \font_roman lmodern \font_sans lmss \font_typewriter lmtt \font_default_family default \use_non_tex_fonts false \font_sc false \font_osf false \font_sf_scale 100 \font_tt_scale 100 \graphics default \default_output_format default \output_sync 0 \bibtex_command default \index_command default \paperfontsize 10 \spacing single \use_hyperref false \papersize default \use_geometry true \use_amsmath 1 \use_esint 1 \use_mhchem 1 \use_mathdots 1 \cite_engine basic \use_bibtopic false \use_indices false \paperorientation portrait \suppress_date false \use_refstyle 0 \branch R \selected 1 \filename_suffix 0 \color #faf0e6 \end_branch \branch notrun \selected 1 \filename_suffix 0 \color #faf0e6 \end_branch \index Index \shortcut idx \color #008000 \end_index \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \paragraph_indentation default \quotes_language english \papercolumns 1 \papersides 1 \paperpagestyle default \tracking_changes false \output_changes false \html_math_output 0 \html_css_as_file 0 \html_be_strict false \end_header \begin_body \begin_layout Standard \begin_inset Branch R status open \begin_layout Standard \begin_inset ERT status open \begin_layout Plain Layout <>= \end_layout \begin_layout Plain Layout dir.create("plots2", showWarnings=F) \end_layout \begin_layout Plain Layout @ \end_layout \end_inset \end_layout \begin_layout Standard \begin_inset ERT status open \begin_layout Plain Layout % In document Latex options: \end_layout \begin_layout Plain Layout \backslash fvset{listparameters={ \backslash setlength{ \backslash topsep}{0em}}} \end_layout \begin_layout Plain Layout \backslash SweaveOpts{prefix.string=plots2/t,split=T,ae=F,height=4,width=6} \end_layout \begin_layout Plain Layout \backslash def \backslash Sweavesize{ \backslash normalsize} \end_layout \begin_layout Plain Layout \backslash def \backslash Rcolor{ \backslash color{black}} \end_layout \begin_layout Plain Layout \backslash def \backslash Rbackground{ \backslash color[gray]{0.85}} \end_layout \end_inset \end_layout \begin_layout Standard \begin_inset ERT status open \begin_layout Plain Layout <>= \end_layout \begin_layout Plain Layout options(width=100, prompt=" ", continue=" ") \end_layout \begin_layout Plain Layout options(useFancyQuotes = FALSE) \end_layout \begin_layout Plain Layout set.seed(12345) \end_layout \begin_layout Plain Layout op <- par() \end_layout \begin_layout Plain Layout pjmar <- c(5.1, 5.1, 1.5, 2.1) \end_layout \begin_layout Plain Layout #pjmar <- par("mar") \end_layout \begin_layout Plain Layout options(SweaveHooks=list(fig=function() par(mar=pjmar, ps=12))) \end_layout \begin_layout Plain Layout pdf.options(onefile=F,family="Times",pointsize=12) \end_layout \begin_layout Plain Layout @ \end_layout \end_inset \end_layout \end_inset \end_layout \begin_layout Section Practice Problems \end_layout \begin_layout Standard \begin_inset ERT status open \begin_layout Plain Layout \backslash small \end_layout \end_inset \end_layout \begin_layout Standard \begin_inset ERT status open \begin_layout Plain Layout \backslash begin{frame}[containsverbatim,allowframebreaks] \end_layout \begin_layout Plain Layout \backslash frametitle{Problems} \end_layout \end_inset \end_layout \begin_layout Enumerate The expected value of the height of a black bear is 5 feet. The expected value of the width of a black bear is 6 feet. You collected lots of data on the height and widths of bears during a long, boring field study. You are excited to know if the bears you study are like other bears that people have already studied. Before leaving the camp, you sent the data home to your assistant. Your research assistant mistakenly added the two columns of number together. You are in the \begin_inset Quotes eld \end_inset publish or perish \begin_inset Quotes erd \end_inset world, and you have to make something out of that data. Your numbers are the sum of height and width, you decide to call your new random variable the \begin_inset Quotes eld \end_inset index of bear displacement (IBD). \begin_inset Quotes erd \end_inset \end_layout \begin_deeper \begin_layout Enumerate What is the expected value of the IBD, supposing your bears are like other bears people have studied before? How do you figure that out when I don't give you a column of numbers? \end_layout \begin_layout Enumerate If I gave you a column of numbers for your bears, would it help you to calculate the expected value? \end_layout \begin_layout Enumerate On a conceptual level, how would you describe the difference between the expected value of the IBD and the sample average of your accidentally-added-tog ether column of data? \end_layout \end_deeper \begin_layout Enumerate Note one can convert from Celsius to Fahrenheit with \begin_inset Formula $F=32+\frac{9}{5}C$ \end_inset \end_layout \begin_deeper \begin_layout Enumerate Your professor asks you to calculate the expected value of the temperature today. You get out some complicated probability model and work out the answer. The Expected Value of the temperature 18 Celsius. But the professor wanted the temperature in Fahrenheit, and you are too busy to go back and re-do all of the pdf calculations to get that for her. There's a shortcut to convert your result of 18C to Fahrenheit. How do you use it? \end_layout \begin_layout Enumerate This might force you to use your head. If the variance in Celsius is 4, what would be the variance of the same data presented in Fahrenheit? You have to use your head, but I'll give you a hint. The variance of a constant is always \begin_inset Formula $0$ \end_inset . So \begin_inset Formula $Var[32]=0$ \end_inset . Using that fact, I bet you can use the result stated in \begin_inset CommandInset ref LatexCommand ref reference "eq:VarWght" \end_inset . \end_layout \end_deeper \begin_layout Enumerate I collected 1300 observations from a random process. I'm not sure which distribution was used, I forgot to write it down. But my teacher told me that E[x]=3 and Var[x]=10. The teacher told me to calculate the sample average and find out how certain she should be about that estimate. She said calculate Variance of the average. But I can't understand how to calculate the variance when I don't know to calculate \begin_inset Formula $Var[\bar{x}]$ \end_inset . So I am completely stumped. Can you help? \end_layout \begin_layout Enumerate The sum of squared observations from a Normal distribution takes on the form of a Chi-Square distribution. Lets use R to check that out. Here's some code that use R to create 100 normal observations, and then squares them, and then calculates the cumulative sum. Then it makes a plot. \end_layout \begin_deeper \begin_layout Standard \begin_inset ERT status open \begin_layout Plain Layout <>= \end_layout \begin_layout Plain Layout xseq <- 1:100 \end_layout \begin_layout Plain Layout x <- rnorm(100) \end_layout \begin_layout Plain Layout xsquare <- x*x \end_layout \begin_layout Plain Layout chivalues <- cumsum(xsquare) \end_layout \begin_layout Plain Layout plot(xseq, chivalues, type="l") \end_layout \begin_layout Plain Layout @ \end_layout \end_inset \end_layout \begin_layout Standard \begin_inset ERT status open \begin_layout Plain Layout \backslash input{plots2/t-problem2} \end_layout \begin_layout Plain Layout \backslash includegraphics[width=7cm]{plots2/t-problem2} \end_layout \end_inset \end_layout \begin_layout Enumerate Think for a while about what that plotted line means. Then write a paragraph. \end_layout \begin_layout Enumerate Run that program over 10 or 20 times, compare the plots you get. What do the differences among them signify? \end_layout \end_deeper \begin_layout Enumerate Lets beat up a Gamma variable for a while. Suppose I give you a Gamma distributed variable with shape = \begin_inset Formula $\alpha$ \end_inset and scale = \begin_inset Formula $\beta$ \end_inset . \end_layout \begin_deeper \begin_layout Enumerate What is the Expected Value and the Variance? \end_layout \begin_layout Enumerate If \begin_inset Formula $\alpha$ \end_inset is replaced by a new shape parameter \begin_inset Formula $2/\beta$ \end_inset , calculate \begin_inset Formula $E$ \end_inset and \begin_inset Formula $Var$ \end_inset \end_layout \begin_layout Enumerate Use R to sketch the pdf of Gamma(x; shape=2, scale=3) \end_layout \begin_layout Enumerate Use R to tell me the probability density of a particular value of x, say 0.5. \end_layout \begin_layout Enumerate Use R to tell me the chance of observing a value between 0.5 and 1.4 \end_layout \end_deeper \begin_layout Standard \begin_inset ERT status open \begin_layout Plain Layout \backslash end{frame} \end_layout \end_inset \end_layout \begin_layout EndFrame \end_layout \end_body \end_document