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
0 votes
0 answers
24 views

How to interpret the output of DimensionReduce

In the documentation for DimensionReduce and functions related to it, there is an example in the Applications section where the Fisher iris dataset from ExampleData is reduced. The data is described ...
BioPhysicist's user avatar
  • 1,146
0 votes
0 answers
103 views
+50

Fastest way of removing outliers from a data set which depends on a variable

Edit: I meant $j\to\infty$... Suppose we have the following code: ...
Arbuja's user avatar
  • 57
5 votes
4 answers
320 views
+50

Finding the asymptotic rate of growth of a table of values

Suppose we define entropy[k] where: ...
Arbuja's user avatar
  • 57
0 votes
0 answers
45 views

Inbuilt function in NonlinearModelFit

Can you please tell me about the inbuilt function in NonlinearModelFit? Is it related to least-square fit? If yes, please describe. ...
Bakul's user avatar
  • 1
0 votes
1 answer
39 views

Use of ports on basic machine learning regression

I have this simple code to do a regression on a list of points very close to a parabole. It is purely anecdotal that I happen to know the exact underlying trend, the idea is just to have simple/nice ...
Ruth Lazkoz's user avatar
1 vote
1 answer
103 views

NonLinearModelFit giving unidentifiable error message

So I am relatively new at fitting data on Mathematica, but I am currently trying to do a Nonlinear model fitting to the data below, but it keeps giving me the error "...
Dave2627's user avatar
0 votes
0 answers
39 views

How to fit with constraints?

I have a curve defined by sp(r) with r in [0,1], and I would like to fit a degree 6 polynomial pol(r) to this curve under specific constraints. The fitting polynomial must satisfy the following ...
TheFyziker's user avatar
0 votes
2 answers
64 views

How to form a discrete function using table data

I have table with three column given as $a$, $\alpha_\min$ and $\chi^2$ value respectively. Now a need a function such that we define a function $\alpha_\min$[a_ ], which will order the data table ...
Amnish's user avatar
  • 57
0 votes
1 answer
85 views

Elegant way with minimal redundancy for handling function parameters and starting values when plotting and fitting

The following code shows how I handle making up a function, finding starting values, fitting and plotting. You see that handling the parameter names, starting values, plotting values is highly ...
DrSvanHay's user avatar
  • 167
5 votes
2 answers
203 views

How to plot confidence band for Weibull linear fitting?

I have a reliability dataset and want to plot using linear fitting by assuming Weibull distribution. ...
metroidman's user avatar
  • 1,003
3 votes
1 answer
384 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
93 views

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

Suppose I have an array given as: ...
user444's user avatar
  • 2,688
0 votes
3 answers
120 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
75 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
  • 346
1 vote
2 answers
58 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
  • 346
4 votes
2 answers
126 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
181 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
202 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
113 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
96 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
93 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
  • 451
0 votes
0 answers
48 views

Combining model ARIMA and GARCH models

...
VishnuPrasad 's user avatar
4 votes
4 answers
220 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,467
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,927
0 votes
1 answer
83 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
70 views

Fitting with Step Function (Beginner question) [duplicate]

I have data as below. ...
rani's user avatar
  • 377
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,016
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
213 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
414 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,146
0 votes
0 answers
105 views

Fitting problem for sigmoid like experimental data

I have data like this ...
rani's user avatar
  • 377
6 votes
1 answer
201 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
105 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
558 views

Dealing with derivative of noisy experimental data

I have the following (time, position) dataset ...
MOOSE's user avatar
  • 159
1 vote
2 answers
157 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
2 answers
123 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
57 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
131 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
93 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
84 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
74 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
234 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
183 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
216 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
73 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
103 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

1
2 3 4 5
36