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.
67 questions
0
votes
2
answers
76
views
Surface-fitting
I have grabbed a bunch of points in 3d that define a relatively simple 3d surface (three of them):
I've been trying to figure out how to come up with a function for each (using ...
1
vote
2
answers
95
views
Fitting with spline but adding soft shape constraint
I would like to fit some data points that I know look somehow like a deformed ellipse. I would like to fit them with a spline but also adding something like a soft constraint that it should also look ...
0
votes
0
answers
130
views
Warning in curve_fit "Covariance of the parameters could not be estimated"
While fitting the energy spectrum of cobalt for two distinct peaks I am not getting fit parameters and receiving the warning: warnings.warn('Covariance of the parameters could not be estimated'). I'm ...
0
votes
0
answers
56
views
Is there a reasonably simple solution for nonlinear parameter optimization using c++ objects?
I have a problem under the form of a set of 2 ODE that includes 6 free parameters. I need to optimize these parameters based on experimental results.
So far, basically, I have implemented a C++ object ...
0
votes
2
answers
74
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:
...
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.
...
2
votes
1
answer
190
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 ...
0
votes
0
answers
61
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 ...
0
votes
1
answer
385
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:
...
1
vote
0
answers
21
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. $(...
0
votes
1
answer
122
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 ...
1
vote
1
answer
933
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.
...
0
votes
0
answers
711
views
Curve fitting using a piecewise polynomial
I am trying to fit a piecewise polynomial function
Code:
...
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 ...
1
vote
1
answer
89
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 ...
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{...
-1
votes
1
answer
193
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 ...
1
vote
1
answer
124
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 ...
1
vote
0
answers
225
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)...
5
votes
1
answer
15k
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 ...
1
vote
3
answers
588
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 ...
0
votes
2
answers
153
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)$. ...
-1
votes
1
answer
4k
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 ...
4
votes
0
answers
118
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 ...
2
votes
2
answers
334
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 ...
3
votes
1
answer
577
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 ...
0
votes
1
answer
461
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 ...
3
votes
0
answers
60
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 ...
0
votes
1
answer
152
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 ...
2
votes
0
answers
48
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 ...
1
vote
0
answers
46
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 ...
1
vote
0
answers
20
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....
3
votes
2
answers
470
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 ...
0
votes
0
answers
71
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 ...
1
vote
2
answers
432
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 ...
2
votes
1
answer
314
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 ...
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 ...
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.
...
2
votes
2
answers
709
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 ...
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
...
0
votes
2
answers
68
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 ...
1
vote
0
answers
56
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 ...
1
vote
1
answer
192
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{...
15
votes
3
answers
2k
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:
...
1
vote
1
answer
699
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 ...
3
votes
2
answers
225
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(...
0
votes
3
answers
256
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 ...
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 ...
4
votes
1
answer
102
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 ...
1
vote
2
answers
229
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 ...