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

[REVIEW]: Sigma: Uncertainty Propagation for C++ #7404

Open
editorialbot opened this issue Oct 24, 2024 · 8 comments
Open

[REVIEW]: Sigma: Uncertainty Propagation for C++ #7404

editorialbot opened this issue Oct 24, 2024 · 8 comments
Assignees
Labels
C++ CMake review TeX Track: 5 (DSAIS) Data Science, Artificial Intelligence, and Machine Learning

Comments

@editorialbot
Copy link
Collaborator

editorialbot commented Oct 24, 2024

Submitting author: @jwaldrop107 (Jonathan Waldrop)
Repository: https://github.com/QCUncertainty/sigma
Branch with paper.md (empty if default branch): joss_paper
Version: v0.1
Editor: @vissarion
Reviewers: @baxmittens, @YehorYudinIPP
Archive: Pending

Status

status

Status badge code:

HTML: <a href="https://joss.theoj.org/papers/46af69c48a681200c40fb5a9cebc6168"><img src="https://joss.theoj.org/papers/46af69c48a681200c40fb5a9cebc6168/status.svg"></a>
Markdown: [![status](https://joss.theoj.org/papers/46af69c48a681200c40fb5a9cebc6168/status.svg)](https://joss.theoj.org/papers/46af69c48a681200c40fb5a9cebc6168)

Reviewers and authors:

Please avoid lengthy details of difficulties in the review thread. Instead, please create a new issue in the target repository and link to those issues (especially acceptance-blockers) by leaving comments in the review thread below. (For completists: if the target issue tracker is also on GitHub, linking the review thread in the issue or vice versa will create corresponding breadcrumb trails in the link target.)

Reviewer instructions & questions

@baxmittens & @YehorYudinIPP, your review will be checklist based. Each of you will have a separate checklist that you should update when carrying out your review.
First of all you need to run this command in a separate comment to create the checklist:

@editorialbot generate my checklist

The reviewer guidelines are available here: https://joss.readthedocs.io/en/latest/reviewer_guidelines.html. Any questions/concerns please let @vissarion know.

Please start on your review when you are able, and be sure to complete your review in the next six weeks, at the very latest

Checklists

📝 Checklist for @YehorYudinIPP

@editorialbot
Copy link
Collaborator Author

Hello humans, I'm @editorialbot, a robot that can help you with some common editorial tasks.

For a list of things I can do to help you, just type:

@editorialbot commands

For example, to regenerate the paper pdf after making changes in the paper's md or bib files, type:

@editorialbot generate pdf

@editorialbot
Copy link
Collaborator Author

Software report:

github.com/AlDanial/cloc v 1.90  T=0.02 s (2367.9 files/s, 179335.5 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
C++                             17            133             10           1041
C/C++ Header                    14            161            891            432
Markdown                         4             53              0            418
YAML                             3              7             17            187
CMake                            8             36             29            170
TeX                              1              4              0             46
HTML                             1              3             19             45
CSS                              1              1              2              6
-------------------------------------------------------------------------------
SUM:                            49            398            968           2345
-------------------------------------------------------------------------------

Commit count by author:

    86	Jonathan M. Waldrop
     1	Ryan Richard

@editorialbot
Copy link
Collaborator Author

Reference check summary (note 'MISSING' DOIs are suggestions that need verification):

✅ OK DOIs

- 10.1063/5.0196384 is OK

🟡 SKIP DOIs

- No DOI given, and none found for title: Uncertainty propagation with functionally correlat...
- No DOI given, and none found for title: Uncertainties: a Python package for calculations w...
- No DOI given, and none found for title: CMake
- No DOI given, and none found for title: Eigen

❌ MISSING DOIs

- None

❌ INVALID DOIs

- None

@editorialbot
Copy link
Collaborator Author

Paper file info:

📄 Wordcount for paper.md is 1064

✅ The paper includes a Statement of need section

@editorialbot
Copy link
Collaborator Author

License info:

✅ License found: Apache License 2.0 (Valid open source OSI approved license)

@editorialbot
Copy link
Collaborator Author

👉📄 Download article proof 📄 View article proof on GitHub 📄 👈

@YehorYudinIPP
Copy link

YehorYudinIPP commented Oct 24, 2024

Review checklist for @YehorYudinIPP

Conflict of interest

  • I confirm that I have read the JOSS conflict of interest (COI) policy and that: I have no COIs with reviewing this work or that any perceived COIs have been waived by JOSS for the purpose of this review.

Code of Conduct

General checks

  • Repository: Is the source code for this software available at the https://github.com/QCUncertainty/sigma?
  • License: Does the repository contain a plain-text LICENSE or COPYING file with the contents of an OSI approved software license?
  • Contribution and authorship: Has the submitting author (@jwaldrop107) made major contributions to the software? Does the full list of paper authors seem appropriate and complete?
  • Substantial scholarly effort: Does this submission meet the scope eligibility described in the JOSS guidelines
  • Data sharing: If the paper contains original data, data are accessible to the reviewers. If the paper contains no original data, please check this item.
  • Reproducibility: If the paper contains original results, results are entirely reproducible by reviewers. If the paper contains no original results, please check this item.
  • Human and animal research: If the paper contains original data research on humans subjects or animals, does it comply with JOSS's human participants research policy and/or animal research policy? If the paper contains no such data, please check this item.

Functionality

  • Installation: Does installation proceed as outlined in the documentation?
  • Functionality: Have the functional claims of the software been confirmed?
  • Performance: If there are any performance claims of the software, have they been confirmed? (If there are no claims, please check off this item.)

Documentation

  • A statement of need: Do the authors clearly state what problems the software is designed to solve and who the target audience is?
  • Installation instructions: Is there a clearly-stated list of dependencies? Ideally these should be handled with an automated package management solution.
  • Example usage: Do the authors include examples of how to use the software (ideally to solve real-world analysis problems).
  • Functionality documentation: Is the core functionality of the software documented to a satisfactory level (e.g., API method documentation)?
  • Automated tests: Are there automated tests or manual steps described so that the functionality of the software can be verified?
  • Community guidelines: Are there clear guidelines for third parties wishing to 1. Contribute to the software 2. Report issues or problems with the software 3. Seek support

Software paper

  • Summary: Has a clear description of the high-level functionality and purpose of the software for a diverse, non-specialist audience been provided?
  • A statement of need: Does the paper have a section titled 'Statement of need' that clearly states what problems the software is designed to solve, who the target audience is, and its relation to other work?
  • State of the field: Do the authors describe how this software compares to other commonly-used packages?
  • Quality of writing: Is the paper well written (i.e., it does not require editing for structure, language, or writing quality)?
  • References: Is the list of references complete, and is everything cited appropriately that should be cited (e.g., papers, datasets, software)? Do references in the text use the proper citation syntax?

@baxmittens
Copy link

baxmittens commented Oct 24, 2024

Hi all,

Nice paper and software project. Congratulations!
I wanted to look into this topic for a long time. I will therefore gladly take this opportunity.

I read the paper and one particular thing that caught my attention was

"""
These element are defined as 𝑎𝑖 = ̄𝑎𝑖 ± 𝜎_𝑎𝑖 ,
where ̄𝑎𝑖 is the mean value of the variable and 𝜎_𝑎𝑖 is its standard deviation.
"""

I think the standard deviation is the square root of the variance of a random variable which is equipped with - or linked to - a probability distribution. Therefore I think 𝜎_𝑎𝑖 should rather be called 'uncertainty', since it does not own a probability measure. Surely, you can say something like '𝜎_𝑎𝑖 is called the uncertainty and is assumed to represent an error measure closely related to the standard deviation of a random variable' (or something like that). I think in one of your sources https://arxiv.org/abs/1610.08716 this is also more carefully phrased.

Next thing would be

"""
The uncertainty of 𝐹 (𝐴) can be determined as
𝜎_𝐹 ≈ ...
"""

I think this should also rather be described as the linear uncertainty (or something alike) since in general the pdf of F(A(ω)) will be skewed, and, in that case, the standard deviation doesn't represent too much of the uncertainty of the outcome (see the example of a cantilever with uncertain tip displacement which I attache).
In general, the difference between the method at hand and 'uncertainty quantification' which involves integration over a probability space should be briefly pointed out, I think.

Greetz Max

image
using Distributions
using ProgressMeter
import .Threads: @threads
using CairoMakie
using Measurements
using Statistics

function cantilever_displacement(E,X,Y,L,w,t)
    # see https://www.sfu.ca/~ssurjano/canti.html
    Dfact1 = 4*(L^3) / (E*w*t)
    Dfact2 = sqrt((Y/(t^2))^2 + (X/(w^2))^2)
    D = Dfact1 * Dfact2
    return D
end

N_E = Normal{Float64}(2.9e7, 1.45e6) # Young's modulus
N_X = Normal{Float64}(500.0, 50.0)	# horizontal load
N_Y = Normal{Float64}(1000.0, 100.0) # vertical load
N_L = Normal{Float64}(100.0, 10.0) # beam length
N_w = Normal{Float64}(4.0, 0.4) # beam width
N_t = Normal{Float64}(2.0, 0.2) # beam width

M_E = measurement(2.9e7, 1.45e6) # Young's modulus
M_X = measurement(500.0, 50.0)	# horizontal load
M_Y = measurement(1000.0, 100.0) # vertical load
M_L = measurement(100.0, 10.0) # beam length
M_w = measurement(4.0, 0.4) # beam width
M_t = measurement(2.0, 0.2) # beam width

samplefunc() = [rand(N_E), rand(N_X), rand(N_Y), rand(N_L), rand(N_w), rand(N_t)]

N = 5_000_000
monte_carlo_resvec = Vector{Float64}(undef, N)

@showprogress @threads for i = 1:N
    monte_carlo_resvec[i] = cantilever_displacement(samplefunc()...)
end

sample_mean = foldl(+, monte_carlo_resvec)/N
sample_var = foldl(+, map(x->(x-sample_mean)^2, monte_carlo_resvec))/(N-1)
sample_sqrt_var = sqrt(sample_var)
quantvals = map(x->cdf(Normal{Float64}(0.0,1.0),x), -3:3)
sample_quantiles = quantile(monte_carlo_resvec, quantvals)

σ_F = cantilever_displacement(M_E,M_X,M_Y,M_L,M_w,M_t)

f = Figure(size=(600,300));
ax = Axis(f[1,1:4])
xlims!(ax, [0,20])
ylims!(ax, [0,.25])

band!(ax, [sample_quantiles[1], sample_quantiles[2]], 0, 5, color=(:red,0.1), label="99.7% quantile")
band!(ax, [sample_quantiles[end-1], sample_quantiles[end]], 0, 5, color=(:red,0.1))
band!(ax, [sample_quantiles[2], sample_quantiles[3]], 0, 5, color=(:yellow,0.2), label="95.4% quantile")
band!(ax, [sample_quantiles[end-2], sample_quantiles[end-1]], 0, 5, color=(:yellow,0.2))
band!(ax, [sample_quantiles[3], sample_quantiles[5]], 0, 5, color=(:green,0.2), label="68.2% quantile")
hist!(ax, monte_carlo_resvec, normalization = :pdf, bins = 500, color=(:red, 0.45), strokewidth=0.1, label="histogram")
lines!(ax, [sample_mean, sample_mean], [0.0,0.25], label="exp. value")
lines!(ax, [sample_mean+sample_sqrt_var, sample_mean+sample_sqrt_var], [0.0,0.25], label="mean+√var")
lines!(ax, [sample_mean-sample_sqrt_var, sample_mean-sample_sqrt_var], [0.0,0.25], label="mean-√var")
lines!(ax, [σ_F.val, σ_F.val], [0.0,0.25], label="σ_F.val",linestyle=:dash)
lines!(ax, [σ_F.val+σ_F.err, σ_F.val+σ_F.err], [0.0,0.25], label="σ_F.val+σ_F.err",linestyle=:dash)
lines!(ax, [σ_F.val-σ_F.err, σ_F.val-σ_F.err], [0.0,0.25], label="σ_F.val-σ_F.err",linestyle=:dash)
Legend(f[1,5], ax, labelsize=8)

f

@jwaldrop107

Edit: Thought about it and now I think you can call 𝜎_𝑎 a (empirical) standard deviation...but without knowledge of the pdf of a, this does not contain too much useful information, unless you assume your measurement error is normal distributed which does not necessarily needs to be true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ CMake review TeX Track: 5 (DSAIS) Data Science, Artificial Intelligence, and Machine Learning
Projects
None yet
Development

No branches or pull requests

4 participants