curve-fitting Questions
3
Solved
I'm having a bit of trouble with fitting a curve to some data, but can't work out where I am going wrong.
In the past I have done this with numpy.linalg.lstsq for exponential functions and scipy.op...
Dismiss asked 16/1, 2013 at 0:57
2
I want to fit non-negative parameters (xs in the code) to a function fp, given by
where v and L are fixed, given parameters. Computing fp can be done relatively quickly by vectorizing it and using...
Falsework asked 18/6, 2024 at 11:5
2
Solved
I have a cable I am dropping from moving vehicle onto the ground. Using a camera system I estimate the location where the rope touches the ground in realtime. Movement of the vehicle and inaccuracy...
Chicanery asked 8/2, 2016 at 15:53
3
Solved
I am getting an optimize warning:
OptimizeWarning: Covariance of the parameters could not be estimated
category=OptimizeWarning)
when trying to fit my piecewise function to my data using scipy....
Soricine asked 13/1, 2017 at 19:15
13
Solved
I'm using Python and Numpy to calculate a best fit polynomial of arbitrary degree. I pass a list of x values, y values, and the degree of the polynomial I want to fit (linear, quadratic, etc.).
Th...
Joellyn asked 21/5, 2009 at 15:55
3
Solved
I am trying to figure out what it is I don't understand here.
I am following http://www.scipy.org/Cookbook/FittingData and trying to fit a sine wave. The real problem is satellite magnetometer dat...
Eros asked 15/11, 2012 at 19:51
7
Solved
I am trying to show that economies follow a relatively sinusoidal growth pattern. I am building a python simulation to show that even when we let some degree of randomness take hold, we can still p...
Plato asked 23/5, 2013 at 14:15
2
I'm trying to fit a sigmoid curve onto a small set of points, basically generating a probability curve from a set of observations. I'm using scipy.optimize.curve_fit, with a slightly modified logis...
Nordic asked 22/8, 2019 at 18:30
2
Solved
My question involves statistics and python and I am a beginner in both. I am running a simulation, and for each value for the independent variable (X) I produce 1000 values for the dependent variab...
Stupefy asked 11/9, 2016 at 8:52
8
Solved
I have some data that I want to fit so I can make some estimations for the value of a physical parameter given a certain temperature.
I used numpy.polyfit for a quadratic model, but the fit isn't ...
Paramilitary asked 22/8, 2018 at 17:58
2
Solved
I am trying to fit this function to some data:
But when I use my code
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
def f(x, start, end):
res = np.empty...
Crossroad asked 16/5, 2018 at 12:49
3
Solved
I have the following data:
>>> x
array([ 3.08, 3.1 , 3.12, 3.14, 3.16, 3.18, 3.2 , 3.22, 3.24,
3.26, 3.28, 3.3 , 3.32, 3.34, 3.36, 3.38, 3.4 , 3.42,
3.44, 3.46, 3.48, 3.5 , 3.52, 3.54, 3...
Macaronic asked 12/9, 2013 at 14:49
5
Solved
I have a set of frequency data with peaks to which I need to fit a Gaussian curve and then get the full width half maximum from. The FWHM part I can do, I already have a code for that but I'm havin...
Imbecilic asked 8/11, 2012 at 14:4
3
Solved
I have some points and I am trying to fit curve for this points. I know that there exist scipy.optimize.curve_fit function, but I do not understand the documentation, i.e. how to use this function....
Hayton asked 3/10, 2013 at 17:16
5
Solved
I have the following code:
import numpy as np
from scipy.optimize import curve_fit
def func(x, p): return p[0] + p[1] + x
popt, pcov = curve_fit(func, np.arange(10), np.arange(10), p0=(0, 0)) ...
Birdiebirdlike asked 20/8, 2013 at 3:31
4
Solved
I have a fitting function which has the form:
def fit_func(x_data, a, b, c, N)
where a, b, c are lists of lenth N, every entry of which is a variable parameter to be optimized in scipy.optimize....
Jemy asked 7/12, 2015 at 15:6
3
Solved
I have a function Imaginary which describes a physics process and I want to fit this to a dataset x_interpolate, y_interpolate. The function is a form of a Lorentzian peak function and I have some ...
Peking asked 19/12, 2017 at 10:29
9
Solved
I'm trying to draw a smooth curve in R. I have the following simple toy data:
> x
[1] 1 2 3 4 5 6 7 8 9 10
> y
[1] 2 4 6 8 7 12 14 16 18 20
Now when I plot it with a standard command it ...
Rawdon asked 13/8, 2010 at 20:18
8
Solved
I'm trying to generate a linear regression on a scatter plot I have generated, however my data is in list format, and all of the examples I can find of using polyfit require using arange. arange do...
Kelliekellina asked 27/5, 2011 at 5:32
3
Solved
I've done a search and the problem seems similar to Python scipy: unsupported operand type(s) for ** or pow(): 'list' and 'list'
however the solution posted there did not work and I...
Glasser asked 11/1, 2013 at 19:1
2
Solved
I am trying to use circle fitting code for 3D data set. I have modified it for 3D points just adding z-coordinate where necessary. My modification works fine for one set of points and works bad for...
Psychogenesis asked 18/3, 2013 at 15:57
5
Solved
In a project I'm working on I need to obtain a Gaussian fit from a set of points - needing mean and variance for some processing, and possibly an error degree (or accuracy level) to let me figure o...
Wherewith asked 12/10, 2011 at 14:40
5
Solved
Using NumPy's polyfit (or something similar) is there an easy way to get a solution where one or more of the coefficients are constrained to a specific value?
For example, we could find the ordina...
Nopar asked 26/1, 2018 at 21:35
2
Solved
I do not understand why polynomial.Polynomial.fit() gives coefficients very different from the expected coefficients :
import numpy as np
x = np.linspace(0, 10, 50)
y = x**2 + 5 * x + 10
print(np...
Limpid asked 3/5, 2021 at 15:28
7
Solved
Is there a function in R that fits a curve to a histogram?
Let's say you had the following histogram
hist(c(rep(65, times=5), rep(25, times=5), rep(35, times=10), rep(45, times=4)))
It looks no...
Stupa asked 30/9, 2009 at 11:23
1 Next >
© 2022 - 2025 — McMap. All rights reserved.