concept confidence interval in category data

This is an excerpt from Manning's book Data Science Bookcamp: Five Python Projects.
We can visualize the variability of recorded coin-flip frequencies by plotting a histogram. A histogram shows binned counts of observed numeric values. The counts can be transformed into relative likelihoods, so that the area beneath the histogram sums to 1. Effectively, the transformed histogram becomes a probability distribution. The area around the distribution’s peak represents a confidence interval. A confidence interval is the likelihood that an unknown probability falls within a certain frequency range. Generally, we prefer a confidence interval that is at 95% or higher.
Listing 4.9. Computing the confidence interval for 3 million shuffles
np.random.seed(0) frequency_array = np.array([repeat_game(10000) for _ in range(300)]) likelihoods, bin_edges, patches = plt.hist(frequency_array, bins='auto', edgecolor='black', density=True) bin_width = bin_edges[1] - bin_edges[0] start_index, end_index = compute_high_confidence_interval(likelihoods, bin_width) #1 for i in range(start_index, end_index): patches[i].set_facecolor('yellow') plt.xlabel('Binned Frequency') plt.ylabel('Relative Likelihood') plt.show()

This is an excerpt from Manning's book Think Like a Data Scientist: Tackle the data science process step-by-step.
If all you need is a point estimate, then you’re good to go. But if, as is usually the case, you want some sort of guarantee that the value is approximately what you think it is, then you’ll need either a probability distribution or a standard error. A standard error for a parameter estimate is the frequentist equivalent of a standard deviation (square root of variance) of a probability distribution. In short, you can be 95% confident that a parameter is within two standard errors of its point estimate or 99.7% confident that it’s within three standard errors. These are confidence intervals, and if the standard error is relatively small, then the confidence intervals will be narrow, and you can be reasonably (whichever percentage you choose) sure that the true value falls within the interval.
The Bayesian equivalents of standard error and confidence intervals are variance and credible intervals, respectively. They work almost exactly the same but, as usual, differ on philosophical grounds. Given that a Bayesian parameter estimate is a probability distribution, you can naturally extract the variance and create credible intervals such that for a normal distribution, the probability is 95% that the true value is within two standard deviations of the mean, and 99.7% that it’s within three standard deviations.