- Training Systems Using Python Statistical Modeling
- Curtis Miller
- 290字
- 2021-06-24 14:20:45
Computing confidence intervals for means
Consider the following scenario—you are employed by a company that fabricates chips and other electronic components. The company wants you to investigate the resistors that it uses in producing its components. In particular, while the resistors used by the company are labeled with a particular resistance, the company wants to ensure that the manufacturer of the resistors produces high-quality products. In particular, when they label a resistor as having 1,000 Ω, they want to know that resistors of that type do, in fact, have 1,000 Ω, on average:
- Let's first import NumPy, and then define our dataset in an array, as follows:

- We read in this dataset, and the mean resistance is displayed as follows:

Now, we want to know whether it is close to 0 or not. The following is the formula for the confidence interval:

Here, x is the sample mean, s is the sample distribution, α is one minus the confidence level, and tv,p is the pth percentile of the t-distribution with v degrees of freedom.
- We're going to import the _tconfint_generic() function from statsmodels. The following code block contains the statement to import the function:

- Our next step is to define all the parameters that we will assign to the function. We are going to assign our mean, standard deviation, degrees of freedom, the confidence limit, and the alternative, which is two-sided. This results in the following output:

You will notice that 1 is not in this confidence interval. This might lead you to suspect that the resistors that the supplier produces are not being properly manufactured.
- C語言程序設計案例教程(第2版)
- 編程卓越之道(卷3):軟件工程化
- SQL語言從入門到精通
- Java虛擬機字節碼:從入門到實戰
- Reactive Programming With Java 9
- Multithreading in C# 5.0 Cookbook
- Solutions Architect's Handbook
- C++程序設計教程(第2版)
- IoT Projects with Bluetooth Low Energy
- Java Web開發實例大全(基礎卷) (軟件工程師開發大系)
- 石墨烯改性塑料
- AI自動化測試:技術原理、平臺搭建與工程實踐
- Microsoft HoloLens By Example
- JavaScript Concurrency
- Test-Driven iOS Development with Swift