Code Monkey home page Code Monkey logo

Comments (3)

giordano avatar giordano commented on May 13, 2024

You're missing correlation between variables: https://juliaphysics.github.io/Measurements.jl/stable/usage/#Correlation-Between-Variables-1. a has the same measurement twice, b has two distinct measurements. See also #47

from measurements.jl.

giordano avatar giordano commented on May 13, 2024

To elaborate a bit:

julia> using Measurements

julia> a = fill(1.0 ± 0.5, 2)
2-element Array{Measurement{Float64},1}:
 1.0 ± 0.5
 1.0 ± 0.5

julia> a[1] === a[2]
true

julia> sum(a)
2.0 ± 1.0

julia> b = [1.0 ± 0.5, 1.0 ± 0.5]
2-element Array{Measurement{Float64},1}:
 1.0 ± 0.5
 1.0 ± 0.5

julia> b[1] === b[2]
false

julia> sum(b)
2.0 ± 0.71

a[1] === a[2] shows that the two quantities are exactly the same measurements and their sum must take this into account, while the fact that b[1] !== b[2] means that the two quantities are distinct measurements, and the uncertainty of their sum is simply the quadrature sum of their uncertainties.

You can understand that the mean of a is the same as that of each element of the vector because they're just all the same measurement, so you don't get more insight by taking the mean of the same measurement repeated multiple times.

from measurements.jl.

bensetterholm avatar bensetterholm commented on May 13, 2024

Thank you very much, this explains the tag property, of which I found the discussion of in the Appendix.

from measurements.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.