Comments (4)
Yes, I'm aware that for large calculations the performance is not ideal. Try computing the mean of a large vector 😣 However, for a large set of uncorrelated measurements there is the weightedmean
functions which is much faster and probably what the user is after.
The extremely basic implementation from rosettacode is fast because it doesn't deal with correlation:
julia> x1 = Measure(100, 1.1) # from rosettacode
100.0 ± 1.1
julia> x1-x1
0.0 ± 1.5556349186104046
julia> x = measurement(100, 1.1) # from this package
100.0 ± 1.1
julia> x-x
0.0 ± 0.0
Dealing with correlation is the main source of the overhead. I prefer something slow but correct to something fast but unreliable.
Any chance that performance of Measurements.jl can be improved?
Not from me, currently, but patches are always welcome 🙂 The important thing is that functionalities are maintained, this should be an under-the-hood only change. I've the feeling that performance can be improved, but I've never looked into this very deeply. Thanks for opening this issue!
from measurements.jl.
I see, correlations indeed can be quite important and it is far from obvious how to speed up calculations while maintaining them. However it would be useful to have another mode (or type, or something) for fast computations without tracking correlations. For even moderately-sized datasets x50 slowdown is very significant, and what is often needed is just simple uncertainty propagation with independent observations.
from measurements.jl.
what is often needed is just simple uncertainty propagation with independent observations
It's not that simple. If x
is a measurement, f(x)
is a quantity correlated with x
, then if you perform calculations involving both x
and f(x)
(or another quantity derived from x
) you have to take care of correlation between them. Correlation is not important only if you're going to perform a single operation with a one-argument only function, and then stop
from measurements.jl.
However it would be useful to have another mode (or type, or something) for fast computations without tracking correlations.
I see your point, and it shouldn't be too hard to implement what you ask, but in my opinion its utility would be very limited (see above message) and would greatly confuse users (which type should I use? With correlation or not? What if I later change my mind?).
Some overhead compared to plain-bit numbers is to be expected, this type is going to do much more than adding or multiplying simple Float64
numbers. Large overhead comes when several quantity are involved, performance of calculations involving Measurement
objects currently goes as O(n^2)
. It would be really great if someone could find a way to improve performance to O(n)
.
from measurements.jl.
Related Issues (20)
- making measurements work with Printf
- Error when hashing Measurement{Float64} HOT 5
- Adding measurement components back to a measurement after iteratively solving for a value HOT 7
- [FR] Plot recipe: ribbon plots option beside error bars HOT 11
- tryparse for Measurement type
- Can't use unique with measurements HOT 1
- Measurements with missing errors HOT 4
- Measurements.value(x::Missing) = missing HOT 1
- Integration with Zygote
- `weightedmean()` returns `NaN ± 0`? HOT 1
- Use auto-differentiation engine
- Bad integration with Plots' boxplot HOT 2
- Move to pkgextensions for Julia v1.9+
- one(measurement) should return 1, not 1 ± 0 HOT 8
- `Symbolics.jl` support? HOT 7
- Plotting mixture of measurements and missing data HOT 1
- Trying to use Measurements to differentiate respect to a unitful quantity. HOT 12
- Is there an autodiff package that is compatible? HOT 3
- Broken `MeasurementsJunoExt.jl` HOT 1
- Julia 1.6 incompatibility from stdlib compat bounds HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from measurements.jl.