R version 3.5.1 (2018-07-02) -- "Feather Spray" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. [Workspace loaded from ~/.RData] > customers<-c(9,7,9,15,10,13,11,7,2,12) > mean(customers) [1] 9.5 > dpois(customers,9.5) [1] 0.130002540 0.103713937 0.130002540 0.026518985 0.123502413 0.061706224 [7] 0.106661175 0.103713937 0.003377689 0.084440097 > prod(dpois(customers,9.5)) [1] 1.117671e-12 > store<-rep(0,11) > for (i in 5:15){store[i]<-prod(dpois(customers,i))} > store [1] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 1.288171e-19 [6] 1.946467e-16 2.024171e-14 2.968503e-13 9.751743e-13 9.842355e-13 [11] 3.823484e-13 6.751927e-14 6.150112e-15 3.187742e-16 1.016353e-17 > cbind(seq(5,15),store[5:15]) [,1] [,2] [1,] 5 1.288171e-19 [2,] 6 1.946467e-16 [3,] 7 2.024171e-14 [4,] 8 2.968503e-13 [5,] 9 9.751743e-13 [6,] 10 9.842355e-13 [7,] 11 3.823484e-13 [8,] 12 6.751927e-14 [9,] 13 6.150112e-15 [10,] 14 3.187742e-16 [11,] 15 1.016353e-17 > theta<-seq(9,10, by=.10) > theta [1] 9.0 9.1 9.2 9.3 9.4 9.5 9.6 9.7 9.8 9.9 10.0 > for (i in 1:length(theta)){store[i]<-prod(dpois(customers,theta[i]))} > cbind(theta,store[1:length(theta)]) theta [1,] 9.0 9.751743e-13 [2,] 9.1 1.024900e-12 [3,] 9.2 1.064875e-12 [4,] 9.3 1.094058e-12 [5,] 9.4 1.111762e-12 [6,] 9.5 1.117671e-12 [7,] 9.6 1.111845e-12 [8,] 9.7 1.094705e-12 [9,] 9.8 1.067002e-12 [10,] 9.9 1.029762e-12 [11,] 10.0 9.842355e-13 >