Questions tagged [curve-fitting]

For questions about determining parameters for particular functional form based on set of given data points. These points may be the exact values generated from some underlying function or possibly have some additional noise component.

Filter by
Sorted by
Tagged with
0 votes
2 answers
58 views

scipy exp model fitting: prevent coefficients blowup

I'm trying to fit a few X-Y points that look like exponential. I used the following scipy code: ...
mastican's user avatar
0 votes
0 answers
24 views

Computing autocorrelation of scalar values

I obtained a list of $r^2_{end-to-end}$ from a Monte Carlo simulation of polymer movement. ...
user366312's user avatar
2 votes
1 answer
119 views

Weights for equidistant samples in power law fitting

I am working on fitting analytical curves to experimental data obtained in real viscoelastic tests (in fact, static creep tests). The setting of the problem is: the experimental data I have is a set ...
ren1's user avatar
  • 23
0 votes
0 answers
46 views

biexponential fits where exponents are very similar to each other but different than best monoexponential fit

I have some data which consists of an exponential process in time convolved with a gating function. I am fitting the underlying exponential using the least squares method. (I also have experimental ...
QMStatMech's user avatar
0 votes
1 answer
229 views

Find two lines around which points were randomly generated

Given a list of points that were randomly generated around two lines, find two new lines that match the original lines as closely as possible. Here's the function definition: ...
user143758's user avatar
1 vote
0 answers
19 views

Given a set of 1d-points, find the most probable periodicity that models the points (with possible omissions) as equidistant occurences

I try to detect interference fringes in a bunch of pictures. I projected on one axis, and I was able to detekt the peaks that indicate one of the fringes. So now I'm having a list with points (e.g. $(...
Quantumwhisp's user avatar
0 votes
1 answer
93 views

Averaging oscillatory data

I have an oscillatory data generated vs time as shown below. Essentially, I want this data to be averaged and free of any oscillations. I am not satisfied with the results from a simple moving average ...
Sthavishtha Bhopalam's user avatar
1 vote
1 answer
401 views

Finding the parameters of a function via curve fit

I'm trying to estimate the parameters (v, n, k) defined in fit_func. I tried the default least squares fit but I couldn't find the parameters successfully. ...
Natasha's user avatar
  • 421
0 votes
0 answers
523 views

Curve fitting using a piecewise polynomial

I am trying to fit a piecewise polynomial function Code: ...
Natasha's user avatar
  • 421
1 vote
1 answer
1k views

Fitting a rectangle-function to a signal in Python

I have a measured signal (current of a motor, turning on and off again) to which I want to fit a rectangular function in python. I came up with a reasonable ...
n4pK's user avatar
  • 121
1 vote
1 answer
85 views

What are the Exact Rules for Significant Figures, Precision, and Uncertainty?

In the physical sciences (which are physics, chemistry, astronomy, materials science, etc.), we learned that the uncertainty is +/- the smallest unit (which is 1) of the last significant figure if the ...
CoastCity Lapse 00crashtest's user avatar
0 votes
0 answers
43 views

I would like to fit a data to integral type model but cannot figure it how?

I have cumulative data for concentration versus time. I would like to fit the following model to the data: $$\frac{1}{\Gamma(n) \bar{t}}\int_{0}^{\frac{n t}{\bar{t}}}z^{n-1} e^{-z}dz$$ $n$ and $\bar{...
isar charmchi's user avatar
-1 votes
1 answer
156 views

Fitting gauss-hermite-parametrization to data?

I want to fit this data. I have the following model functions. Classic gaussian: def gauss_model(x, mu, sigma): return np.exp(-0.5*((x-mu)/sigma)**2) And ...
trynerror's user avatar
1 vote
1 answer
109 views

Parameter estimation simple theory question related to scipy.optimize.curve_fit

It has been a while since I have done some stats, and I have tried to fit a curve using optimize.curve_fit of parameter estimation. I am also interested in the standard deviation of the fitted ...
Daniel's user avatar
  • 99
1 vote
0 answers
194 views

Fitting data with a Voigt function

I have some data, (xrd data), that I would like peak fit with a pseudo-Voigt function, a combination of a Gaussian and a Lorentzian function. These are the functions $G(x) = I \exp\left( -\frac{4\ln(2)...
Peter's user avatar
  • 33
5 votes
1 answer
12k views

Why is my curve_fit not producing the covariance matrix and the correct values for the unknown variables?

I am trying to fit supernova data into a scipy.curve_fit function. However, when my code runs, the values of the unknown variables given by ...
Ani007's user avatar
  • 53
1 vote
3 answers
450 views

Fitting line to a staircase function

I have a staircase/step function $n(E)$. I know the points $\{E_i\}$ at which each "step" occurs and all steps are of constant height 1. I need to fit a line $a + bE$ to this function and ...
adch99's user avatar
  • 113
0 votes
2 answers
148 views

Computing infinite series with iterated functions

I found this question (linked here) which asks to find what this infinite series converges to $$ \sum_{n=1}^{\infty} \int_0^{\pi} f_n(x) dx $$ where $f_{n+1}(x) = \sin(f_n(x)) $ and $f_1 = \sin(x)$. ...
Ryan Howe's user avatar
  • 111
-1 votes
1 answer
3k views

Fitting using curve_fit of scipy in python gives totally different answer for 1/t and t

I was trying to fit some data to a single degree exponential decay function but a*exp(-x*t) and a*exp(-x/t) gives completely ...
Ashique Lal's user avatar
4 votes
0 answers
97 views

Pade-like approximation, but force poles to be negative

Are there techniques to form a Pade approximation (or Pade-like approximation), except force the poles of the rational function to be negative? I am trying to use Pade approximations to extrapolate a ...
Nick Alger's user avatar
  • 3,143
2 votes
2 answers
238 views

How to curve-fit the lower envelope of random sequence?

I'm more or less familiar with procedures and methods to fit a curve to experimental data, and I have done this many times using Matlab. However this time I have a problem that I'm not sure how to ...
user37498's user avatar
3 votes
1 answer
524 views

Good languages/packages for interior point optimization with non-linear constraints?

I'm currently using Python's scipy.optimize package to perform parameter estimation for a system of 10 ODEs. I have some observed data, and I'm trying to find the set of parameters which makes the ODE ...
Leonidas's user avatar
  • 153
0 votes
1 answer
368 views

Dealing with arrays and fit function in Gnuplot

I want to evaluate the Birch-Murnaghan Equation of State (BM-EOS) for different volumes. I tried declaring a 1D array A in which every element would be the answer ...
Sufyan's user avatar
  • 111
3 votes
0 answers
58 views

Least-squares fit of explicit parabolic sheet to data points

For a given set of data points $$\{(x_i, y_i, z_i)\}$$ there exists some $$f_{ABC}(x,y)=Ax^2+Bxy+Cy^2$$ that minimizes $$\sum_i(f_{ABC}(x_i,y_i)-z_i)^2$$ $A$, $B$, and $C$ can be found quickly ...
Museful's user avatar
  • 255
0 votes
1 answer
141 views

Fit spline to point cloud with lowest energy

I am looking for a way to fit a spline of order 2 to a 2d image or point cloud. The input will be an gray scale image. The start and end points are given as 2D coordinates. The goal is to find a ...
gtpMurdoc's user avatar
2 votes
0 answers
47 views

Good 3D surface fits for multiscale oscillatory surfaces

I have a 3D surface in $x$, $y$, and $z$. where $z$ is a function of $x$ and $y$ and my points are on a structured grid in $x$ and $y$. My function $z$ is highly oscillatory and irregular with ...
EMP's user avatar
  • 2,079
1 vote
0 answers
44 views

Fitting a multivariate PDE (using Java)

I'm doing simulations of 2 coupled PDE's with Comsol Multiphysics. I want to fit some data (using the Application method, whose language is Java) to those simulations. In order to answer my question ...
J.A's user avatar
  • 171
1 vote
0 answers
18 views

Error on the fit parameters when several good fits exist

I am using the reduced chi-squared statistic to determine the goodness of fit. I run several simulations and determine that a parameter 'p' has a certain range of values that all give values between 0....
Sameeresque's user avatar
3 votes
2 answers
399 views

What is a good library in Python for correlated fits in both the $x$ and $y$ data?

I have $x$ and $y$ data, both of which have their own covariance matrices. scipy.optimize.curve_fit will accept a covariance matrix for the $y$ data, called ...
kηives's user avatar
  • 311
0 votes
0 answers
64 views

Fit exponential convergence

I'm working with a numerical algorithm whose output $y$ asymptotically approaches a certain unknown value $a$. I expect an exponential convergence, i.e. the data $y$ given by my algorithm should be ...
AndreaPaco's user avatar
1 vote
2 answers
352 views

identifying peaks in data

I have data with peaks on some background, for example: The two prominent peaks at ~390 and ~450, as well as the much smaller peak at ~840. What are some options to programmatically find the position ...
0x539's user avatar
  • 111
2 votes
1 answer
272 views

How to check experimental data against a theoretical curve? (Python)

I am trying to check the agreement of a dataset against a theoretical curve, specifically a bandstop filter in an RLC circuit. I have generated a function which describes the curve we expect from the ...
Angus's user avatar
  • 21
1 vote
1 answer
2k views

Gnuplot: How can I determine the maxima of a fit function in gnuplot?

I have a set of data data.txt which can be fit to a Gaussian function, f(x). I want to determine the coordinates of the point of ...
ntk47's user avatar
  • 91
2 votes
1 answer
8k views

Gnuplot: How can I fit a range of points (out of the entire data) to a function?

I have a set of data obtained for the I-V characteristics of an LED. ...
ntk47's user avatar
  • 91
2 votes
2 answers
693 views

What equation should I fit this set of data points to?

I have done an experiment Estimation of silver nitrate by potentiometric titration with standard KCl solution. A plot of $\dfrac{\Delta E}{\Delta V}$ versus Volume of KCl solution gives the ...
ntk47's user avatar
  • 91
0 votes
1 answer
3k views

Numpy.polyfit with regularization

I am trying to use the numpy polyfit method to add regularization to my solution. My non-regularized solution is ...
intergalactic_baba_yaga's user avatar
0 votes
2 answers
66 views

Finding parameters numerically

I suspect that a function $f(x,y)$ is of the form $f(x,y)=a(bx+c)^{dy+e}$. I have access to several values of $f(x,y)$. How do I proceed numerically to find the parameters $\{a,b,c,d,e\}$? By ...
thedude's user avatar
  • 103
1 vote
0 answers
55 views

Fit constant term in LM algorithm

I'm using the Levenberg-Marquardt algorithm to fit my data with a Gaussian function: $$ f(x)=a\cdot e^{-\frac{(x-c)^2}{2\sigma^2}}+f_0 $$ $a$, $c$, $\sigma$ and $f_0$ are the fitting parameters. The ...
GoGoLander's user avatar
1 vote
1 answer
182 views

Least square with rectangular function

I have the function $c(t) = A \cdot \cos \left(\dfrac{2\pi}{\tau} \cdot t + \phi \right) $ which is used to define $ T(t) = \begin{cases} M + c(t), & c(t) > 0 \\ M, &c(t) \leq 0. \end{...
FixedFilip's user avatar
15 votes
3 answers
1k views

Fitting Implicit Surfaces to Oriented Point Sets

I have a question regarding quadric fit to a set of points and corresponding normals (or equivalently, tangents). Fitting quadric surfaces to point data is well explored. Some works are as follows: ...
Tolga Birdal's user avatar
  • 2,229
1 vote
1 answer
664 views

matlab lsqcurvefit parameter estimation journey

The lsqcurvefit solution in matlab converges at different solutions depending upon the initial guess: Surface represents the error (SSE) between model and data at various combinations of parameters ...
Pete's user avatar
  • 13
3 votes
2 answers
217 views

Optimization of known function with respect to two unknown function arguments

I have a data set, composed of points $(x_i, y_i)$ for $i=1,N$. I also have a known function $F$, which maps these points $x_i$ to $y_i$ as such $F(x_i, a(x_i),b(x_i)) = y_i$, where $a(x_i)$ and $b(...
gammapoint's user avatar
0 votes
3 answers
248 views

Choice of solver/software for global optimisation of cheap black-box function with known derivatives

I am trying to estimate a few unknown parameters of my continuous non-linear PDAE model (simulated through finite-volume method spatial discretisation, and time-stepping through method-of-lines). I am ...
Dr Krishnakumar Gopalakrishnan's user avatar
2 votes
4 answers
4k views

Fit best polygon to a discrete contour

I have a discrete contour represented by a set of points. The contour looks like a polygon but if you zoom you see that the edges are rugged (that's because it was obtained while working on a finite ...
Beni Bogosel's user avatar
  • 1,035
4 votes
1 answer
100 views

Post-processing the noisy results of numerical simulation

I have the following curve, which is calculated on a large number of points and shows smooth behaviour when viewed from distance. However, the derivative (shown below) exhibits artificial ...
Maziar Noei's user avatar
1 vote
2 answers
214 views

Finding an enclosing parabola for a set of points

I am looking for an algorithm that fits a parabola to a set of data points. However, no data point may be below the parabola. All points must be above the parabola. Is there an standard algorithm for ...
ManuelAtWork's user avatar
1 vote
1 answer
2k views

Curve fitting for oscillating data

This is my first question. I have the following data that I'd like to approximate as a parametric function: \begin{align} y = a + (bx_1 + cx_2 + dx_3 + ex_1x_2 + fx_1x_3 + gx_2x_3 + hx_1x_2x_3 + i)*(...
user20730's user avatar
5 votes
3 answers
2k views

Fitting with a linear combination of exponentials

I want to elaborate on a statement I read in Acton's "Numerical methods that work", paragraph "Exponential fitting", page 252. Computationally we are being asked to fit only the parameters $A$ and $...
bela83's user avatar
  • 443
2 votes
1 answer
561 views

Pseudo Code for non linear power function fit needed

I am struggling finding pseudo Code for a non-linear fit of the following function: $y = a\, x^b$ Package NLS in R does perform well, but utilizing external software is not practicable in my program ...
Jan Hackenberg's user avatar
1 vote
1 answer
265 views

Fit curve with rectangles

I have a one-dimensional set of points, i.e. $(n,y_n), 1\leq n \leq N$. I want to fit them with a linear combination of $k$ rectangular functions in a least-squared-error sense. Each rectangle is ...
Milind R's user avatar
  • 607