Question: please show all steps with codes ! every information is included ! im really stuck on problem two for 2a tat 115.Isit.ucsb.edu/user/howardliu/rstudio/files/fall20/homeworks/homework1/homework1.pdf # YOUR CODE
please show all steps with codes ! every information is included ! im really stuck on problem two for 2a

tat 115.Isit.ucsb.edu/user/howardliu/rstudio/files/fall20/homeworks/homework1/homework1.pdf # YOUR CODE HERE Question 2 For the previous problem, when computing the rate of dark usage, we were implicitly assuming each chapter had the same length. Remember that for Y, ~ Poisson(A), E[Yi] - A for each chapter, that is, the average number of occurrences of dark is the same in each chapter. Obviously this isn't a great assumption, since the lengths of the chapters vary; longer chapters should be more likely to have more occurrences of the word. We can augment the model by considering properties of the Poisson distribution. The Poisson is often used to express the probability of a given number of events occurring for a fixed "exposure' , As a useful example of the role of the exposure term, when counting then number of events that happen in a set length of time, we to need to account for the total time that we are observing events. For this text example, the exposure is not time, but rather corresponds to the total length of the chapter. We will again let (y1, ..., yn) represent counts of the word dark. In addition, we now count the total number of words in each each chapter (V1, ..., Un) and use this as our exposure. Let Y; denote the random variable for the counts of the word dark in a chapter with ; words. Let's assume that the quantities Y1, ..Y,, are independent and identically distributed (IID) according to a Poisson distribution with unknown parameter 1000 p(Yi = yi | vi, 1000) = Poisson(y. | ) . 1000 for 2 = 1, ..., n. In the code below, chapter_lengths is a vector storing the length of each chapter in words. chapter_lengths %% group_by (chapter) >%% summarize (chapter_length = sum (n) ) > ungroup % % select (chapter_length) %%>%% unlist %% %% as . numeric 2a. What is the interpretation of the quantity 1000 in this model? What is the interpretation of A in this model? State the units for these quantities in both of your answers. Activat Type your answer here, replacing this text. Go to Set 2b. R D acer
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
