Questions tagged [best-fit-curve]

Anything related to so-called curve-fitting algorithms, i.e. algorithms used to compute the best parameters of some given curve model which make the curve best approximate some data points, according to some given optimality criterion.

Anything related to so-called curve-fitting algorithms, i.e. algorithms used to compute the best parameters of some given curve model which make the curve best approximate some data points, according to some given optimality criterion.

An example of a curve-fitting problem is: finding the parameters m and q of the line equation y=mx+q so that the mean distance of a set of points from that line in the plane is minimal.

103 questions
0
votes
0 answers

Line of best fit through data points

Ideally want a polynomial fit or Gaussian Process Regression. Unsure how to implement this in sklearn. Data is stored in pandas. I have tried the below, but it loads very slowly, even when there are only 128 data points. from sklearn.svm import…
Tom Dry
  • 121
  • 2
  • 9
0
votes
0 answers

Linear fit with error bars python

I'm trying to fit a set of points with error bars using the scipy.optimize function curve_fit. The file I use to read the input is something like y x dy_1 dy_2 0.64 45.1 6.65E-004 1.20E-002 0.72 …
0
votes
1 answer

[Octave]Using fminunc is not always giving a consistent solution

I am trying to find the coefficients in an equation to model the step response of a motor which is of the form 1-e^x. The equation I'm using to model is of the form a(1)*t^2 + a(2)*t^3 + a(3)*t^3 + ... (It is derived in a research paper used to…
0
votes
0 answers

How to draw extended curve?

My problem is, I have a curve with red dots as the image below. I want to extend the curve like the blue dots in the image. How can I do it? I think finding Bézier curve with the red dots and somehow extending the Bézier function may work, but I am…
0
votes
1 answer

Scipy.optimize not fiting to my data

I cannot get scipy.optimize.curve_fit to properly fit my data which is visually apparent. I know approximately what the parameter values should be and if I evaluate the function with the given parameters the calculated and experimental data appear…
Charco
  • 31
  • 6
0
votes
1 answer

Smooth and fit edge of binary images

i am working on a research about the swimming of fishes using analysis of videos, then i need to be carefully with the images (obtained from video frames) with emphasis in the tail. The images are in High-Resolution and the software that i…
0
votes
1 answer

IndexError: only integers, slices (`:`), ellipsis (`...`) . .

I am using pymc3 to find a best fit for a 3D surface. This is the code that I am using. with Model() as model: # specify glm and pass in data. The resulting linear model, its likelihood and …
VD97
  • 3
  • 2
  • 6
0
votes
1 answer

Interpolation on a Curve in R

I have a dataset called dataframe (a 2d table) and a best fit curve as: scatter.smooth(dataframe, xlab="", ylab="") What code would I need to realize and evaluate (get numerical value of) a Y value on that best fit curve at a single x value?
0
votes
0 answers

What changes can I make to this algorithm to draw a logarithmic graph best fit curve?

I've used an algorithm found here: http://faculty.cs.niu.edu/~hutchins/csci230/best-fit.htm to draw a best fit line as shown below: int pointCount = 0; //The number of readings in the graph double SumX = 0; //Sum of all the X values double…
Alarming
  • 137
  • 1
  • 3
  • 14
0
votes
1 answer

Adaptive Linear regression

Let's say I have a set of samples, which consists of a non-stationary stochastic process with a uniform probability distribution (Gaussian). I need an adaptive linear regression over the set of samples. Basically I want the 'best-fit' line to behave…
Luis Cruz
  • 1,488
  • 3
  • 22
  • 50
0
votes
1 answer

Calculate y-value of curve maximum of a smooth line in R and ggplot2

I'm following up an old question addressed here: calculate x-value of curve maximum of a smooth line in R and ggplot2 How could I calculate the Y-value of curve maximum? Cheers
eFF
  • 267
  • 3
  • 17
0
votes
1 answer

MATLAB error: Vectors must be the same length

Hi I am trying to overlay histogram with normal distribution curve and I get an error: Vectors must be the same length. Can anybody explain what mistake I am doing here? This is the code I use: X = normrnd(1.5,.1,1,1000) [hy, hx] = hist(X,50); hy =…
0
votes
1 answer

Trying to find a best fit line for multiple noisy sine waves

I'm trying to create an average trace line/best fit line for multiple noisy sine waves. This is the code I've generated to create the sine waves: import matplotlib.pyplot as plt import numpy as np from scipy.optimize import leastsq x =…
0
votes
1 answer

How to fit a parabola to data in MATLAB by giving the center point?

I have a set of data, which on plotting x vs y, will give the plot as in this figure.I want to fit a parabola to this data and I've tried using the curve fitting tool in MATLAB. The only problem is that I'm getting an answer as shown here. I know…
0
votes
1 answer

Outlier detection using recursive curve fitting and error elimination

Is there any way to do anomaly detection in dataset using recursive curve fitting and removing points having the most mean square error with respect to the curve, upto an acceptable threshold? I am using the scipy.optimize.curve_fit function for…
Victor Juliet
  • 1,052
  • 11
  • 21