Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile-time precision set, Pi->PI, inverse-var weighed average & reducer #20

Merged
merged 14 commits into from
Oct 15, 2024
Merged

Conversation

c-blake
Copy link
Contributor

@c-blake c-blake commented Oct 14, 2024

This PR does 3 things:

  • Allow compile-time setting of printing precision (number of places for
    the error; cligen/strUt.fmtUncertain rounds value to same decimal).

  • Pi -> PI because that is how std/math.nim spells it. This lets
    users do nim c --hint:Name:on --styleCheck=error --styleCheck=usages.

  • Add inverse-var weighted averaging operator & varargs/openArray reducer
    with a URI justifying the weights.

c-blake and others added 13 commits August 4, 2023 18:50
principled control of precision.

While maybe obvious, the "principle" here is just that uncertainties
themselves have very limited credible precision.  This is especially
salient when considering values derived from propagated uncertainty,
such as "sigma distances" where said sigma parameter is taken to roughly
correspond to unit Gaussian/Normal probability scales.  That's just a
fairly rough correspondence, often papered over with both generous and
heuristic bounds like "5 sigma" to decide if results are to be believed.
`-d:nimFatOldSystem` non-duplicative).
the error; `cligen/strUt.fmtUncertain` rounds value to same decimal).
810bdfb changed the default here from
2 to 3, but some users might even want 1.
users do `nim c --hint:Name:on --styleCheck=error --styleCheck=usages`.
@@ -90,7 +90,7 @@ logic to types other than =float=!
Feel free to perform error propagation on =unchained= types for
example:
#+begin_src nim
import unchained, meausuremancer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of those funny typos a QWERTY user is going to wonder how I managed it. 🤣

Comment on lines 608 to 609
## Average however many uncertain values in `x` into one overall estimate.
## `x` can also be any `openArray[Measurement[F]]`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we said in private discussion, maybe add another sentence that this computes a weighted mean.

@Vindaar
Copy link
Member

Vindaar commented Oct 15, 2024

Thanks a lot!

@Vindaar Vindaar merged commit 1569ee2 into SciNim:master Oct 15, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants