# Questions tagged [fitting]

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

1,157 questions
Filter by
Sorted by
Tagged with
0answers
25 views

### Creating a new list made up by just a particular coordinate of each point in a given set [closed]

what I'm trying to do is a weighted fit from points on a list that is formatted like: ...
0answers
37 views

### Is there any reason to use FindFit over NonlinearModelFit? [duplicate]

Given that FindFit seems to just be able to return estimated coefficients and none of the other goodies (standard errors, confidence bands, residuals, etc.), under ...
1answer
80 views

### Optimization of Curve fitting

I have a set of data: ...
2answers
130 views

### Curve fitting, Polynomial [closed]

I have a data set in such a manner ...
1answer
300 views

### Fitting a Multi-Exponential Decay With Constraints

I am having trouble finding a way to fit my data in Mathematica to a multi-exponential decay, with the critical condition that all contributions to the decay sum to 1. To start, I can fit my data to ...
2answers
145 views

### Fitting multidimensional data

Suppose i have some function G[n_,B_,d_] = .... to fit this function i need to collect the data first. However at first i dont understand how to format the data ...
1answer
121 views

### Is there a way to find a fit for a specific curve on a Contour Plot?

I'm kinda new to Mathematica, and it's really giving me a hard time, especially since I'm on a timetable. I have made a contour and I would like to find a function $u(r)$ for the part that starts ...
2answers
123 views

### Finding best fit curve line for a list of data .

Hi I have a question to find the best average fit curve for a range of data. I have calculated the best fit curve for each sample and plotted them on the same graph. However, I would need to find ...
2answers
73 views

### How can I find the best fit to my data?

I have a table of data given by ...
1answer
89 views

...
2answers
64 views

### Fitting a function integrated over bins

My data gives some function integrated over bins of the argument. I want to fit the function with this data. I determine another function with the bin number as the argument and use ...
1answer
150 views

### NoLinearModelFit error message

to fit my data, I use the following code. Using Manipulate on my fitting function, I can guess roughly the value for my initial fitting parameter which are in the ...
3answers
477 views

### Multi-peak fitting for peak position

I have a {x,f} data-set featuring multiple peaks. The peaks evolve with a second variable y. I would like to fit the multiple ...
3answers
253 views

### Fit sine function to my data to find the starting and finishing points [closed]

Say that I have the following data ...
1answer
281 views

### FindMinimum wrongly giving a message that the function value is not a real number [closed]

I am trying to use the method of moments to fit parameters to a distribution. This involves minimizing a function. This certainly gives real numbers, but FindMinimum gives an error message saying that ...
0answers
75 views

### Errors Using FindFit and FindRoot

I'm trying to fit the following equation to data: where and x and y are the dimensionless variables x=V/Vr and y=Ir/(2*I0). n=1 and I'm trying to find Vr and R. The blue is an example of the curve ...
1answer
193 views

### fitting accuracy

I tried to fit my data (see bellow) with the following code. It works but I get the following message : NonlinearModelFit::cvmit: Failed to converge to the requested accuracy or precision within ...
0answers
58 views

### How to find best fit parameters from interpolation functions by using NDSolveValue

This is an example of what I want to do. I want to calculate the best fit parameters from a set of experimental data with 3 and more differential equations. I use NDSolveValue to find the ...
1answer
156 views

### How do I use FindFit for an equation which has complex roots?

I have to fit an equation of the following form: $$\displaystyle 4ax\sqrt{x^2 + 9}\hspace{3mm} \bigg(1 - \frac{\sqrt{x^2 + 9}}{(b+1)c}\bigg)^b$$ where, a, b and c are parameters to be found w.r.t the ...
1answer
66 views

### Plotting multiple datasets for different sample that share the different length ( x-axis)

Hi I have some questions of the how can I plot the list of data that have different lengths. In the graph, I would need to include an overall gradient. The final goal of the graph should include:1)...
0answers
64 views

### Fitting a 2D array with two parameters to another 2D array

I am trying to fit an array to an image generated from real data. Here is the sample image: This is a filtered magnetic dipole with some noise thrown in, and now I'm trying to fit my equation for a ...
1answer
121 views

### Extracting a fitting parameter for each element of a For Loop

I have a code that fits a sine wave to small sections of a large data set and uses this to create an envelope function. I am trying to extract one of the fit parameters for each iteration of the For ...
2answers
101 views

### Verify polynomial equation for set of 3D data [closed]

Goodmorning, I mean to this link: Find polynomial equation for set of 3D data I tried to verify the result, namely if the interpolation is correct, but I found something that I don't understand. I ...
1answer
103 views

### How to fit a data set in an iterative way?

I am going to fit a data set in the following way. I have a data set $y$ vs. $x$. $y$ is again a function of $t$ i.e. $y=f(t)$. With varying $t$, I can get different $y$ and can plot $y$ vs. $x$, and ...
3answers
100 views

### ParametricNDSolveValue::nlnum error in conjuction with NonlinearModelFit

I am trying to use ParametricNDSolveValue with NonlinearModelFit in order to fit a differential model to some data. I am following the documentation here under Applications/Parameter Fitting: http://...
0answers
62 views

### What am I doing wrong in calculating the mean square error? [closed]

I am trying to compare the results of estimators from least squares and quantile regression from the perspective of the mean square error (MSE). The steps for performing this Monte Carlo approach are: ...
0answers
98 views

### How can I make a multiple variable nonlinear fitting of a group of equations to a dataset?

I have the following functional efvc, that needs 'alpha','beta','gamma' and a bessel function. Since it's so big, and I want to fit some parts of 'alpha' and 'beta' to a data set, I don't know how to ...
1answer
160 views

### Fit to Binomial Function

I have the following data, and need to fit a binomial distribution to this data. I have already done so for a gaussian fit (this is the example code I have below), but I am having trouble using a ...
1answer
124 views

### Fitting sinusoid to noisy data

I have a set of data: ...
0answers
74 views

### Fitting two overlapping sinusoids in a single set of data

I have a set of data data = Import["https://pastebin.com/raw/aqUwN2XR", "List"]; that gives me a graph that looks as though it has two oscillating sinusoidal ...
2answers
149 views

### Fitting sinusoidal envelope to data

I have a set of data (included below) that I want to fit to a sinusoidal envelope to see how closely it follows this pattern. The data is: ...
1answer
89 views

### Nonlinear model fit output [closed]

I'm trying to fit my data to function A. ...
1answer
72 views

### Binomial distribution for a list

I have the following list: ...
1answer
67 views

### LinearModelFit with large number of coordinates

I am sorry if this is on here already (or if it is really easy!) I have looked and I am not sure how to go about it. I have data that is 1000 rows and each row contains 200 columns (x1,x2,x3,...) I ...
2answers
225 views

### Fit to two exponential model

This is my experimental data: ...
1answer
155 views

### How to use Fit with exponential functions? [closed]

"Use Fit to find the fourth degree polynomial that matches best the function $y=e^x$ at the points that have x-coordinates: -2, -1, 0, 1, 2." What I tried: ...
1answer
103 views

### Issue with quadratically fiting data [closed]

I have a very weird problem: I have a data list: ...
1answer
214 views

### How can I plot equations with multiple independent variables?

I have a function h of multiple variables that I want to plot With independent variables i, l,f and δ. The question I have in hand is to show how the solution curve changes as the parameters change so ...
1answer
77 views

### Fitting data to a set of ODE's

I tried to search around this website for an answer and found many similar requests, but for some reason I cannot get any of them to work. Anyway, I am trying to fit data to a solution of 3 ODE's. ...
1answer
76 views

### Predict failed to reproduce result of multiple linear regression

I would like to reproduce the result of multiple linear regression with Predict. In approach 1, I used matrix computation and obtained ...
3answers
156 views

### Coding non-linear least squares (GPS iteration) with steps and solutions showing?

I am trying to code non-linear least squares approximation with its solutions shown in tables like far below, i assume there has to be a 5 by 4 Jacobian matrix (as i deal with 4 unknowns and 5 ...
0answers
78 views

### Error of ReplaceAll while using non linear fit model

while trying to fit a function with nonlinear fit model I get the error of ReplaceAll::reps. The function itself works (checked it while printing the function with ...
0answers
68 views

### How to get statistics of FindFit with changed norm-function?

I changed the norm-function of FindFit according to this answer, because apparently it is not supported for NonlinearModelFit ...
1answer
110 views

### Using EstimatedDistribution with custom circular ProbabilityDistribution

Basic Idea I'm attempting to estimate the distribution of a set of angle measurements. I have a custom probability distribution that I believe explains the measurements accurately and am attempting ...
1answer
188 views

### How many different methods of least square estimation can be performed in mathematica?

Let's take a simple case $$y_i = \beta_0 + \beta_1 x_i$$ $$x_i \,\,\,\, y_i$$ are the observed data of independent variable and the dependent variable respectively. \beta_0 \,\,\,\,\beta_1 ...
1answer
217 views

### Standard error of a nonlinear fit

I would like to better understand the process that Mathematica uses to determine the standard error when fitting with NonlinearModelFit. I have been reading this ...
0answers
82 views

### Mixture distribution fitting containing a uniform distribution

I have a dataset that is clearly the mixture of 3 known distributions which can be generated as follows: ...
1answer
78 views

### NonlinearModelFit increase accuracy for 2 dimensional model

I am trying to fit a 2 dimensional function. For that, I am using the function NonlinearModelFit. The model is ...
2answers
135 views

### Difficulty with non-linear curve fitting

I am trying to fit the experimental data to the following equation: (2*π/377)*Sum[S[i]^2*Y[i]*w^2/(W0[i]^2 - w^2)^2 + Y[i]^2*w^2), {i, 1, n}]. The data I have is ...
1answer
131 views

### NonlinearModelFit with of a single PDE parameterized several times

Edit: My approach was wrong, I have solved this - please see comments I've been scouring the answers and the docs but I'm having trouble figuring out the answer to this one. In particular, Olksander ...