Bootstrapped confidence intervals problems after the array?

Let's analyze this code

a=np.random.randint(0,5,(2,5))
b=np.random.randn(5)
print(a)
print(b)
means=b[a].mean(axis=0) 
print(means)
confint=np.percentile(means,[25,50]) 
print(confint)

There is a bootstrap method on statistics, this could have been done b mean statistic array of estimates, and how to get the first line of code that "2" is doing twice the best of it, it is to do 1000, well here twice a simplified, a is an array, row two lines, number of columns with the same dimensions of b. b [A] This is to take the number, taken b the number, dimensions consistent with a, axis = 1 is considered the line, axis = 0 is considered columns, Mean () with empty parameter is the whole flatted plane are considered, so means out of the plurality of on average, take quartile, median value to represent the final parameter estimates.

 

Just do not understand with confidence intervals do with it? Percentile confidence interval would correspond. My example above is 25 confidence interval? The results still feel a little strange?

 

reference

This 100 exercises with you Fun Numpy. Url: https: //www.kesci.com/home/project/59f29f67c5f3f5119527a2cc

 

Guess you like

Origin www.cnblogs.com/zwydx/p/12327402.html