Questions tagged [fitting]
Questions on the use of Mathematica to construct models for approximating empirical data.
1,406
questions
0
votes
1answer
43 views
Fitting 3D data with a nonlinear model
I am trying to fit a model to an intensity map to extract three values for the parameters of my model $J_x, J_y, J_z$. Currently, I am running into the issue where I can extract values for these three ...
1
vote
0answers
46 views
How can I minimize a target function that has to solve differential equations numerically?
My problem is to minimize a target function with differential equations in it.
The target function is
$$\min \mathrm{J}\left( p \right) =\sum_{i=1}^5{|x_i\left( p \right) -y_i|},$$
where $x_i(p)$ are ...
0
votes
0answers
21 views
How to optimize variables in a function to minimize its difference with the desired behaviour function
So lets say I have a function f(x,y,z,b) and a function g(x) that represents the desired behaviour of function f. How do I optimize the variables y,z,b in function f to get as close as possible to ...
17
votes
3answers
4k 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 ...
0
votes
1answer
52 views
Fit and Data in (1/x,-Log[y])-Scale
I have data as a list of xy-pairs, but have to plot it in {1/(x), -Log[y]} space. I am also making a fit to the data, so I used the raw data for my fit and I used <...
0
votes
1answer
44 views
Regression of a set of (2-element) vectors on another set of (2-element) vectors
As a trivial example, here are two vectors:
f = {{1, 1}, {2, 2}, {3, 3}, {4, 4}}
s = {{-1, 2}, {-2, 4}, {-3, 6}, {-4, 8}}
It is instantly clear (apart from my ...
5
votes
2answers
400 views
Non Linear Model Fit - Fitting ODE to Data
Thank you everyone for your meaningful contributions!
My Goal and Problem
I'm trying to fit a particular ODE in a set of ODE's to experimental data. I've attempted to implement this by following the ...
2
votes
2answers
121 views
2
votes
0answers
67 views
ProbitModelFit is causing kernel crashes in Mathematica 12.0
Mathematica 12.0
I am running ProbitModelFit on a small data set (~130 rows). Intermittently, the function causes a kernel crash. I am curious if anyone else is ...
1
vote
4answers
158 views
3
votes
1answer
155 views
(Non)LinearModelFit hangs on “trivial” linear fit (Fit succeeds)
A simplified version of my function and a simplified subset of my data (real data also has weights, if that matters, but I tested both with and without those):
...
0
votes
1answer
83 views
0
votes
1answer
34 views
finding FWHM of a dataset with unknown mathematical equation
I have a dataset. I have plotted using "Listloglinearplot". Now I need to find the FWHM (full width half maxima) of the same, However I dont know which mathematical eqution describes best to ...
6
votes
1answer
538 views
Chemical Kinetics: fitting multiple sets of time series data using multiple differential reaction equations
Let me start by saying that this is my first post, so if there are suggestions on proper formatting that is annoying you, please let fly and I will do my best to modify.
I was doing well solving the ...
0
votes
1answer
40 views
Find Fit error 4P logistic
I am trying to fit a four parameter logistic curve to my data set. I have the estimated values for each coefficint, but it says the jacobian is not a matrix...
Here is my data:
...
2
votes
0answers
42 views
Matrix regularization, how to pick $\lambda$
Since v12 FindFit[] now supports regularisation, such as Tikhonov regularization. Do there exist statistics to help guide the choice of the hyper-parameter $\...
1
vote
1answer
61 views
Gaussian fit with asymmetric background
I have to fit this peak (which seems to be a double gaussian from other experiments) to find the peak position of the one at around 2.43 eV.
...
1
vote
1answer
64 views
1
vote
1answer
48 views
How to list the answer of Fitting Parameter?
I want to ask how to list the fitting parameter, using "Find Fit"?
I have data such as,
...
40
votes
2answers
4k 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?
1
vote
2answers
102 views
9
votes
5answers
2k views
Can one force a linear regression fit to go through an arbitrary point?
I have some data. I want to find the linear regression of the data, but force it to include a certain point. (This question is a corollary to this old question; in that question, the user wished to ...
3
votes
2answers
133 views
Complex Data Fitting
I have a complex data set and I want to fit with a mathematical model using NonlinearModelFit, but an error appears. Following is the data I'm using and the code ...
1
vote
1answer
61 views
How to test if NonlinearModelFit parameters are different from each other
I'm using NonlinearModelFit to fit 5 parameters to some data points and the "ParameterConfidenceIntervalTable" gives ...
18
votes
1answer
817 views
PenaltyFunction Option in NMinimize
I am curious if anybody has some experience in using the built-in Option "PenaltyFunction" in any of the numerical optimization functions like ...
4
votes
3answers
318 views
Image integration along a pathline
I have an image, and two points coordinates (x1,y1)/(x2,y2).
I have two questions :
1- I want to know the intensity value of all pixels lying in a line between these two points (my end goal will be ...
2
votes
2answers
113 views
Detrending or removing linear trend from 2D data
I have some data that when plotted I get an inclined graph, as described:
...
3
votes
1answer
133 views
Problem with fitting a given data with an equation
I want to fit a given data using the approach developed by @Bob Hanlon here: Fit and find fitting parameters of data given an equation
I have tried this approach for several different data sets but I ...
1
vote
2answers
60 views
1
vote
1answer
78 views
Fitting an integral function given a set of data points
I have a set of measures of the resistivity of a given material at different thicknesses and I'm trying to fit them using the Fuchs-Sondheimer model. My code is:
...
0
votes
1answer
43 views
22
votes
2answers
1k views
Curve fitting by running through hundreds of models and return the one with best fit
In the past, I used to solve a lot of my regression analysis (curve fitting) problems with a program called DataFit which runs on Windows. It has hundreds of regression models which it runs through in ...
0
votes
1answer
283 views
Convolve and fitting
I want to convolve two equation, then I want to find the parameters. But it doesn't give the answer and Takes too much time. What is the wrong with my code?
...
2
votes
1answer
122 views
how can draw a scatter plot with a regression line across regions using Manipulate[…]
I have the following code:
...
2
votes
2answers
79 views
Estimating the uncertainty in the slope of a straight line with no associated uncertainty
I am just starting out with mathematica and cannot for the life of me find how to find the uncertainty in a slope. I am attempting to find the exponent in a logarithmic relationship between two ...
0
votes
1answer
49 views
LinearModelFit to find more than one linear regression line [closed]
I have a data that I used LinearModelFit, to find the linear regression line. How can I get more than one linearmodelfit for the same data? more specifically I ...
5
votes
2answers
322 views
Weird result of fitting a 2D Gauss to data
I wanted to fit a 2D Gaussian function
$$f(x,y) = \frac{1}{2 \pi \sigma^2} \exp \left(-\frac{(x-\mu_1)^2 + (y-\mu_2)^2}{2\sigma^2}\right),$$
to a set of points prepared from an image file (triplets $\{...
4
votes
4answers
202 views
Fitting for constants
I have this differential equation: $$m\ddot x=-kx^\frac{3}{2}-c\dot x-mg$$ where I want to fit for $k$, $c$. ($g$ is 9.81 and $m$ is 0.3).
This is a model for collision, hence in the data that we have ...
12
votes
3answers
3k views
Multinomial logistic regression
Has anyone done multinomial logistic regression in Mathematica?
The binomial case is essentially done on the LogitModelFit documentation page and works fine.
I am ...
1
vote
0answers
110 views
Find coefficients of a periodic function with non-linear fit [closed]
Description of the problem:
I'm studying a signal that is the sum of two exponentials at two different frequencies:
$z(n) = A_1*e^{2\pi i\nu_1n } + A_2*e^{2\pi i\nu_2 n } + noise$
The signal itself is ...
2
votes
1answer
350 views
Problem creating MeanPredictionBands
I have a problem creating MeanPredictionBands for my function which I fitted using NonlinearModelFit. I have a complex-valued ...
0
votes
0answers
25 views
Linear regression, numerical integration and non-specific fitting
I am still pretty new to Mathematica.
I am numerically integrating a function that we can consider as
NIntegrate[f[z] g[z], {z, 0, 1}] so that, when I put in what I ...
0
votes
0answers
35 views
Confidence Interval Table
I estimated parameters using a transcendental function in the model. The estimate worked using the following commands:
...
2
votes
1answer
162 views
Fitting model to data
I have been trying to adapt some of the previous suggestions on other questions similar to my problem but I haven“t been able to solve my problem so far.
Best wishes
5
votes
2answers
995 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 ...
5
votes
3answers
575 views
10
votes
1answer
213 views
Finding astroids
An astroid is a particular mathematical curve: a hypocycloid with four cusps.
Given a lot of data points I'm trying to fit such a curve to the data.
As an astroid is also an algebraic curve of grade 6 ...
16
votes
3answers
1k views
Does anyone have experience with performing symbolic regression using Mathematica?
I understand that there is at least one Mathematica package, DataModeler commercially available for symbolic regression. I'm seeking any observations with this or any other similar tool.
I'm ...
2
votes
2answers
148 views
Subtract peaks from curve
If I have the following data:
https://pastebin.com/2jgDw4iQ
which plotted using the following code
...
4
votes
3answers
147 views