Question: Perform a double loop using the following basic structure: for ( i in 1 :length ( th ) ) { . . . for (

Perform a double loop using the following basic structure:
for (i in 1:length(th)){
...
for (j in 1:B){
...
}
...
}
(a) At the i-th iteration of the outer loop you should
define vectors th.ML=th.Bayes=0 in which to store your simulated estimates;
perform the inner loop;
store the average squared error for each vector of estimates in the i-th element of the
corresponding AVSE.-vector.
(b) At the j-th iteration of the inner loop you should
generate a simulated version of X using th[i] as the success probability;
compute each version of the two estimators based on that simulated X and store them
in the corresponding th.-vector.

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 Programming Questions!