Assignment 7 Issues

Assignment 7 Issues

by Yu Chen Zhou -
Number of replies: 9

Hello!

       I did some parts of assignment 7. When I try to get bca confidence interval, the program returns error saying that  

Error in bca.ci(boot.out, conf, index[1L], L = L, t = t.o, t0 = t0.o,  : 

  estimated adjustment 'w' is infinite


or it shows the error

Error in bca.ci(boot.out, conf, index[1L], L = L, t = t.o, t0 = t0.o,  : 

  estimated adjustment 'a' is NA


I used nonparametric bootstrapping, 1000 times, on 5000 maximum angular differences. I searched online about the error message. People said that bootstrapping replication is not large enough. That's why the error appears. I am not sure that's the case. What are some possible causes about this error?


Thank you!

In reply to Yu Chen Zhou

Re: Assignment 7 Issues

by Erik Spence -
How did you try to determine the BCa interval?
In reply to Erik Spence

Re: Assignment 7 Issues

by Yu Chen Zhou -
I used boot.ci
ciresult <- boot.ci(bootresult, conf=0.95)
and then i get ciresult$bca
This will gives a vector that contains the lower bound and upper bound at index 4 and 5 accordingly.
I am not sure is that the way we should do it.
In reply to Yu Chen Zhou

Re: Assignment 7 Issues

by Erik Spence -
That's how I did it. Something must be wrong earlier in the chain.
In reply to Erik Spence

Re: Assignment 7 Issues

by Alvin Han -
According to several sources on the internet (herehere, and here), as long as the number of bootstraps exceeds the size of the original data, we can calculate the BCa intervals. However, in the assignment, we are instructed to only run 1000 bootstraps on our samples of size 5000. Consequently, boot.ci appears to break! I get the same errors as indicated by Yu Chen, and others online when we try to run less than our sample size's worth of bootstraps. 

Any guidance would be appreciated! 
In reply to Alvin Han

Re: Assignment 7 Issues

by Erik Spence -
You are correct. I tested my solution code without checking the particular values of m and n. I'm changing the values to m = 1000, and n = 2000.
In reply to Erik Spence

Re: Assignment 7 Issues

by Angela Pollinzi -
Hi Erik,
I have been getting the same errors, but only when I run the command in a loop- it reaches a point at which it breaks and the boot.ci command does not work. When I run it outside of the loop, it's fine. I was wondering if I could get some guidance?
Thanks,
Angela
In reply to Angela Pollinzi

Re: Assignment 7 Issues

by Erik Spence -
The first error at the top of this thread is caused by the fact that, sometimes, there is insufficient variance in the data, and as a result the confidence interval cannot be calculated. The solution in this particular case is to increase the value of 'm', which we won't do at this point, or increase the number of bins, which I have personally increased to 51. This gets rid of the error most of the time, at least for a kmax = 15.
In reply to Erik Spence

Re: Assignment 7 Issues

by Sierra Codeluppi -
Hey Erik, So are you saying we should have a higher value of K to run the script? do we need to set this stipulation as an if statement or will the TA's only try the script with a higher k value?
In reply to Sierra Codeluppi

Re: Assignment 7 Issues

by Erik Spence -
No. Other than k>1 there are no restrictions on the value of k.