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

How can I find a line through 3D points?

This is easier explained with pictures. I have these green points: And I want to get a few points along this red line: This is a top view, but I have complete XYZ coordinates for each point. I also have which vertex is connected to which other…
Sunjay Varma
  • 5,007
  • 6
  • 34
  • 51
3
votes
1 answer

Fitting a curve to weibull distribution in R using nls

I am trying to fit this data to a weibull distribution: My x and y variables are: y <- c(1, 1, 1, 4, 7, 20, 7, 14, 19, 15, 18, 3, 4, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1) x <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,…
Aditya Bhatia
  • 35
  • 1
  • 5
3
votes
1 answer

How can I simulate a Bezier curve out of an image?

If I have a set of points from a black-white image I scanned. It looks like a curve and I want to simulate a smooth curve using cubic Bezier curve from those points. How can I figure out the start point, 2 control points and the end point? From…
off99555
  • 3,797
  • 3
  • 37
  • 49
3
votes
3 answers

How to use least squares method in Matlab?

I have 37 linear equations and 36 variables in the form of a matrix equation; A*X=B . The equations don't have an exact answer. I want to use Matlab least square method to find the answers with the least error. I am new to Matlab so any comments…
nasim
  • 725
  • 2
  • 8
  • 17
3
votes
1 answer

Output of MATLAB Curve Fitting Toolbox does not match generated function

A similar question has been answered in the past, but my part of their question was not answered (Matlab curve fitting tool, cftool, generate code function does not give the same fit). I have a set of data points that are meant to show the "ideal"…
ser
  • 53
  • 6
3
votes
1 answer

How to measure the quality of a best fit line in Python?

I have some data points to plot, and would like to add a best fit line to the graph, and then output the relevant metrics to indicate the quality of the best fit line. I could plot the data, and polyfitis a function I used to add the best fit line.…
Kevin
  • 2,191
  • 9
  • 35
  • 49
3
votes
1 answer

Fitting a surface to collection of 3D data points in java

Hi I have a cloud of XYZ data points. I want to estimate a surface which best fits these points, so that later on I can input an XY pair and get back the Z value where this XY pair lies on the surface. Is there an existing Java library that will…
ed Bevan
  • 73
  • 7
2
votes
1 answer

Deduce center of circle from portion of circumference

I have sequences of points forming arcs(?). I would like to deduce the best fit circular (or even ellipsoid) curve for these points. Each arc has a relatively consistent change of angle across its length (that is partly how I isolate them). An…
DrPhill
  • 614
  • 5
  • 16
2
votes
3 answers

lmfit and scipy curve_fit return initial guesses as best-fitted parameters

I want to fit a function to some data and I’ m facing a problem. I’ ve tried to use lmfit or curve_fit from scipy. Below I describe the problem. Here is my data: dataOT = pd.read_csv("KIC3239945e.csv", sep=';')…
2
votes
1 answer

Gnuplot: Using arrays as parameters in fit curve doesn't work

It seems individual array values do not work the same way in gnuplot as normal variables. I have tried the following code given below. # Following code doesn't work. reset # Parameters and fitting curve n = 3 array p[n] p[1] = 1.3 ; p[2] = 0.2 ;…
ASarkar
  • 469
  • 5
  • 16
2
votes
0 answers

How to graph a function in iOS-charts

I am using the iOS-charts library in (Swift 3) to plot my data into a scatter chart. I have a scatter chart and now would like a line chart to display a non-linear best fit line from the scatter data. Does the charts library have any easy functions…
2
votes
2 answers

How to force zero interception for fitting a 2nd order function? (Python)

I am trying to fit a second order function with a zero intercept. Right now when I plot it, I am getting a line with a y-int > 0. I am trying to fit to a set of points output by the function: y**2 = 14.29566 * np.pi * x or y = np.sqrt(14.29566 *…
Nikk O'ghaza
  • 21
  • 1
  • 5
2
votes
2 answers

Guess precise evolution of curve with curve fittin python

I have datapoints that give information about the evolution of the temperature of an object over time. Following are these datapoints plotted My goal is to fit a function as precise as possible to find the evolution of the temperature in the future…
Chris
  • 143
  • 2
  • 12
2
votes
2 answers

Generating a curve around the point on a scatter plot

I am generating a scatter plot containing data from multiple sources, as displayed below. I would like to be able to generate a curve surrounding an arbitrary query point and passing through points on scatter plot. Final goal is to calculate the…
Nikola Malešević
  • 1,738
  • 6
  • 21
  • 44
2
votes
0 answers

NumPy multidimensional polyfit

I want to use numpy to create a nonlinear calibration system. I have a set of pairs, where each pair is an empirically measured (x, y, z) coordinate, and a nominal (x, y, z) coordinate. I need to create a best fit multidimensional polynomial system…
jacobfeder
  • 37
  • 5