Questions tagged [uncertainty]

The uncertainties package is a python package that transparently handles calculations with numbers with uncertainties (like 3.14±0.01). It can also yield the derivatives of any expression.

The uncertainties package is a python package that transparently handles calculations with numbers with uncertainties (like 3.14±0.01). It can also yield the derivatives of any expression.

Tag usage

Questions on tag should be about implementation and programming problems.
Consider whether your question might be better suited to Cross Validated, the StackExchange site for statistics, machine learning and data analysis.

138 questions
3
votes
1 answer

Uncertainty in L,a,b space of compressed JPEG images

My team wish to calculate the contrast between two photographs taken in a wet environment. We will calculate contrast using the formula Contrast = SQRT((ΔL)^2 + (Δa)^2 + (Δb)^2) where ΔL is the difference in luminosity, Δa is the difference in…
3
votes
3 answers

Uncertainty propagation formula in mathematica

I'm trying to write a short piece of code that will perform propagation of errors. So far, I can get Mathematica to generate the formula for the error delta_f in a function f(x1,x2,...,xi,...,xn) with errors dx1,dx2,...,dxi,...dxn: fError[f_, xi__,…
user1748343
3
votes
3 answers

How to do a weighted fit for a with a set of data containing f(x) +- df(x)?

I have a function f(x) = a/x and I have a set of data containing values for f(x) +- df(x) and x +- dx. How do I tell gnuplot to do a weighted fit for a with that? I know that fitaccepts the using term and this works for df(x), but it does not work…
Foo Bar
  • 1,764
  • 4
  • 24
  • 43
2
votes
0 answers

Iterval arithmetic of real powers

I've found many definitions on how to compute the power of an interval, where the power is an integer, but I'd like to find a formula for computing the power more generally. In other words, I'd like to implement something like the 'pow' method…
Joshua Warner
  • 4,465
  • 2
  • 18
  • 13
2
votes
1 answer

how to add random values (random number to specific spot ) to x-ray image with tensorflow

I want to predict disease and I want to try to make the image have some noise or disruption in specific spot or randomly spot is there any method or solution for it?? is there any way to add noise (random value) to image with tensorflow I read the…
2
votes
0 answers

Displaying chi squared as the uncertainty of fit parameters in scipy.optimize

I am doing some curve fitting in python with the aid of scipy.optimize curve_fit. Normally I am satisfied with the scipy's default results. However this time I would like to display the function with chi_squared as the uncertainty of my fit…
Mark
  • 131
  • 9
2
votes
1 answer

Pandas+Uncertainties producing AttributeError: type object 'dtype' has no attribute 'kind'

I want to use Pandas + Uncertainties. I am getting a strange error, below a MWE: from uncertainties import ufloat import pandas number_with_uncertainty = ufloat(2,1) df = pandas.DataFrame({'a': [number_with_uncertainty]}) # This line works…
user171780
  • 2,243
  • 1
  • 20
  • 43
2
votes
0 answers

Solving an Integral equation with uncertainties, by using fsolve and uncertainties packages in Python

I have some variables that are uncertain, these are w_m = u.ufloat(0.1430, 0.0011) z_rec = u.ufloat(1089.92, 0.25) theta_srec = u.ufloat(0.0104110, 0.0000031) r_srec = u.ufloat(144.43, 0.26) and some constant values c = 299792.458 # speed of…
Arman Çam
  • 115
  • 7
2
votes
1 answer

How to evaluate the error/uncertainty of an equation in R?

I have a dataframe of four columns (https://www.dropbox.com/s/hho5sgwjhlk4185/data.csv?dl=0). I populated the rtp column based on the other ones, using the equation 0.03385*(pp**2)*(mv**0.94500)*(cc**(-0.03047)). Now, I would like to see the…
geo_dd
  • 283
  • 1
  • 5
  • 22
2
votes
0 answers

calculate Entropy for each class of the test set to measure uncertainty on pytorch

I am trying to calculate Entropy of each class of the dataset for an image classification task to measure uncertainty on pytorch,using the MC Dropout method and the solution proposed in this link Measuring uncertainty using MC Dropout on…
Ka_
  • 181
  • 1
  • 2
  • 8
2
votes
1 answer

How to compute the uncertainty of a Monte Carlo Dropout neural network with PyTorch?

I am trying to implement Bayesian CNN using Mc Dropout on Pytorch, the main idea is that by applying dropout at test time and running over many forward passes, you get predictions from a variety of different models. I need to obtain the uncertainty,…
2
votes
3 answers

Is there a way to activate dropout during inference in Keras, while freezing batch norm layers

I am trying to use the dropout layers in my model during inference time to measure the model uncertainty as described in the method outlined by Yurin Gal A solution is described in this post: How to calculate prediction uncertainty using Keras?,…
2
votes
1 answer

How should systematic uncertainties (up and down) in training data be handled in classification neural networks?

I have a classification neural network and nominal input data on which it is trained, however the input data has for each feature a systematic (up and down) uncertainty. How should the accuracy of the classifier be qualified and visualised using…
BlandCorporation
  • 1,324
  • 1
  • 15
  • 33
2
votes
0 answers

Why do the standard errors obtained via lsqcurvefit and fminunc function differ?

I am fitting a model to experimental data in Matlab. For this model I wanted to find the parameters by minimising the sum of square residues between the experimental and model data set. The model is of the form shown below: G(x) =…
2
votes
1 answer

How do you round a number to correct uncertainty?

In python, I have a number: U = 0.02462631224438585 +- 3.350971888120506e-06. How do I round it to the correct significant figures due to the uncertainty being rounded to 1s.f.? Is there an easy way of using numpy? Or scipy or are the built-in…
hi hi
  • 21
  • 3
1 2
3
9 10