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
5
votes
1 answer

Line plus shaded region for error band in matplotlib's legend

I would like to have a legend similar to but with the dashed line and the yellow region merged like this:
Somebody
  • 236
  • 3
  • 6
5
votes
1 answer

How to use uncertainties to weight residuals in a Savitzky-Golay filter.

Is there a way to incorporate the uncertainties on my data set into the result of the Savitzky Golay fit? Since I am not passing this information into the function, I asume that it is simply calcuating the 'best fit' via an unweighted least-squares…
RobG
  • 51
  • 2
4
votes
2 answers

Pystan Posterior Uncertainty Intervals

I saw on another forum that PyStan doesn’t have the same function as RStan where they use posterior_interval(), but we can use numpy.percentile() instead. I’m currently using the pystan.StanModel.optimizing() function in PyStan to get the set of…
4
votes
4 answers

Average of an uarray in python uncertainties

My problem: I have an array of ufloats (e.g. an unarray) in pythons uncertainties package. All values of the array got their own errors, and I need a funktion, that gives me the average of the array in respect to both, the error I get when…
DomR
  • 41
  • 1
  • 2
4
votes
1 answer

Uncertainty on pose estimate when minimizing measurement errors

Let's say I want to estimate the camera pose for a given image I and I have a set of measurements (e.g. 2D points ui and their associated 3D coordinates Pi) for which I want to minimize the error (e.g. the sum of squared reprojection errors). My…
BConic
  • 8,750
  • 2
  • 29
  • 55
4
votes
1 answer

How do I include errors for my data in the lmfit least squares miniimization, and what is this error for conf_interval2d function in lmfit?

I am new to python, and trying to use the lmfit package to check my own calculations, however I am unsure (1) as to how to include the errors for data (sig) for the following test (and 2) of an error I get with conf_interval2d shown below): …
Nicole Goebel
  • 537
  • 1
  • 9
  • 17
4
votes
2 answers

zero division error in python uncertainties package

Why does the following zero division error occur? >>> from uncertainties import ufloat >>> a = ufloat((0,0)) >>> x = ufloat((0.3,0.017)) >>> a**x Traceback (most recent call last): File "", line 1, in File…
user545424
  • 15,713
  • 11
  • 56
  • 70
3
votes
0 answers

Simultaneously handling uncertainties and units in python

I building a python library to analyze data (e.g. spectral data) with units and uncertainties. For example, we have data on wavelength (nm), counts, and power (W). I want to be able to easily convert between units e.g. from wavelength in nm to um. I…
Selewirre
  • 41
  • 3
3
votes
0 answers

How to shade under curve in matplotlib, but with variable color alpha?

I have some data points which are a function of one variable. I'd like to plot these, but there's associated uncertainty in each datum. Error bars would be OK, but I'd like to be able to visualize the way we expect the error to be distributed as…
Gavin Ridley
  • 371
  • 3
  • 15
3
votes
1 answer

Issue with Monte Carlo analysis with uncertainty on LCIA

I try to run a Monte Carlo analysis with uncertainty on characterization factor. The code is running well (no error) but the results for each iteration are always the same. Calculation works with just LCA simulation. Here is the code: Definition of…
3
votes
4 answers

Convert position confidence ellipse to covariance matrix

Is there any way to compute a covariance matrix out of a confidence/uncertainty/error ellipse? I know how it's done the other way around, using a 2x2 covariance matrix to compute an confidence ellipse (e.g. described here:…
Thomas
  • 88
  • 2
  • 11
3
votes
2 answers

Search for value within a range in a pandas dataframe?

I am attempting to search for matching values within a range within a given uncertainty in a pandas dataframe. For instance, if I have a dataframe: A B C 0 12 12.6 111.20 1 14 23.4 112.20 2 16 45.6 112.30 3 18 …
Jmegan042
  • 251
  • 5
  • 15
3
votes
1 answer

LMFIT confidence interval uncertainty estimates error on python

the output error is : MinimizerException: Cannot determine Confidence Intervals without sensible uncertainty estimates Why I got this error? How can I calculate uncertainty estimates and solve this problem?? for dosya1 in glob.glob("mean*"): …
sirius123
  • 125
  • 1
  • 2
  • 4
3
votes
2 answers

Combining Sympy and uncertainties

I'm trying to use sympy to solve a polynomial equation, the coefficients of which have uncertainties. So for the uncertainties I'm trying to use the uncertainties module. Is there any way of doing the following: x=ufloat(10,0.2) #the xs are…
user2151741
  • 99
  • 1
  • 8
3
votes
1 answer

Python Uncertainties Module, ufloat can't unpack variable

I'm using python 2.7 and the module called "uncertainties" to analyse data from an experiment. I have two arrays, polycoeffs and cov, that were generated by the numpy function polyfit. I've managed to pull out the leading diagonal from the cov array…
user2151741
  • 99
  • 1
  • 8
1
2
3
9 10