Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python scipy put more weight to a set value in curve_fit

from scipy.optimize import curve_fit

# simply add an uncertainties to each sample;
# very small uncertainty mean almost as true value, so will be taken as reference point;
uncertainties = numpy.array([1.0E-10, 1.0E-10, 1.0E-10, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,1.0, 1.0])

# Use uncertainties with absolute_sigma as True;
fittedParameters, pcov = curve_fit(func, xData, yData, sigma=uncertainties, absolute_sigma=True)
 
PREVIOUS NEXT
Tagged: #python #scipy #put #weight #set
ADD COMMENT
Topic
Name
3+1 =