Open In App

Introduction to Bootstrap plot

Before getting into Bootstrap plot, let us first understand what Bootstrapping (or Bootstrap sampling) is all about. 

Bootstrap Sampling: It is a method in which we take a sample data repeatedly with replacement from a data set to estimate a population parameter. It is used to determine various parameters of a population. 



A bootstrap plot is a graphical representation of the distribution of a statistic calculated from a sample of data. It is often used to visualize the variability and uncertainty of a statistic, such as the mean or standard deviation, by showing the distribution of the statistic over many bootstrapped samples of the data.

In a bootstrap plot, the x-axis represents the values of the statistic and the y-axis represents the frequency of those values. A line is plotted for each bootstrapped sample, with the height of the line indicating the frequency of the statistic’s value in that sample. The distribution of the lines represents the distribution of the statistic over the bootstrapped samples.



The bootstrap plot is a powerful tool for understanding the uncertainty in a statistic, especially when the underlying distribution of the data is unknown or complex. It can also be used to generate confidence intervals for a statistic and to compare the distributions of different statistics.

It is important to note that Bootstrap is a resampling technique which is used to estimate the uncertainty of a statistic from a sample, without making any assumptions about the underlying distribution of the data. It can be used to estimate standard errors, confidence intervals, and to perform hypothesis tests.

Bootstrap plot: It is a graphical method used to measure the uncertainty of any desired statistical characteristic of a population. It is an alternative to the confidence interval. (also a mathematical method used for calculation of a statistic). 

Structure

Need for a Bootstrap plot:

Commonly, we can calculate the uncertainty of a statistic of a population mathematically, using confidence intervals. However, in many cases, the uncertainty formula that is derived is mathematically intractable. In such cases, we use the Bootstrap plot. 

Suppose, we have 5000 people in a park, and we need to find the average weight of the whole population. It is not feasible to measure the weight of each individual and then take an average of that. This is where bootstrap sampling comes into the picture. 

What we do is, we take groups of 5 people randomly from the population and find its mean. We do the same process say 8-10 times. This way, we get a good estimate of the average weight of the population more efficiently. 

Intuition:

Let us consider an example and understanding how the Bootstrap plot makes it easier to obtain critical information from a large population. Say we have a sample data of 3000 randomly generated uniform numbers. We take out a sub-sample of 30 numbers and find its mean. We do this again for another random sub-sample and so on.  

We plot a bootstrap plot of the above-acquired information and just by looking at it, we can easily give a good estimate about the mean of all the 3000 numbers. There is various other useful information one can get out of a bootstrap plot such as:

Implementation: 




import pandas as pd
import numpy as np
 
s = pd.Series(np.random.uniform(size=500))
pd.plotting.bootstrap_plot(s)

 
 

Output

 

 

Limitation

 

  1. The bootstrap plot gives an estimation of the required information from the population, not the exact values.
  2. It is highly dependent on the dataset given. It fails to give good results when a lot of subsets have repeated samples.
  3. The bootstrap plot becomes ineffective when we are obtaining information that is highly dependent on the tail values. [As shown in Fig 1]

Advantages of bootstrap:

Disadvantages of bootstrap:

Article Tags :