I am reviewing the CS1 PBOR exercise. the gibberish � marks are unacceptable. you should do better, you would rather give us the results in pdf or word format and not the text format which corrupts the special characters It is frustrating. see below #Exercise 5.01 #------------------------------------------------------------- #(i) Empirical unconditional distribution #Calculation of theoretical mean and variance #E[X] = E[E(X|P)] = E[nP] = nE[P] = 12*0.4 = 4.8 #var[X] = E[var(X|P)] +var[E(X|P)] = E[nP(1-P)] + var[nP] # = n(E[P]-E[P�])+ n�var(P) = n(E[P]-(var[P]+E�[P]))+ n�var(P) # = 12(0.4 - (0.04+0.4�)) + 12�*0.04 # = 8.16 #---------------------------------------
They're given in "text format" as they are .R files which can be run in R, rather than PDFs or word documents which can't. Whilst they're fine in my R file, it appears that the new system we are using to host the PBOR has corrupted them. I've changed the file and will have it uploaded to the PBOR. I'd attach here but the discussion forum software doesn't allow .R uploads. If you are aware of plugins that allow .R files to work smoothly with discussion forums and website hosting then I'd be grateful if you could let us know.
Thanks a tone Lee. The var[p] i assume i approximated to 2 decimal places, 0.04 , i suppose you used beta distribution for Var, , closer answer for var p=0.038.
Are you referring to the theoretical distribution of the prior p~beta(2,3)? In which case the mean is 2/(2+3) = 0.4 and the variance is exactly (2*3)/(2+3)^2(2+3+1) = 0.04.