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

Substitute values with uncertainties in sympy

I am trying to differentiate an equation for air change efficiency and substitute the values of volume flow as integers using sumpy. This works absolutely fine. But in the next step i would like to apply uncertainities to the volume flows I…
0
votes
0 answers

Implement variational approach for budget closure with 2 constraints in python

I'm new to Python and am quite helpless with a problem I have to solve: I have two budget equations, let's say a+b+c+d=Res1 and a+c+e+f=Res2, now every term has a specific standard deviation a_std, b_std,... and I want to distribute the budget…
suwi
  • 1
  • 1
0
votes
1 answer

Standard deviation of a cartesian distance calculated using the haversine in Matlab?

I have four matlab vectors which denote the position of two airplanes using Shperical coordinates at different moments. I have calculated the distance between them using the haversine…
slow_learner
  • 337
  • 1
  • 2
  • 15
0
votes
1 answer

Uncertainties package in Python : use of given covariance matrix to get data uncertainties

I believe that my problem is fairly easy to understand, but I would like to make it very clear, hence the length of this post. My initial situation, which I sum up below, is similar to the one explained in this post…
0
votes
0 answers

square root and powers on numpy arrays

I need help with square root and powers. I am calculating the mean errors and I have been told to do this for each element: dmgfeerr = sqrt(dmgherr**2 - dfeherr**2). but I get an error message: TypeError: only size-1 arrays can be converted to…
0
votes
1 answer

Jensen–Shannon divergence analysis of numbers

The Jensen–Shannon divergence is a method of measuring the similarity between two probability distributions and it is bounded by 1 ( 0 <= JSD(p,q) <= 1). I have applied the python code of Jensen–Shannon divergence and I want to analyze my results. I…
0
votes
1 answer

Finding best fit parameters for a set of equations with known uncertainties

As a follow up to another question: solve linear equations given variables and uncertainties: scipy-optimize?solve linear equations given variables and uncertainties: scipy-optimize? It appears to me that I have a very similar problem. I am…
ChriBe
  • 13
  • 2
0
votes
0 answers

How do you include x errors in a weighted curve fit using scipy.optimize.curve_fit?

I need to use scipy.optimize.curve_fit to fit a curve to experimental data and extract the parameters. My data has both x and y uncertainties. The documentation explains how to include the y-uncertainties as follows: sigma : None or M-length…
Anna
  • 53
  • 1
  • 5
0
votes
1 answer

Continuous and discrete variables with OpenTURNS

How to create a design of experiments with both continuous and discrete random variables with OpenTURNS? I get that we can do: X0 = ot.Normal() X1 = ot.Normal() distribution = ot.ComposedDistribution([X0,X1]) But this creates only a continuous…
tupui
  • 5,738
  • 3
  • 31
  • 52
0
votes
1 answer

how to calculate errors in a derived quantity in Python

I have two quantities x and y and their covariance matrix cov(x,y), and I want to calculate the error in a derived quantity z=1/(x-y). Is there is a package to calculate mean value of z and sigma(xz) and sigma(zy) ? thank you very much in advance
0
votes
0 answers

Uncertainty Intervals

I'm going to see the behavior of ensembles of the data. a better way to visualize ensemble is by using the various uncertainty intervals along with the mean. We can compute the uncertainty interval at various percentile using the"…
0
votes
1 answer

Unexpectedly long computation time with uncertainties package

Consider the following snipped of code: import random from uncertainties import unumpy, ufloat x = [random.uniform(0,1) for p in range(1,8200)] y = [random.randrange(0,1000) for p in range(1,8200)] xerr = [random.uniform(0,1)/1000 for p in…
Sito
  • 494
  • 10
  • 29
0
votes
1 answer

"Uncertain" datetime objects in python?

I have a bunch of field data, where some have a well known acquisition day, while for some the acquisition is just known with an unvertainty margin, say +/- 1.5 months as an example. Is there something such as an "uncertain datetime object" that…
user3017048
  • 2,711
  • 3
  • 22
  • 32
0
votes
1 answer

Calculating the covariance between 1-D arrays for incorporation into propagation of uncertainty in Python

I have four 1-D arrays of dependent variables. They contain hundreds of data points but I have cropped them to 20 in this example. Each point represents a grid cell on a map. import numpy as np A=np.asarray([0.195, 0.154, 0.208, 0.22, 0.204,…
izzyrizzy
  • 43
  • 4
0
votes
1 answer

How to propagate error when using scipy quad on a spline of data with measurement error?

I have a data set with N points which I fit a spline to and integrate using scipy.integrate.quad. I would like to use the N associated measurement errors to put an error estimate on the final integral value. I originally tried to use the…
handroski
  • 81
  • 2
  • 3
  • 15