Question: Problem 4. This problem is to be done in R. When computing the bootstrap, there are two extremes we talked about in class: either completely

 Problem 4. This problem is to be done in R. When

Problem 4. This problem is to be done in R. When computing the bootstrap, there are two extremes we talked about in class: either completely enumerating all of the possible cases (which is compu- tationally infeasible most of the time), or drawing of a few samples at random with possibility of repetition. In between these is an algorithm known as the Balanced Bootstrap. The algorithm goes as follows: Generate a list of B repetitions of each of the observations in our original data set, 11, that is, 11,...,21 (B times), 12,...,1(again, B times), and so on to In, ... ,In (B times). This is a total of nB elements. Permute this list completely at random. Take the first n elements as bootstrap replicate 1, the second n elements as bootstrap replicate 2, and so on, obtaining B bootstrap replicates. For this question, implement a function balanced.boot which takes two arguments: dat (for the inputs) and B (for the number of replicates). In this function, implement a Balanced Bootstrap estimate of the mean. Return the set of replicates. Test this function using n = 15 and n = 30 samples drawn from a standard normal (N(0,1)) and estimate the standard error in both cases. Compare these quantities to the theoretical values they are estimating. Problem 4. This problem is to be done in R. When computing the bootstrap, there are two extremes we talked about in class: either completely enumerating all of the possible cases (which is compu- tationally infeasible most of the time), or drawing of a few samples at random with possibility of repetition. In between these is an algorithm known as the Balanced Bootstrap. The algorithm goes as follows: Generate a list of B repetitions of each of the observations in our original data set, 11, that is, 11,...,21 (B times), 12,...,1(again, B times), and so on to In, ... ,In (B times). This is a total of nB elements. Permute this list completely at random. Take the first n elements as bootstrap replicate 1, the second n elements as bootstrap replicate 2, and so on, obtaining B bootstrap replicates. For this question, implement a function balanced.boot which takes two arguments: dat (for the inputs) and B (for the number of replicates). In this function, implement a Balanced Bootstrap estimate of the mean. Return the set of replicates. Test this function using n = 15 and n = 30 samples drawn from a standard normal (N(0,1)) and estimate the standard error in both cases. Compare these quantities to the theoretical values they are estimating

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!