Unformatted text preview:

Name: -------------------------------------------Bayesian Statistics, 22S:138Final exam, 20101. Near Kiama, Australia, there is a hole in the cliffs through wh ich ocean water eruptsspectacularly with the rise and fall of waves. Jim Irish, Faculty of Engineering, Univer-sity of Technology, Sydney, collected data on the waiting times (in seconds) betweenconsecutive eruptions occurring on July 12, 1998.The exponential distribution is often used to model waiting times between events. Weplan to use Irish’s data to estimate the exponential rate parameter λ in the populationof all possible waiting times between eruptions. However, we are not sure whether theexponential distribution is a good fit for this population of waiting times.As shown in your table of distributions, the variance of an exponential random vari-able is the squ are of the mean. Therefore, f or an exponential random variable, thepopulation coefficient of variation, defined as the 100 times the population standarddeviation divided by the population mean, is 100.CV = 100 ×σµFor sample data drawn f rom an exponential distribution, we would expect the sampleCV to b e close to 100. In the Kiama eruption data,100 ×s¯x= 100 ×33.7505139.82812= 84.7Refer to the attached OpenBUGS code and output to answer the following questions.Note that the linecvreal <- 100 * sd(times[1:N]) / mean(times[1:N])calculates the sample CV from the observed data.(a) Is the model given in the OpenBUGS code hierarchical? (yes / no) Briefly justifyyour answer(b) The pred[i]’s from each iteration are (circle one):i. nuisance parametersii. missing valuesiii. replicate datasetsiv. totally unnecessary for this analysisv. none of the above1(c) What does the following line of code do?cvpred <- 100 * sd(pred[1:N]) / mean(pred[1:N])(d) The trace plot of check (projected in color on the screen) looks wierd. Brieflyexplain why it would look like that.(e) What is the posterior predictive p-value? (numeric answer)(f) Based on these results, what would be an appropriate next step in the Bayesiananalysis (circle one):i. Consider the analysis as presented to be adequate and report the inferenceon λ.ii. Run more iterations of OpenBUGS for the exponential model because th esampler doesn’t s eem to have converged.iii. Try a more flexible model for these data instead of the exponential.iv. None of the above.(g) Briefly justify your answer to the previous question.(h) Below is a list of distributions that we have studied. After each one, write ”Yes”if it might be appropriate for waitin g time data, and ”No” if it clearly would not.Justify each answer in a few words.i. betaii. binomialiii. gammaiv. poisson2(i) If we used the Devian ce Information Criterion to compare the exponential modelto some other model, what value would you expect for pD in the exponentialmod el? Give a numeric answer and briefly justify it.(j) Circle all of the true statements in the following list:i. The Gelman Rubin diagnostic plot for lambda show s failure to convergebecause not all of the lines are on top of each other.ii. The numbers in the “MC error” column in WinBUGS/OpenBUGS outputhelp us determine whether we have run enough MCMC sampler iterations.iii. In order to use the Gelman-Rubin convergence diagnostic, one must runmore than one chain.iv. In choosing initial values for an MCMC sampler, one must not look at thecurrent dataset being analyzed.v. High autocorrelation in MCMC sampler output causes the Markov chain toconverge slowly to its stationary distribution.2. The breast cancer example in the first chapter of the textbook includes a table withthe following information:Prior Likelihood Prior × PosteriorModelProbabilities for M+ Likelihood ProbabilitiesH0: No breast cancer .9955 .0274 .0273 .893Ha: Breast cancer .0045 .724 .0033 .107.0306 1Recall that M + represented the woman having a positive mammogram. For the nexttwo questions, write the required calculation in sy mbolic form using symbols such asP r(H0) and P r(H0|y). Then do the calculation to get a numeric answer.(a) Using the data in this table, calculate the posterior odds in favor of the womanhaving breast cancer.(b) Using the data in this table, calculate the Bayes factor in favor of the womanhaving breast cancer.(c) Explain briefly what your result in the previous problem means regarding thewoman and breast cancer.33. Is the gamma family the conjugate prior for the exponential likelihood?(a) Find the mathematical form of th e posterior density p(λ|y) for a Gamma(α, β)prior and an exponential likelihood with parameter λ. Show your work. Useyour result to state whether the gamma family is the conjugate prior for theexponential likelihood.(b) What is the posterior distribution of λ in problem 1 if th e sum of the 64 waitingtimes in the sample data is 2549? If possible, identify it as a standard density.4model{cvreal <- sd(times[1:N]) / mean(times[1:N])for( i in 1:N) {times[i] ~ dexp( lambda )pred[i] ~ dexp( lambda )}cvpred <- sd(pred[1:N]) / mean(pred[1:N])check <- step( cvreal - cvpred )dmean <- 1 / lambdalambda ~ dgamma( 1, 60 )}# datalist( times = c(83, 51, 87, 60, 28, 95, 8, 27, 15, 10, 18, 16, 29, 54, 91,8, 17, 55, 10, 35, 47, 77, 36, 17, 21, 36, 18, 40, 10, 7, 34,27, 28, 56, 8, 25, 68, 146, 89, 18, 73, 69, 9, 37, 10, 82, 29,8, 60, 61, 61, 18, 169, 25, 8, 26, 11, 83, 11, 42, 17, 14, 9,12), N = 64)# initslist(lambda = .01)list(lambda = .1)list( lambda = 1)Statisticsmean sd MC_error val2.5pc median val97.5pc start samplecheck 0.1036 0.3047 0.005567 0.0 0.0 1.0 1001 3003cvpred 98.37 11.64 0.2346 78.2 97.28 123.6 1001 3003lambda 0.02489 0.003085 6.397E-5 0.0195 0.0248 0.03151 1001


View Full Document

UI STAT 4520 - Bayesian Statistics

Documents in this Course
Load more
Download Bayesian Statistics
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Bayesian Statistics and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Bayesian Statistics 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?