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
0 answers
8 views

Linear fitting of the data passing through origin on xmgrace

As far as I know, the linear fitting on xmgrace does the fitting of the data with the straight line of the form : y = mx +c, but is there any way I can fit the data with the straight line of the form: ...
user avatar
0 votes
0 answers
38 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{...
user avatar
-1 votes
1 answer
52 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 ...
user avatar
1 vote
1 answer
83 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 ...
user avatar
  • 89
1 vote
0 answers
96 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)...
user avatar
  • 33
4 votes
1 answer
3k 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 ...
user avatar
  • 43
1 vote
3 answers
149 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 ...
user avatar
  • 13
0 votes
2 answers
139 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)$. ...
user avatar
  • 111
-1 votes
1 answer
712 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 ...
user avatar
4 votes
0 answers
62 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 ...
user avatar
  • 3,013
2 votes
0 answers
83 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 ...
user avatar
3 votes
1 answer
316 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 ...
user avatar
  • 143
0 votes
1 answer
186 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 ...
user avatar
  • 111
3 votes
0 answers
55 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 ...
user avatar
  • 255
0 votes
1 answer
94 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 ...
user avatar
2 votes
0 answers
44 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 ...
user avatar
  • 1,902
1 vote
0 answers
38 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 ...
user avatar
  • 171
1 vote
0 answers
15 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....
user avatar
3 votes
2 answers
276 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 ...
user avatar
  • 311
0 votes
0 answers
47 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 ...
user avatar
1 vote
2 answers
214 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 ...
user avatar
  • 111
2 votes
1 answer
172 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 ...
user avatar
  • 21
1 vote
1 answer
1k 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 ...
user avatar
  • 61
1 vote
1 answer
5k 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. ...
user avatar
  • 61
2 votes
2 answers
579 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 ...
user avatar
  • 61
0 votes
1 answer
2k 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 ...
user avatar
0 votes
2 answers
63 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 ...
user avatar
  • 103
1 vote
0 answers
51 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 ...
user avatar
1 vote
1 answer
159 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{...
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: ...
user avatar
  • 2,139
1 vote
1 answer
584 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 ...
user avatar
  • 13
3 votes
2 answers
205 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(...
user avatar
0 votes
3 answers
212 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 ...
user avatar
2 votes
4 answers
3k 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 ...
user avatar
4 votes
1 answer
96 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 ...
user avatar
1 vote
2 answers
166 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 ...
user avatar
1 vote
1 answer
1k 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)*(...
user avatar
5 votes
3 answers
1k 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 $...
user avatar
  • 433
2 votes
1 answer
529 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 ...
user avatar
1 vote
1 answer
193 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 ...
user avatar
  • 607
4 votes
1 answer
207 views

Question on speed and accuracy comparisons of different 2D curve fitting methods

This may be a trivial question, and I apologize if so. Consider the following simple problem: We have a 2D, regular grid of points (say $X = [0,5000] \times [0,5000]$) spaced uniformly by units of 1 (...
user avatar
  • 223
7 votes
1 answer
713 views

Problems Implementing the Remez Algorithm

So first off: *** This code is not being used in production software. It is a personal project of mine, trying to understand approximation theory and advanced curve fitting. In other words, I'm ...
user avatar
2 votes
0 answers
53 views

Inverted value is not consistent with expectation

We have a group of observations $$y = f(x_1, x_2, x_3) \enspace .$$ We have also a forward model $y = f(x_1, x_2)$. The forward model does not include $x_3$ because $x_3$ might include dozens of ...
user avatar
0 votes
0 answers
145 views

1D fit on a surface in matlab

I have a problem fitting a $N\times N$ ($32\times 32$ in this case) matrix in Matlab. Here is the deal I have this image, and I want to create 1 dimensional fit between the points and then be able ...
user avatar
  • 9
1 vote
1 answer
266 views

Curve Fitting problem MATLAB

I have a system of differential equations with some unknown parameters and I need to find the optimal parameter set that fits best with the data I have. For each parameter set choice (using for loops)...
user avatar
  • 47
0 votes
1 answer
612 views

Power series regression linear fit in VBA excel

I wrote a program that calculates the best fit in VBA excel for the following model $$ y_k=c_1x_k+c_0+c_{-1}(x_k)^{-1} $$ solving for the best fit parameters $c_1$, $c_0$, and $c_{-1}$. However I ...
user avatar
1 vote
0 answers
116 views

How to curve fit an unknown function?

I have data which can be described by $y=f(x,z)$ where $z$ varies from 170 ~ 154. Now values given by $ks$ are known sample values that equals value given in the table header, $uks$ are unknown ...
user avatar
  • 119
1 vote
1 answer
209 views

Conceptual question about fitting of scattered data

What are the problems that arise when fitting (2D or 3D) a set of scattered data? (non uniformly distributed) I had some data I had to fit and I solved the problem using the ...
user avatar
  • 382
1 vote
0 answers
2k views

Piecewise linear approximation of an experimental data curve. Knots position constrained

I need to fit a curve, obtained from experimental data, with a piecewise linear model (4 knots and therefore 3 lines). I tried using the MATLAB function ...
user avatar
  • 382
2 votes
1 answer
278 views

How to connect two fitted B-spline curve?

I use B-spline curve fitting to obtain one smooth curve. If I obtain two smooth B-spline , how can I connect then smoothly. For example, I have 59 points((x0,y0,z0),...,(x58, y58, z58)) and I have two ...
user avatar