官术网_书友最值得收藏!

Computing confidence intervals for means

Consider the following scenarioyou 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:

  1. Let's first import NumPy, and then define our dataset in an array, as follows:
  1. 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.

  1. We're going to import the _tconfint_generic() function from statsmodels. The following code block contains the statement to import the function:
I don't believe that this function is stable, which means that this code could change in the future.
  1. 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.

主站蜘蛛池模板: 庆云县| 九龙坡区| 昌都县| 克东县| 城口县| 铜川市| 左贡县| 江北区| 遂宁市| 双柏县| 离岛区| 达尔| 达孜县| 慈利县| 湖北省| 呼和浩特市| 中西区| 万年县| 福州市| 柞水县| 岳阳市| 泽州县| 伽师县| 布拖县| 岳西县| 凤山市| 永靖县| 乌兰浩特市| 庆元县| 穆棱市| 旬阳县| 遂昌县| 安龙县| 涟水县| 平凉市| 全南县| 皋兰县| 潞城市| 西平县| 灵寿县| 平和县|