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

Fitting a curve over bar chart (categorical variable)

I am wondering if there is a method to fit a curve to a bar chart. In the example below, I have coefficients for each class, and it is clear that the data follows a distribution. However, because the data is categorical, I am unsure if there is a…
0
votes
2 answers

Can i tell numpy curve_fit to find the best parameters that meet some conditions?

I have this set of experimental data: x_data = np.array([0, 2, 5, 10, 15, 30, 60, 120]) y_data = np.array([1.00, 0.71, 0.41, 0.31, 0.29, 0.36, 0.26, 0.35]) t = np.linspace(min(x_data), max(x_data), 151) scatter plot I want to fit them with a curve…
0
votes
0 answers

.drc plot and ggplot function

I am trying to plot a graph with ggplot. Currently, I am only able to plot with the plot function in R, not ggplot for my .drc results. I want to use ggplot since I already have nice line of code for it and ggplot is more customizable than the plot…
Regan
  • 21
  • 6
0
votes
0 answers

Is there a way to plot a line of best fit through the origin in MATLAB

I am currently working on an engineering project and have to use complex numbers. I want to take the complex numbers, plot the real and imaginary parts of them, and then fit a line of best fit that is forced through the origin. This is the following…
jammyjam
  • 1
  • 1
0
votes
0 answers

Fitting line with branches to xyz coordinates in python

I have a set of points in 3d space which I'd like to fit a line through. The points are pretty tight, but there are obvious branches, as illustrated crudely below. Essentially, I want to describe the "path" implied by this data using one/several…
0
votes
0 answers

Plotting a non linear best fit line in Python

I'm trying to plot a best fit line for my train/test dataset and compare with the original values to see how well it fits. I am able to plot the line of fit for the original dataset. But when it comes to the train/test dataset, it goes haywire.…
0
votes
2 answers

LabView cos fitting

I am working on a program that needs to fit numerous cosine waves in order to determine one of the parameters for the function. The equation that I am using is y = y_0 + Acos((4*pi*L)/x + pi) where L is the value that I am trying to obtain from the…
UH REU
  • 1
  • 1
0
votes
1 answer

Generate best fit curve for 3D coordinates

Dear all: I have a dataset that contains multiple data points in 3D, and I'm trying to find the best fit curve for this dataset. I could do this in 2D as follow. import numpy as np import os import pandas as pd import matplotlib.pyplot as plt from…
yihao ren
  • 369
  • 1
  • 4
  • 15
0
votes
0 answers

Outputting multiple best fit curves based on one dataset (Lmfit, Python)?

I am trying to fit a logistic regression model to a dataset that has multiple measurements. When I put my data through CurveFit, Lmfit StepModel/Model, I get the same number of best fit curves as the number of sets of measurements rather than one…
0
votes
0 answers

looking for a good MatLab function

I have a set of data in 2D give me an ellipse I am looking for a MatLab function or any other function in programming languages that gives me a best fit for the 2D ellipse to a cone, I used cftool function in MatLab but it gave another shape not a…
0
votes
2 answers

Is it possible to fit specific slopes to best fit segments of data in R?

Background: I am analyzing oil production data where I plot daily oil rate on the y-axis and a diagnostic "time" factor on the x-axis. This combination tends to exhibit a certain trend depending on the flow regime where there is typically a half…
kHAN
  • 1
0
votes
1 answer

Determining degree of polynomial equation

I am writing a Polynomial Line of Best Fit solver as a term break project for fun. Given the input: a degree of polynomial (i.e. 2) and a set of points they want to use 167, 563 264, 429 410, 562 Using Least Squares Approximation Method, when…
user11010869
0
votes
0 answers

Multiple lines shown up on graph when using lines() to plot only one best fit curve or line

I tried to use lm() with poly() to calculate the best fit 2nd order polynomial curve. That ran fine, but when i used lines() to plot it, the curve looked weird, as if there were multiple curves drawn on the graph. play <-…
chung
  • 1
  • 1
0
votes
1 answer

How to find the best fitting function for a y-x non-linear relationship

I have two variables, y being the number of targets achieved and x the number of individuals involved in the operation. The relationship is positive and non-linear (there are only so many individuals you can add before the returns of adding…
Filippo Sebastio
  • 1,112
  • 1
  • 12
  • 23
0
votes
0 answers

How does Excel's AutoFill work for Weekdays, Months and Years?

While using fill for dates in Excel, there are 4 options. Fill Days. Fill Weekdays. Fill Months. Fill Years. I am trying to implement the basic functionalities of a Spreadsheet application. I have implemented the Fill Series for normal numeric…