Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Define th=(1:500)/50, L-length (th) and B-1000. Also define noncoverage.mle=noncoverage.bayes=0 Perform a double loop: at the i-th iteration of the outer loop define matrices mle.mat-matrix
Define th=(1:500)/50, L-length (th) and B-1000. Also define noncoverage.mle=noncoverage.bayes=0 Perform a double loop: at the i-th iteration of the outer loop define matrices mle.mat-matrix (0,B, 2) and bayes.mat-matrix (0,B, 2); perform the inner loop: at the j-th iteration of the inner loop generate a pseudo-random sample x of size n-4 from an exponential distribution with rate th[i]; obtain mle-based and Bayes intervals (with C-1.5), saving them in the j-th row of mle.mat and bayes. mat respectively; save in the i-th element of noncoverage.mle the number of times the mle-based interval did not cover th[i]; similarly for the Bayes interval in bayes.mat; Convert the counts in the noncoverage vectors to proportions. Plot (as lines) these proportions against th (red for the mle-based, blue for Bayes). Add an informative heading and legend.
Step by Step Solution
★★★★★
3.36 Rating (159 Votes )
There are 3 Steps involved in it
Step: 1
Here is some code ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started