Skip to main content

All Questions

Tagged with or
Filter by
Sorted by
Tagged with
33 votes
2 answers
8k views

How to fit 3 data sets to a model of 4 differential equations?

I'm a biologist and a newbie in Mathematica. I want to fit three data sets to a model consisting of four differential equations and 10 parameters. I want to find the parameters best fitting to my ...
Stefanie's user avatar
  • 333
52 votes
5 answers
15k views

Simultaneously fitting multiple datasets

What is the proposed approach if one wants to simultaneously fit multiple functions to multiple datasets with shared parameters? As an example consider the following case: We have to measurements of ...
Markus Roellig's user avatar
58 votes
6 answers
22k views

How to perform a multi-peak fitting?

I am wondering how to implement the multi-peak detecting and fitting in Mathematica. Following is an example of fitting the data using three peaks (such that the data ~ peak1 + peak2 + peak3). The ...
Everett You's user avatar
  • 2,317
43 votes
2 answers
5k views

What are some common issues with fitting functions to data?

Mathematica has numerous functions designed to, or capable of, fitting known functions, and finding unknown functions to match data sets. What are some common issues that come with finding those fits?
Feyre's user avatar
  • 8,667
35 votes
6 answers
19k views

Estimate error on slope of linear regression given data with associated uncertainty

Given a set of data, is it possible to create a linear regression which has a slope error that takes into account the uncertainty of the data? This is for a high school class, and so the normal ...
George S's user avatar
  • 353
28 votes
6 answers
23k views

How to determine the center and radius of a circle given some points in 3D?

I was wondering if anyone could give me a hand with this problem I have. I have six points on a plane, and I am trying to determine if they form a circle or not. I know that any three points in 2D ...
RedPotatoe's user avatar
22 votes
3 answers
5k views

Fitting fractional complex data with NonlinearModelfit

I've difficulites with the NonlinearModelFit function. In principle Mathematica should be able to deal with complex data. E.g. if I define the following table <...
Justus's user avatar
  • 221
50 votes
8 answers
9k views

Fitting points to tilted, off-center ellipse

I have 24 x-y points that are supposed to form an ellipse. ...
khanhnguyendata's user avatar
27 votes
4 answers
6k views

Implementation of smoothing splines function

I have some problems in writing a module for spline smoothing. Actually, I have been trying for about two weeks. My listing is here: ...
jojosthegreat's user avatar
27 votes
6 answers
16k views

Problem with NonlinearModelFit

I'm having trouble with a non-linear fit: fit = NonlinearModelFit[data, y0 + A Sin[\[Pi] (x - xc)/w], {y0, xc, A, w}, x] where ...
a06e's user avatar
  • 11.5k
31 votes
3 answers
5k views

What is the difference between FindFit and NonlinearModelFit

I cannot get the difference between these two fitting functions in Mathematica. I even read in MMA that the result of these two are the same.
MOON's user avatar
  • 3,886
21 votes
5 answers
10k views

Using FindFit to fit $a\,b^t$: how to avoid introducing complex numbers?

I'd like to find a model $f(t)=a\,b^t$ which matches the following data ...
dharmatech's user avatar
31 votes
5 answers
6k views

Mathematica envelope for the bottom of a plot, a generic function

I have the following set-up: xaxis = Table[x, {x, 0, 10, 0.01}]; yaxis = Table [Sin[x] + Abs[RandomReal[{-1, 1}]], {x, 0, 10, 0.01}]; ListLinePlot[Transpose[{ xaxis, yaxis}]] My questions is how can ...
akk's user avatar
  • 1,257
25 votes
1 answer
2k views

Difference between Fitting Algorithms

I am new to Mathematica, and I don´t quite understand, what the difference between the fitting algorithms Fit, FindFit, ...
Luca Thiede's user avatar
9 votes
1 answer
6k views

Combined fitting via NonlinearModelFit

I am trying to fit my data to a combined function model. Say I have two functions with some common parameter(s) f[x_]:= a*x^2 + b*x + c g[x_]:= d*x^2 + e*x + c ...
pablo's user avatar
  • 763
4 votes
1 answer
972 views

how to find curve fitting parameters without an explicit relation between x and y?

Let's say I have some experimental data (x,y) and I want to find some fitting parameters. But in my mathematical model, the fitting parameter are not in a simple equation that relates x and y. For ...
Ahmad A's user avatar
  • 363
20 votes
2 answers
817 views

Adding Regularisation to Built-in Interpolation Function

tl;tr; How to improve performance of regularised Interpolation? Context Since Version 12, Mathematica now incorporates a range of (underrated IMHO) regularisation ...
chris's user avatar
  • 23.1k
18 votes
3 answers
3k views

2D smoothing spline interpolation

Does Mathematica have 2D smoothing spline interpolation built in? I requires an interpolation method with smooth first derivatives and cubic bivariate splines fulfill this nicely. In python I would ...
Ajasja's user avatar
  • 13.8k
15 votes
1 answer
8k views

Methods for NonlinearModelFit

I am using NonlinearModelFit for a thesis project. I get quite different results if I change the Method to LevenbergMarquardt or QuasiNewton or ConjugateGradient ...
Santiago's user avatar
  • 1,201
15 votes
2 answers
2k views

Is it possible to use the LevenbergMarquardt algorithm for fitting a black-box residual function?

I have a black-box multiargument multiparametric function of the type SRD[dataPoint_List,params_List] which accepts experimental data along with the parameters of ...
Alexey Popkov's user avatar
15 votes
1 answer
1k views

Fittting data with combination of an unknown number of Gaussians

I have data that I want to fit with a constant plus a combination of Gaussians, with their actual number being one parameter of the fit (besides the average and the variance of every one of them). ...
psmith's user avatar
  • 815
25 votes
3 answers
2k views

Sensitivity of NonlinearModelFit to model

I have come across a circumstance where NonlinearModelFit is very sensitive to the model used. I am aware that NonlinearModelFit ...
Hugh's user avatar
  • 16.8k
19 votes
3 answers
5k views

How to use FindFit to fit an implicit function?

Now I am trying to fit some data with a implicit model function. Firstly, I tried a toy example. Toy example with input and output ...
lyon's user avatar
  • 191
14 votes
2 answers
1k views

Fit a function to data so that fit is always equal or less than the data

I have a set of measurement data and I try to fit there a function (a Exp[b x] + c Exp[d x] - o). I have two problems: The fit function does not converge nor after ...
Lutscher's user avatar
  • 143
10 votes
1 answer
5k views

Fitting piecewise functions

I have several large data sets which follow the following pattern: A position is measured, a force is applied until a new equilibrium is found. I'd like to find a fit for the position, at least at the ...
Feyre's user avatar
  • 8,667
9 votes
1 answer
8k views

NonlinearModelFit does not find a good fit

I am trying to fit my data to the following function, $$\frac{a b t \left(\log \left(\frac{-a d t+a t-1}{a d t}\right)-2\right)}{4 (a t-1)}-c$$ ...
nitin's user avatar
  • 253
4 votes
2 answers
682 views

Fourier Transform to help guess with NonLinearModelFit

I imported some data in Mathematica which I cleaned a bit. This process went well. I also managed to plot it, and tried to take the Fourier transform of the data and plot it again. I'm not sure if I ...
jenny's user avatar
  • 41
21 votes
2 answers
2k views

FindFit returns Infinity::indet error when data contains {0,0}

Let's consider the following data: data = Table[{q, 2*q^2}, {q, 0, 2}]; and then, do a very simple fitting to this data: ...
P. Fonseca's user avatar
  • 6,715
17 votes
3 answers
5k views

Finding distribution parameters of a gaussian mixture distribution

Short version: how to estimate the parameters of a mixture of multivariate normal distributions (i.e.: Gaussian mixture model)? Long version. I am trying to estimate the parameters of a mixture of ...
Giuseppe Cardone's user avatar
15 votes
1 answer
2k views

How does Mma compute Confidence Intervals?

I am trying to understand how Mma computes the Confidence Intervals after a NonlinearModelFit. Consider the following example: ...
Sos's user avatar
  • 2,188
13 votes
2 answers
2k views

Detecting an ellipse in a glaucoma photo

For glaucoma diagnosis it is common to determine a "cup to disk ratio" which compares the diameter of the optic disk (VDD) and optic cup (VCD). The optical disk is visible as a circular red feature (...
indra ginanjar A.T's user avatar
10 votes
1 answer
2k views

ODE fitting to dataset

So, I have a ODE system, it is a complex biochemical kinetic mechanism with six species changing over time. ...
BlueOysterCult's user avatar
8 votes
1 answer
3k views

Find a Fourier series from discrete data

I am trying to fit a Fourier cosine series to discrete data. I read through this, but I was not able to understand it. The data should be periodic with a period of $0.2 \text{ m}$, and it is the ...
daniel17027's user avatar
8 votes
3 answers
2k views

Removing background from peak function

Let's say I have a a very large list of data in the format {{n,f[n]}} so something like {{1,600},{2,700},{3,1100}...} and if this data is plotted, then it will look like a sum of Gaussian functions+a ...
minusatwelfth's user avatar
6 votes
3 answers
968 views

Multi-peak fitting for peak position

I have a {x,f} data-set featuring multiple peaks. The peaks evolve with a second variable y. I would like to fit the multiple ...
sole's user avatar
  • 81
6 votes
1 answer
2k views

Finding NonlinearModelFit of multiple data sets with the same parameters and in two dimensions

I have multiple sets of data (between 3 and 6 depending on the cases) dependent of space, time, and some parameters. The data are the response of a harmonic oscillator under a non-trigonometrical ...
maythemoonshine's user avatar
5 votes
3 answers
4k views

Fitting data to a circle with FindFit

I'm currently trying to use the Mathematica's FindFit command to fit a curve of some data to the bottom half of a circle. The data is of the form ...
T-Ray's user avatar
  • 321
5 votes
2 answers
2k views

Mathematica Interpolation or approximation

I have lists of points X and Y. {1212,1216,1217,1219...}, {1,2,3,4,5,6...} I combine ...
ZeroVash's user avatar
  • 161
5 votes
3 answers
715 views

Determing two Nonlinear model fits with 95% confidence bands from one data set

I have the following data which is postulated to have contributions from two different sources .....as can be seen from the confidence band, many points are out of the band. Question: How can I ...
thils's user avatar
  • 3,268
4 votes
3 answers
797 views

Applying an exponential decay fit with uncertainties

I have some data from a radioactive decay experiment that I'm trying to fit an exponential decay curve on that will take account of the uncertainties on the data, and then ideally return the data for ...
Epideme's user avatar
  • 505
1 vote
1 answer
262 views

NonLinearFit with data

i've data looking like this: ListPlot[data] Now I want to make a NonLinearFit ...
dnrhead's user avatar
  • 13
26 votes
4 answers
2k views

Generating an "average curve" from a dense set of "semicontinuous curves" which clear trends

This question is related to a previous one of mine: Partitioning a superset of coordinates into subsets that generate continuous curves, where the challenge was to partition a data set into two ...
Sparse Pine's user avatar
  • 1,133
20 votes
1 answer
3k views

Finding the area, algebraic curve and jaggedness of an arbitrary shape

I start with a photograph of a shape (physically made by the flow of a liquid into another), of which I can extract the border, manually or using Mathematica's feature detect feature : Using the ...
William Briand's user avatar
18 votes
4 answers
27k views

Fitting a two-dimensional Gaussian to a set of 2D pixels

Imagine I have a set of data like the following: ...
Bob's user avatar
  • 761
15 votes
2 answers
3k views

Does FindFit support complex numbers or doesn't it?

Inspired by this previous question: Findfit doesn't give the good fit; Changing the starting values will not change the results. Consider the following complex-valued dataset. ...
user avatar
15 votes
4 answers
929 views

How to split data into clusters based on fitting to function

I have data which looks somewhat like this: On the picture, you can see that the data can be described by 2 linear functions - if you manage to split it into 2 groups, each can easily be fitted with <...
Arsen Zahray's user avatar
9 votes
1 answer
4k views

Test Goodness of fit for FindFit

Is there any way to get an estimate of the goodness of fit from FindFit, for instance getting the final error? The documentation doesn't provide any hints, and a quick Google search didn't return any ...
Wolfy's user avatar
  • 369
7 votes
1 answer
1k views

Findfit does not find the best fit

I am working on a project that needs curve fitting. The experimental data should be fitted with a model that calculated with an integration equation. At first, I enter my experimental data ...
Mirzaie.rz's user avatar
7 votes
5 answers
8k views

How to plot Fit functions?

If I do something like this f[x_]:=x^2 Plot[f[x],{x,1,10}] Mathematica plots the function $f(x)=x^2$, as expected. However, ...
Jonathan Gleason's user avatar
7 votes
1 answer
502 views

How to derive SinglePredictionBands from a NonlinearModelFit model

I have found NonlinearModelFit to be extremely useful in my work. Here I have fit 4 points to a function and am being asked to explain how the 95% SinglePredictionBands associated with the plot below ...
Steve's user avatar
  • 1,417

1
2 3 4 5
7