Questions tagged [fitting]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
32 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
36 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
171 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: ...
0
votes
0answers
42 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
73 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
32 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
64 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
51 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
51 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
80 views

Why this nonlinear fitting doesn't work?

I have the following data ...
1
vote
2answers
102 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
325 views

FindFit problem in "Debye temperature" fitting

I am fitting the Debye temperature using FindFit, here is my code: ...
1
vote
2answers
154 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
87 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
53 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
157 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
94 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
45 views
0
votes
0answers
67 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
109 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
564 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
64 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
27 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
388 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
132 views

Cubic spline fitting

If I have the following data: ...
0
votes
0answers
28 views

Logarithmic NonlinearFit with 10 parameters? Is Not a Real Number

I am trying to fit a collection of data with a fairly complicated function, and have been running into some errors. I am very new mathematica user, and am not really sure where I am going. This is my ...
0
votes
1answer
84 views

Algorithm to switch from one to two gaussian fit

I have a big dataset that I have to fit with one or two gaussians. This dataset represents the evolution of a population in two different population as a function of time. That means that at same ...
1
vote
1answer
46 views

how to place a regression line on top of a graph of data with different legend for each group

I have this code: ...
1
vote
2answers
59 views

PearsonChiSquareTest with experimental data including errors

I have a set of data in the form {x,y}, and the corresponding errors: ...
0
votes
0answers
46 views

Use Root object as a function in NonlinearModelFit or similar

I have a matrix and its eigenvalues are returned by Mathematica as a Root Object. ...
2
votes
2answers
66 views

Can't find parameter with findFit NMinimize

I have a data list and a function being to be fitted to the data to get parameters of the function as below. I can't find the parameters a, b, c, d with different below methods. Can you help me to ...
0
votes
0answers
75 views

How to find the appropriate fit?

Imagine we are given this set of data: data = {{0, 1}, {1, 0}, {3, 2}, {5, 4}, {6, 4}, {7, 5}}; We fit the data with: ...
0
votes
1answer
69 views
0
votes
0answers
50 views

Plot the difference between data and fitting model

The following code defines fitting models (Chebyshev and Fourier cosine functions) from a data stored in a txt file. ...
2
votes
3answers
188 views

Plot the error in the curve fitting

I would like to plot the fitted model and the original data punctually. For example, I have: ...
1
vote
1answer
47 views

Nominal variables in LinearModelFit must be specified before continuous variables

I am applying the LinearModelFit to a 90 x 5 matrix, in which the 4th variable is a nominal variable (i.e., x4 is a categorical ...
1
vote
0answers
41 views

fitting a dataset and choosing correct guess value

I am facing trouble in fitting some datasets with a model equation. Following is one of the data and code which I have tried: ...
3
votes
1answer
66 views

Even though the fit seems correct, NonlinearModelFit throws a failed convergence error

Consider the following data ...
1
vote
1answer
97 views

Problem with fitting

If I have the following data (I have updated the data): ...
0
votes
0answers
16 views

Global fitting to a set of data while changing two variables

I have a set of thermodynamic data that I need to globally fit to a single equation. I currently have the data in a two column data where every 16 points is a new "set" of data points. I ...
0
votes
1answer
65 views

Suggest periodic fit for parametric data

I have some data that I'd like to find a periodic, continuous function that will approximately fit to: ...
2
votes
1answer
86 views

Fitting an equation to data

If I have the followind data: data={{45, 2.93495}, {50, 2.94697}, {55, 1.9801}, {60,0.734437}, {65, -0.0128219}, {70, -0.695535}, {75,-1.35939}, {80,-1.47567}} ...
0
votes
3answers
84 views

Find order of polynomial approximation and LeastSquares for given datapoints

I have a set of data, where I'd like to find the order of the polynomial that approximates the data, and also know what the Least squares is. My data: ...
4
votes
1answer
70 views

Binary (binomial) logistic regression with multiple independent variables: calculating the confidence range or prediction

Adding on top to this post here, I am looking for the confidence range (intreval) of the prediction of a multi variant binary logistic regression. Can someone extend the solution in the post ...
1
vote
1answer
70 views

How to fit the following data?

Consider a dataset in the form {mN,tauN,x,value[mN,tauN,x]} (it may be downloaded here): ...
0
votes
1answer
54 views

How can I do NonlinearModelFit for only specific parameters?

I have a two dimensional data of the form $$\{x,y,f[x,y]\}$$. For example, ...
5
votes
0answers
298 views

Histogram (automatic binning)

There are different methods for choosing widths of bins for a histogram, like Freedman-Diaconis rule. In Mathematica, without choosing a specific method, with the command ...
6
votes
2answers
341 views

Fitting an exponential model: Mathematica vs. Excel [closed]

My data is: data = {{0, 0.05}, {40, 0.079}, {80, 0.113}, {120, 0.18}, {160, 0.31}, {200, 0.5}, {240, 0.71}, {280,0.86}, {320, 1.02}}; With Excel we can fit the ...
2
votes
1answer
83 views

How to find the integrand by fitting data - spectrum reconstruction

Problem statement I have some experimental data of measurement values vs. temperature. Now, I want to find the spectrum which causes the measured temperature dependence. The measurement values are the ...

1
2 3 4 5
30