Questions tagged [curve-fitting]

Fitting 1-D curve to data points, minimizing pre-defined error/loss function.

From wiki:

Curve fitting is the process of constructing a curve, or mathematical function, that has the best fit to a series of data points.

3428 questions
1
vote
1 answer

3D curve fitting using python

I am trying to reduce the number of data points for a 3D curve, currently I have 20000 points and I would like to reduce this to around 2000 without losing much information. I am doing this on python. As a simple example, think of a spiral on…
Agustin
  • 1,458
  • 1
  • 13
  • 30
1
vote
1 answer

python curve fitting with results summary

sorry I am still fairly new to python and hoping someone can help me with a curve fitting issue... I have a MxN dataframe "data" where M is number of samples and N is number of variables (10). I have a Mx1 dependent variable "Fractions" which are a…
Jkravz
  • 13
  • 2
1
vote
1 answer

How can i fit a power curve from a non-linear regression?

I am trying to fit a curve following a non-linear regression. Here is my dataset: stem_diameter <- c(15, 15, 16, 17, 19, 23, 23, 24, 24, 25, 25, 26, 27, 28, 29, 30, 30, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 40, 41, 41, 42, 42, 46, 48, 48, 49, 51,…
G Jones
  • 43
  • 4
1
vote
0 answers

How to best-fit a rational function approximation to Theodorsen's function using the lsqcurvefit function in Matlab?

I am using a rational function (polynomial ratio) to approximate Theodorsen's function. I am having issues in guessing the correct (most optimal) initial guess parameters using the lsqcurvefit function in Matlab. Is there a way to know what would be…
Jesus
  • 179
  • 2
  • 2
  • 13
1
vote
1 answer

how to isolate data that are 2 and 3 sigma deviated from mean and then mark them in a plot in python?

I am reading from a dataset which looks like the following when plotted in matplotlib and then taken the best fit curve using linear regression. The sample of data looks like following: # ID X Y px py pz M R 1.04826492772e-05 1.04828050287e-05…
bhjghjh
  • 889
  • 3
  • 16
  • 42
1
vote
1 answer

Passing list of lists as input to scipy.optimize.curve_fit

I am trying to solve an example marketing mix model problem using python and the curve_fit function. I need to fit two sets of parameters, which i add to my function as a * arg list of lists. I can get the curve fit to work for one set of parameter…
1
vote
0 answers

Create a baseline to line up plots and then fit a Gaussian to each

I am trying to line up the attached plots so I can properly fit Gaussians to them but am not sure how to do so. I want them to have the same baseline. This is how I read in the data: fig = plt.figure(figsize=(16, 8),…
Sean Najmi
  • 11
  • 1
1
vote
1 answer

Tensorflow RNN simple and easy examples/ templates for fitting curves?

I am looking for simple and easy examples or template scripts of Recurrent Neural Networks (RNN) with Tensorflow, applicabel to my problem. I am trying to fit a curve trough noisy data x, with the additional challenge that the data has a gap (see…
NeStack
  • 1,739
  • 1
  • 20
  • 40
1
vote
1 answer

How to calculate a logical curve along a set of values?

I am trying to take a float value, with an arbitrary minimum and maximum possible value, and convert it to a linear scale, for representation on a bar-shaped indicator. The problem is, I can't just lerp it between the minimum and maximum, because…
SuperKael
  • 226
  • 2
  • 11
1
vote
1 answer

Getting more refined results from Python SciPy curve_fit

I've got the following bit of Python (v2.7.14) code, which uses curve_fit from SciPy (v1.0.1) to find parameters for an exponential decay function. Most of the time, I get reasonable results. Occasionally though, I'll get some results which are…
1
vote
0 answers

how to plot two graphs in the same panel (ggplot2)

I just need to put two different curves (one GLM segmented regression and a normal GLM of the same data) into a single panel (one graph, not different facets). I have been able only to place the two graphs next to each other (below), but what I need…
lep
  • 67
  • 1
  • 1
  • 6
1
vote
0 answers

Fit sine curve to points that are not equally spaced - no parameter is known

I have a set of data points that are measured points of a bore and that are not equally spaced, and I would like to fit a sine curve to them. Could you help me, please? We would like to examine the shape differences between this bore and a perfect…
Lemongrass
  • 11
  • 4
1
vote
1 answer

Exponential fit - sum of exponentials

I want to fit the following data: x(time) y(data) 0.75; 19.33 1; 19.04 1.25; 17.21 1.5; 12.98 1.75; 11.59 2; 9.26 2.25; 7.66 2.5; 6.59 2.75; 5.68 3; 5.1 3.25; 4.36 3.5; 4.43 …
Gerard
  • 45
  • 10
1
vote
1 answer

Limit curve_fit or polyfit to monotone functions

I am trying to create a function that takes a set of observed and expected data points, determines the optimum function for calibration and applies this calibration on the whole data set (from which the data points are a subset). However, I want to…
Bas Jansen
  • 3,273
  • 5
  • 30
  • 66
1
vote
0 answers

scipy.curve_fit - How do you get curve_fit to produce/choose the best parameter estimate?

I am trying to fit a curve smoothing function onto a number of my data sets, but I actually need to manually input the guess parameter for the respective lambda, theta, sigma and variables etc for each of such sets, or else it would provide a…
Ang Jit Wei Aaron
  • 389
  • 1
  • 3
  • 19
1 2 3
99
100