Questions tagged [fitting]

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

Filter by
Sorted by
Tagged with
4
votes
2answers
284 views

Polynomial fitting to obtain the growth rate

We -- my friend -- had asked a question here, which was not completely related to Mathematica, however, in a hope that someone familiar with the topic could help. There are still some aspects which we ...
4
votes
0answers
70 views

CirclePoints and CircleThrough

$Version 12.2.0 for Microsoft Windows (64-bit) (December 12, 2020) For points (located on a unit circle), ...
0
votes
0answers
60 views

FindSequenceFunction with very small numbers

I need some help with FindSequenceFunction because at the moment it seems like a black box to me. For example, it deals with ...
0
votes
0answers
42 views

How to solve complex least squares with real unknowns

I am looking at the case where my least squares problem is of the form $ y=A x $ where y is a vector of measured complex values, A is the model or design matrix, also complex, and x are the model ...
0
votes
1answer
62 views

data fitting with fitting parameter depends on x axis data

I am stucking in fitting a dataset. I have an experimental dataset which I want to model to extract some parameters, But unable to do it. Here is my dataset: ...
1
vote
1answer
82 views

Nonlinear model fit gaussian precision

I wanted to fit double gaussian but it doesn't work, it doesn't fit gaussian. The error I get: Data:data Here is code ...
0
votes
0answers
36 views

Fitting coupled ODEs on data

I'm learning how to fit a system of two ODEs to data. The dataset is in the form dataset=Transpose[{time,datax,datay}] {{0.,0.,0.},{0.1,0.283791,0.0949328},...} ...
0
votes
2answers
27 views

How to turn FindFit result into function within a Module context

I'm trying to construct a 'normal' function (with formal parameter) from the FindFit result within a Module context. While this works on a global level: In := ...
2
votes
1answer
46 views

Ensure `NonlinearModelFit` goes to $1$ [closed]

...
0
votes
0answers
58 views

How can I force NonlinearModelFit to converge for a complicated fit function if I have good initial estimates?

I am trying to fit a fairly complicated numerical function that is made up of matrix operations and recursive functions, so it does not have a nice closed form. I have narrowed down a workable range ...
0
votes
1answer
55 views

Thermal conductivity fitting using Callaway model

I want to fit the thermal conductivity of silicon at different temperatures using Callaway model, which can be expressed as: where vB is the speed of sound, wD is the Debye frequency. They are known ...
3
votes
1answer
69 views

How to find a logarithmic function as a fit to my data?

My data is: d = {{0, 3.889}, {0.04, 3.941}, {0.06, 5.036}, {0.08, 12.589}, {0.1, 16.972}, {0.2, 13.200}, {0.4, 12.063}}; I need to fit a function as: $\log_b a + \...
0
votes
1answer
55 views

Two gaussian and linear curves

I wanted to fit two gaussian and linear curves, I tried to use nonlinear model fit, but I'm making somewhere a mistake. I know that one gaussian curve can be fitted as ...
1
vote
1answer
66 views

How to add weights in fitting?

I have a set of data as: data = {{0, 0.046}, {40, 0.111}, {80, 0.291}, {120, 0.808}, {160, 1.742}, {200, 3.319}, {240, 5.017}, {280, 5.503}, {320, 5.897}} With ...
4
votes
1answer
212 views

Fit: Experimental`NumericalFunction error when fitting a black-box function

Bug appearing in at least 12.0.0 and 12.3.1 I'm trying some multidimensional Chebyshev fits. First, define a wrapper to prevent premature symbolic evaluation (I don't want a power series result): <...
0
votes
0answers
31 views

How to compute the unbiased fit variance considering the option "Weights" in "NonlinearModelFit"

I am doing a non linear model fit. I know how the fit variance is computed when I do NOT assign weights to the fit, for example: ...
3
votes
1answer
82 views

How does Mathematica compute the covariance matrix using "MultiNonlinearModelFit"?

I am doing a simple multi-non linear fit. I get the covariance matrix. Does anyone know how Mathematica calculate this Matrix? I have found the computation when mathematica fit only one signal but ...
2
votes
3answers
152 views

nonlinearfitmodel, 3 parameters, max iterations = 10 million still not converging

I am trying to fit a set of data to the expression to population in the excited state in a Rabi oscillation problem. I am given # of states in ground and excited state, as well as detuning. I convert ...
0
votes
0answers
58 views

Bayesian Linear regression (Ill-posed problem)

I want to use the ResourceFunction["BayesianLinearRegression"] from Wolfram function repository. With this function I want to solve the ill-posed problem $...
0
votes
2answers
80 views

How to fit a skewed normal to the data and obtain the corresponding parameters? [closed]

I have: data = {0.00677966, 0.0677966, 0.335593, 0.308475, 0.213559, 0.0440678, 0.0237288} Although, the normal fit to the data is not bad: ...
2
votes
2answers
98 views

Graph of points with unknown function - How to curve fit it?

So I'm in my physics lab trying to graph these points: ...
5
votes
1answer
95 views

Is MeanPredictionBands synonymous with a confidence interval in Mathematica?

I am a little confused by Mathematica's use of the term prediction interval in NonlinearModelFit. We are given two kinds of prediction bands as an option: ...
0
votes
0answers
35 views

How to plot linear fits with a specific range from imported data?

So I imported multiple data points starting off from data1 to data11. I have them configured onto a graph, but I also have to find the line of best fit for each. I need to find the line of best fit ...
2
votes
1answer
67 views

select the right numbers based on a condition

I want to optimize my stock portfolio based on three components: the price of the different stocks the number to buy of each of the stocks the expected return of each stock (after 12 months) For ...
0
votes
0answers
40 views

NMinimize with elimination returns strange results

I have a parameter vectors pars, par1, and a matrix data1 together with a vector result <...
0
votes
0answers
42 views

NonlinearModelFit gives weird result

I was trying to fit some data similar to sine, but always get weird results. So I searched and found this post. Surprisingly, I can not reproduce the result. With below code ...
5
votes
1answer
187 views

A little complex data fitting in physics which my easy code can't solve properly

This is a data fitting in physics, however, some errors may estimate and cause failure. First, I define: ...
1
vote
0answers
74 views

Fail to inverse the Piecewise function embedded in a NDSolveValue

I am trying to estimate a function consisting of a Piecewise function that included in a FEM solver. I firstly developed my mesh for the FEM model based on @Tim Laska's work. The code is shown as <...
3
votes
1answer
79 views

Precision Lost for Simultaneous NonLinearModelFit

I am having trouble with the below code. I have two data sets, dataf and datag, which are exponential decays. datag decays faster than dataf. These two data sets are then later joined to make datah. I ...
0
votes
1answer
42 views

Plot SinglePredictionBands associated with a FittedModel (e.g. LinearModelFit) that is supplied as a variable

I am puzzled about how to plot the SinglePredictionBands associated with a FittedModel (e.g. ...
0
votes
1answer
68 views

Nonlinear Model Fitting to Numerical Data with automatic elimination

I have an experimental data set {f,x,y,z} as {{300., 2., 4., 6.}, {500., 0., 4., 25.}, {6600., 1., 15., 9.}, {100., 5., 0., 2.}, {1100., 10., 8., 1.}, {1300., 7., 8., 18.}, {300., 23., 5., 0.}, {400....
0
votes
0answers
63 views

Fit experimental data to find unknown parameter in system of ODE

I have a system of ode including 3 diff equation. I found two parameters Tcell and CD19 by experiment over time. Here is my dataset: ...
0
votes
0answers
53 views

Fitting the parameters of an SIR model

So I'd like to use Mathematica to fit the values of this SIR model. I don't know what function to use to find the best fit for S I and R by tuning b and k, the two parameters. I suppose I only really ...
0
votes
1answer
85 views

Why this nonlinear fitting doesn't work?

I have the following data ...
1
vote
2answers
108 views

Using transcendental equations with NonlinearModelFit

I'm trying to fit data($I$ vs $d$) to expressions like:$$ I(d) = \frac{0.013 d^2 \sin^2(\sqrt{1+\frac{0.013 d^2}{\Omega^2}} \Omega)}{1+\frac{0.013 d^2}{\Omega^2} \Omega^2}, $$ where, $\Omega$ is ...
6
votes
2answers
341 views

FindFit problem in "Debye temperature" fitting

I am fitting the Debye temperature using FindFit, here is my code: ...
1
vote
2answers
226 views

Any suggestions for improving my fitting?

This is not a completely Mathematica question, but I hope people who are familiar both with Mathematica and statistics could help me on this. I have a set of data as ...
0
votes
1answer
92 views

Estimating parameters of a custom or constrained distribution

I am trying to estimate the parameters of a custom distribution (an approximation of the skew normal), but I can't get Mathematica to use DistributionFitTest, EstimatedDistribution, or ...
1
vote
0answers
55 views

Fixed-Effects Model in Mathematica

I need to fit a model with fixed effects (country and time) to adress the multivariate relation between a dependent variable for 22 countries over 8 years and two independents with the same dimensions....
1
vote
1answer
167 views

How to find appropriate surface fit?

I have 3d scan data (21 x 21 matrix), which is pretty rough, for which I need to find a smooth surface suitable for use outside Mathematica. Here's my data: ...
1
vote
3answers
101 views

ComplexFit fits only part of fit parameters

I'm trying to fit experimental complex data with model: model = s/(1-I*t*fr) In the model I want to find real-valued parameters ...
1
vote
3answers
48 views
0
votes
0answers
72 views

How to fit an interference pattern with Interpolation and FindFit?

I have two sets of experimental data. LightSourceSpectrum2.txt InterferencePattern2.txt The first one is the light source spectrum data, which can become a function of f[ν] using Interpolation. (Note ...
1
vote
1answer
112 views

Fitting data to a model

I am using the following code with the following data (which I called fn): data (fn) here: https://pastebin.com/WwANBjNx ...
4
votes
4answers
609 views

Symbolic Regression

7+ years ago I posted a question here regarding symbolic regression in Mathematica. At that time there did not seem to be much built-in support for this. I'm interested in multi-input models of the ...
2
votes
0answers
81 views

How to perform feature selection for machine learning applications?

Feature selection is fairly easy in e.g. Python's scikit-learn which sports a module and tutorials or MATLAB. Mathematica even touts that it uses feature selection ...
0
votes
0answers
29 views

General::munfl - Precision lost in LinearModelFit

I am new to mathematica so I am confused regarding the loss of precision in LinearModelFit. In building a linear model with uora (1 or 2) and encodeSeverity (1,2 or 3) ...
0
votes
2answers
92 views

How to find a fit for numerical data?

I would like to know how to fit a numerical data in two different ways. The first one is ...
8
votes
1answer
397 views

Improving fit by adding weights

I have the data: data0 = {{0, 0.047}, {40, 0.071}, {80, 0.103}, {120, 0.169}, {160, 0.292}, {200, 0.498}, {240, 0.777}, {280, 1.000}, {320, 1.227}}; I want to fit ...
1
vote
1answer
136 views

Cubic spline fitting

If I have the following data: ...

1
2 3 4 5
31