From 08908f9da56268747822f13122a0a61dbd0ae515 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Thu, 2 Nov 2023 21:49:35 +0000 Subject: [PATCH] add more digits to 90% normal constant --- examples/15_plotting-scratchpad/.Rhistory | 7 +++++++ squiggle.c | 1 + 2 files changed, 8 insertions(+) create mode 100644 examples/15_plotting-scratchpad/.Rhistory diff --git a/examples/15_plotting-scratchpad/.Rhistory b/examples/15_plotting-scratchpad/.Rhistory new file mode 100644 index 0000000..4a7f34c --- /dev/null +++ b/examples/15_plotting-scratchpad/.Rhistory @@ -0,0 +1,7 @@ +library(ggplot2) +data <- read.csv("samples.txt", header = FALSE) +data <- as.data.frame(data) +ggplot(data = data, aes(x = V1)) + +geom_bar() +ggplot(data = data, aes(x = V1)) + +geom_freqpoly() diff --git a/squiggle.c b/squiggle.c index 6222d95..fe80ca9 100644 --- a/squiggle.c +++ b/squiggle.c @@ -85,6 +85,7 @@ inline double sample_normal_from_90_confidence_interval(double low, double high, // 1. We know that the 90% confidence interval of the unit normal is // [-1.6448536269514722, 1.6448536269514722] // see e.g.: https://stackoverflow.com/questions/20626994/how-to-calculate-the-inverse-of-the-normal-cumulative-distribution-function-in-p + // or https://www.wolframalpha.com/input?i=N%5BInverseCDF%28normal%280%2C1%29%2C+0.05%29%2C%7B%E2%88%9E%2C100%7D%5D // 2. So if we take a unit normal and multiply it by // L / 1.6448536269514722, its new 90% confidence interval will be // [-L, L], i.e., length 2 * L