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

Python curve fitting on a barplot

How do I fit a curve on a barplot? I have an equation, the diffusion equation, which has some unknown parameters, these parameters make the curve larger, taller, etc. On the other hand I have a barplot coming from a simulation. I would like to fit…
Euler_Salter
  • 3,271
  • 8
  • 33
  • 74
2
votes
1 answer

How to fit curve lines with yscale('log') - Python

I've been trying to fit some data to the best fit line for a specific set x and y. I tried unsucessfully many times, and I cant seem to find a way to fit the data using yscale('log') and xscale('log'). I get this weird result but I can't seem to…
2
votes
2 answers

How should I add a line of best fit to my plot without the statistics package?

I have a scatter plot of data and I want to add a best fit line. All I can find online is the statistics package, but my school hasn't paid for that. Is there another was to do this - without the statistics package?
user2998603
  • 21
  • 1
  • 1
  • 3
2
votes
2 answers

Adding a curve to a scatter plot in R

My reproducible data is as follows: x <- c(7232L, 6274L, 8163L, 7421L, 6362L, 7206L, 7600L, 7421L, 9381L, 8173L, 7473L, 6318L, 5360L, 4732L, 7249L, 6435L, 5556L, 6256L, 6543L, 6113L, 8288L, 7438L, 6272L) y <- c(1.649, -0.27, 0.149,…
luks
  • 119
  • 1
  • 2
  • 7
1
vote
1 answer

Quality of circle fit for points (java/kotli/js/c)

A question I asked on recently SO elicited an excellent solution for finding best fit circle for a collection of points in 2d space. I now find that I need to quantify the quality of the circle fit, and not just determine the circle itself. I do…
DrPhill
  • 614
  • 5
  • 16
1
vote
2 answers

Method to find "cleanest" subset of data i.e. subset with lowest variability

I am trying to find a trend in several datasets. The trends involve finding the best fit line, but if i imagine the procedure would not be too different for any other model (just possibly more time consuming). There are 3 conceivable scenarios: All…
147
  • 582
  • 8
  • 20
1
vote
0 answers

Best fit to model is a poor predictor

For fun, I was trying to make a predictor for how long it would take for George R. R. Martin's The Winds of Winter to be released. My "best" model is the one that had the lowest combined AIC and BIC score (summed together). I tried polynomials of…
genjong
  • 115
  • 1
  • 15
1
vote
0 answers

Fitting 3rd order polynomial with known x intercept on ggplot2

I am trying to fit a 3rd order polynomial on ggplot2 using stat_smoth but would like to force the regression line through a know x-intercept (35 for the following reproducible…
1
vote
1 answer

What do I use in order to find the rational regression line of best fit model in python?

from numpy import * from matplotlib.pyplot import * import pandas as pd data = pd.read_csv('student-mat.csv', sep=';') predict = 'Markup' original = 'OriginalPrice' y = np.array(data[predict]) x = np.array(data[original]) p1 = polyfit(x,y,1) p2 =…
1
vote
2 answers

How do I fit a Gaussian curve to this data?

I am trying to get a curve to fit to this scatter data that gives me a Gaussian curve: library(tidyverse) MK20 <- tribble(~X.Intensity, ~Average, 0.400, 0.0000000, 0.463, 0.0000000, 0.536, 0.000000, …
1
vote
1 answer

Best-Fit without point interpolation

I have two sets of data. One is nominal form. The other is actual form. The problem is that when I wish to calculate the form error alone. It's a big problem when the two sets of data isn't "on top of each other". That gives errors that also include…
Moberg
  • 33
  • 5
1
vote
2 answers

How can I display equation of best fit and calculate r^2 for a histogram generated with scipy.stats?

I have created a histogram of Muon decays and want to find the r^2 value and display the function for the curve of best fit that I have graphed. I am using scipy.stats expon.fit function to generate the curve, how would I go about displaying the…
1
vote
1 answer

need to optimize specific function in order to have best fitted curve

I'm looking for best fitted curve that will match with a specific formula. The parameters A and B need to be optimize # X and Y are my datasets Y depend of…
1
vote
1 answer

Curve fitting a Matrix

Hey everyone I feel like I have a basic question that for some reason I can't figure out So I have a matrix: A = [1.7764,1.7677,1.7509,1.7352,1.7075,1.6715,1.6043l,1.5199,1.4210,1.3041,1.1756,1.0270,0.8582,0.6910,0.5493,0.3968,0.2187 ]; So I want…
David
  • 27
  • 3
1
vote
1 answer

How to calculate a smooth curve between two points, where the curve's trajectory must begin and end at two given angles

I have 2 points on a path (x1, y1) and (x2, y2). Both points has an angle value in degrees (a1 and a2 respectively). These are the angles that a curve intersecting these points must make with the y-axis when it intersects the associated (x, y)…
Jailan
  • 23
  • 1
  • 3