Skip to main content

Questions tagged [fitting]

Questions on the use of Mathematica to construct models for approximating empirical data.

Filter by
Sorted by
Tagged with
3 votes
1 answer
360 views

Fourier series using DFT

I am trying a simple example to do a discrete Fourier transform. My goal is to use DFT to find the frequencies that have built the time signal and then to a good approximation, use DFT data to find ...
Ankush Girdhar's user avatar
0 votes
3 answers
88 views

How to plot this data set, ignoring the initial oscillation?

Suppose I have an array given as: ...
user444's user avatar
  • 2,644
0 votes
3 answers
114 views

All composite numbers are crossed by the lines

I'm trying a version of the code with the concavity of the parabola upwards (y=x^2), but I'm not succeeding. I appreciate any help. ...
Rubens Vilhena Fonseca's user avatar
1 vote
2 answers
73 views

How to exclude singularities for `NMinimize`

I have an messy expression and want to apply NMinimize to it, have no idea how to force NMinimize to ignore the singularities it ...
seva011's user avatar
  • 336
1 vote
2 answers
56 views

Find a parameter to return minimum of the function of several variables

I have two functions $f_1(n,x)$ and $f_2(n,x)$, and I want them to look similar on the given range $n\in[1,20]$. I can only vary the parameter $x$. In other words I have a function $F(n,x)=f_1(n,x)-...
seva011's user avatar
  • 336
4 votes
2 answers
113 views

Fitting Eigenvalues of a 8*8 matrix to experimental data

I have an 8x8 matrix which contains some parameters with a certain range. I am trying to fit the eigenvalues of this matrix to my experimental data with the goal of having the best fit extracting the ...
asato's user avatar
  • 41
4 votes
1 answer
178 views

Using mathematica to find the equation of curves, by providing images, providing constraints, or both

By "collaborate", I mean to give some instructions or constraints. Consider the following curves: (as examples, only to illustrate my question in a better way): Curve (I): Assume it is f ...
Hussain-Alqatari's user avatar
0 votes
1 answer
201 views

Fitting a time domain function to frequency domain experimental data

I have an experimental dataset in frequency domain (complex dielectric constant data (K)as a function of frequency of applied signal). I want to fit it with a function, which is (exponential form) in ...
user49535's user avatar
  • 1,225
7 votes
1 answer
109 views

How is the Mathematica command FindGeometricTransformation related to the Kabsch agorithm?

I searched the internet for a Mathematica version of the Kabsch algorithm, using the search terms "Mathematica and Kabsch" nothing came up in. Looking through Mathematica documentation, I ...
complex's user avatar
  • 333
0 votes
1 answer
94 views

NonLinearModelFit with multiple y-values for some x-values

I am fitting to a set of measurements, where for some x-values there are multiple datapoints {{x,y1}, ..., {x,y2}...} from different measurements. Is this a problem for Fitting with NonlinearModelFit? ...
phein1's user avatar
  • 33
1 vote
1 answer
92 views

When using FindFit to fit a large dataset with multiple sine functions, a step size error occur

My dataset looks like datatandA = Import["dataForQuestionFindFit20240528.csv"]; ListPlot[datatandA] and the corresponding FFT spectrum looks like ...
so_sure's user avatar
  • 421
0 votes
0 answers
43 views

Combining model ARIMA and GARCH models

...
VishnuPrasad 's user avatar
4 votes
4 answers
218 views

Is there a way to tell FindShortestTour to avoid backtracking when connecting points to form a closed, but possiblely non-convex, curve?

Among a set of points, I want to find a closed curve. It is not required for the curve to go through all the points, only that the curve goes through as many points as possible. These points are ...
xinxin guo's user avatar
  • 1,401
2 votes
1 answer
95 views

Fitting data to a system of ODE using ParametricNDSolveValue

I am trying to create the following code to fit data to a system of ODE. ...
shewlong's user avatar
0 votes
0 answers
87 views

How to find a fit for the following data?

Consider the following function: ...
John Taylor's user avatar
  • 5,887
0 votes
1 answer
80 views

Using NonlinearModelFit for fitting equation with two variables and 6 or more Parameters

In the original question posted on 23-04-2024, there was a typo in the numbers given in the nested lists: a superscript symbol (^) was missing in the nested list, i.e, it should have been $9.62948*10^{...
sreeraj t's user avatar
  • 303
1 vote
1 answer
67 views

Fitting with Step Function (Beginner question) [duplicate]

I have data as below. ...
rani's user avatar
  • 365
0 votes
2 answers
109 views

NonlinearModelFit extremely slow performance with a single iteration

I have been experiencing very slow performance of NonlinearModelFit. The code that in my case causes that is below. The first part gets the data, the model and ...
atapaka's user avatar
  • 4,006
1 vote
1 answer
46 views

Using NonlinearModelFit output in multiple Plot instances within DynamicModule

I'm creating a script for interactive model fitting where the user selects a 'window' of the data to exclude from the fitting. I can come up with a MWE like the following: ...
BoseEinsteinCondensator's user avatar
5 votes
1 answer
212 views

P-Values For LinearModelFit Changing Due To Ordering Of Features

The arbitrary ordering in a linear model of the independent variables should not impact the p-values for the coefficients of said model. However that is exactly what is happening here ...
Daniel Berkowitz's user avatar
6 votes
1 answer
409 views

Finding an ellipse of minimum area that encloses a set of points

Is there a built-in function or set of functions in Mathematica that can take a set of points in the x-y plane and determine the ellipse of minimum area that contains all of the points? I am sure ...
BioPhysicist's user avatar
  • 1,134
0 votes
0 answers
104 views

Fitting problem for sigmoid like experimental data

I have data like this ...
rani's user avatar
  • 365
6 votes
1 answer
197 views

Curve fitting with Mathematica

I am trying to find de parametric equations of this curve (the curve in that sector of circle): What I've tried: ...
MathLearner's user avatar
-1 votes
1 answer
146 views

Help needed with the fitting and bug

...
random's user avatar
  • 9
3 votes
2 answers
104 views

FindFit or NonlinearModelfit for sinusoidal function

I am trying to fit this data set into a specific sinusoidal equation. The equation is shown like this. ...
JS LEE's user avatar
  • 31
4 votes
4 answers
554 views

Dealing with derivative of noisy experimental data

I have the following (time, position) dataset ...
MOOSE's user avatar
  • 159
1 vote
2 answers
152 views

The best way to guess the needed data using Mathematica?

I have a question, which is not entirely related to Mathematica, and would appreciate any help on this matter. I have the following dataset, which shows the growth of a bacterium in a specific medium: ...
user avatar
3 votes
3 answers
316 views

Why does this simple fit run forever?

The following fit runs forever on my laptop; how to speed up? ...
user avatar
0 votes
1 answer
88 views

Solve constraints don't work properly

So in my previous question, I was trying to find two parameters kV and km for an implicit function using FindFit(FF) command and I did it but the problem is that it takes around an hour to do it. ...
Karen Simonyan's user avatar
1 vote
0 answers
55 views

My sinusoidal fit requires an unused extra constant to work

I am trying to fit a sinusoidal curve onto the following data: ...
Zeke Coady's user avatar
2 votes
2 answers
126 views

Problem related to fitting a damped sine function

When I try to fit an exponential damped sine, it acts as if it cannot reach the amplitude at all. What do I change? link to data: datafile Getting data: ...
hubvoy's user avatar
  • 21
1 vote
2 answers
91 views

How do I fit unknown function to my data?

I have a set of data, to which I am trying to fit an unknown function. I believe it might be a logarithmic function, but I am not sure. Can you help me find a working model? ...
DarnokPL's user avatar
0 votes
0 answers
83 views

How can I approximate a function with composite polynomials?

I know that to approximate a function with for example $f(x) = \sin(x)$ using polynomials with degrees up to 4, I can use the Fit function : ...
何子钦's user avatar
1 vote
1 answer
73 views

How to include Manipulate in fitting?

I'm trying to fit three differential equations to two data sets, using the code developed by @Cesareo, as follows: ...
user avatar
5 votes
2 answers
231 views

How can I use option Weights for fitting?

I have the following dataset (time vs. a quantity called $s$): OPD = {{0, 0.0305}, {3, 0.14}, {6, 0.5}, {17, 4.02}, {19, 5.04}, {21, 5.52}, {24, 5.76}}; To the ...
user avatar
2 votes
1 answer
171 views

How can I fit rational function to data?

I have a dataset written below. I need to find a rational function that best fits this data set. How can I do it using Mathematica? The answer should be: $$f(t)=(2.196t^5+2.27t^4+2.013t^3+0.9592t^2+0....
Pabitra Tripathy's user avatar
2 votes
2 answers
215 views

Find function by solving equations and imposing constraints

Suppose there are two equations: $$2f(x)+x^2g(x)=8 \tag{1},$$ $$ x^3f(x)+6g(x)=18 \tag{2}.$$ I need to solve these two equations and find the functions $f(x)$ and $g(x)$ in terms of $x$ and constants. ...
Pabitra Tripathy's user avatar
0 votes
1 answer
70 views

Fitting Chebyshev to 2D data

I have complex data points on a 2D square (say $[0,10]^2$). I tried the following example function: $xye^{i(x+y)}$. I split up the Re and ...
Confuse-ray30's user avatar
1 vote
1 answer
103 views

Fit a point that defines a 90° angle

I'm trying to come up with a fit that will give me x,y coordinates of a point, that best fit in 2 slopes, the 2 slopes intercepting at 90°. At the moment I fit individually 2 lines to a 2 sets of ...
A postdoc's user avatar
  • 159
3 votes
1 answer
102 views

Fitting a first-order ODE

I want to fit the following equation $\dot{B} ( t ) = \kappa ( 1 - B ( t ) ),$ to the dataset: $\{ ( 1.17, 0.27 ), ( 2, 0.5 ), ( 4, 0.73 ), ( 6, 0.93 ), ( 8, 1 ), ( 10, 0.93 ), ( 20, 0.8 ) \}$, where ...
user avatar
5 votes
0 answers
142 views

What is resistivity function of a 3-bar electric switch?

I answered a question on Physics StackExchange - considered as homework - numerically. The question is: What is the resistance of three stacked identical blocks, the middle bar shifted by its half ...
Roland F's user avatar
  • 3,947
2 votes
1 answer
106 views

How to setup FindFit function so that fitted function fits nicely to data points?

I am trying to fit some data points to a transformed natural log function and transformed 1/x function. However, the fitted 1/x function fails to adhere nicely to the data points when x is growing ...
Johnson's user avatar
  • 379
0 votes
1 answer
52 views

Trouble using Integrate as the model in NonlinearModelFit

I'm trying to fit a set of heat capacity data to the Debye model. This is the sample dataset that I'm using: ...
YohanChad's user avatar
0 votes
1 answer
65 views

Normal Distribution of random plot

I have the following data, ...
a019's user avatar
  • 867
0 votes
0 answers
52 views

I need help with plotting and SVEIAR Code with the Reproduction Number on Mathematica

I need help because everytime I plot it doesn't work. ...
izayafiji's user avatar
3 votes
2 answers
204 views

Meaning of arguments in FittedModels`ParameterEllipsoid

I am trying to figure out what FittedModels`ParameterEllipsoid's parameters mean (I want to construct a filled ellipse) Here is a minimum working example: ...
Craig Carter's user avatar
  • 4,625
0 votes
0 answers
37 views

Use Fitting Parameter from Solve or Nminimize with LinearModelFit

Im Trying to minimize a function by varying parameter "a" with Solve or Nminimize. The Problem is that "a" is dependent on my parameter "R" which is dependent on "a&...
HerbertderGe's user avatar
4 votes
2 answers
287 views

How fit my data to sinus?

I have problem with fit sinus to my date, because this sin is very tiny. This is my code: ...
DarnokPL's user avatar
1 vote
1 answer
352 views

Fitting delay differential equations (DDE)

I have the following differential equations: $$S'(t) = 0.31 S(t) \Big( 1 - \frac{S(t)}{6.19} \Big)- \frac{a}{1 + B(t)} S(t),$$ $$B'(t) = c (1 - B(t)) - d B(t) S(t) - 3 c (1 - B(t - 18)),$$ where $B(t -...
user avatar
0 votes
2 answers
149 views

Chi-square minimization error

I'm trying to fit some data into a model using the standard procedure of minimizing the chi-square function using this code: ...
Syn1110's user avatar
  • 51

1
2 3 4 5
36