Squiggle logoSquiggle
Internal

Processing Confidence Intervals

This page explains what we are doing when we take a 90% confidence interval, and we get a mean and a standard deviation from it.

For normals

module Normal = {
  //...
  let from90PercentCI = (low, high) => {
    let mean = E.A.Floats.mean([low, high])
    let stdev = (high -. low) /. (2. *. 1.6448536269514722)
    #Normal({mean: mean, stdev: stdev})
  }
  //...
}

We know that for a normal with mean μ\mu and standard deviation σ\sigma,

aNormal(μ,σ)=Normal(aμ,aσ)a \cdot Normal(\mu, \sigma) = Normal(a \cdot \mu, |a| \cdot \sigma)

We can now look at the quantile of a Normal(0,1)Normal(0,1). We find that the 95% point is reached at 1.64485362695147221.6448536269514722. (source) This means that the 90% confidence interval is [1.6448536269514722,1.6448536269514722][-1.6448536269514722, 1.6448536269514722], which has a width of 21.64485362695147222 \cdot 1.6448536269514722.

So then, if we take a Normal(0,1)Normal(0,1) and we multiply it by (high.low)(2..1.6448536269514722)\frac{(high -. low)}{(2. *. 1.6448536269514722)}, it's 90% confidence interval will be multiplied by the same amount. Then we just have to shift it by the mean to get our target normal.

On this page