Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [fitting]

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

-1
votes
0answers
36 views

`DistributionFitTest` for 2D data [on hold]

How can I make DistributionFitTest accept 2D data? According to the Documentation - it should be able to accept multivariate data, and the test distribution can be ...
1
vote
1answer
52 views

Attaching independent variable values to data for curve fitting

I have a data set of $10^4$ entries. I want to plot the last $2000$ data with the same argument at $x$ axis and fit a curve. That means the range of $x$ axis will be $8001$ to $10000$ incremented by $...
6
votes
2answers
110 views

How to speed up Voigt profile fits?

Voigt profile fits in Mathematica seem terribly slow. For an example data set with 81 points a corresponding fitting procedures for Voigt fits is >1000 times slower than for Gaussian or Lorentzian ...
0
votes
0answers
39 views

Nonlinear Model Fit Returning The Same Values For Different Data [closed]

I am trying to use the NonLinearModelFit Function but the outputs for all my data tables are the same. For example DATASD1 and DATA1SD3 are getting the same output for the parameter table and the ...
3
votes
2answers
66 views

Generating FittedModels from vector-valued linear model fits

I have vector-valued data with normally distributed noise that I want to analyse. Assumptions on data can be made; in this specific example, it's expected that components of fitted vector values ...
3
votes
1answer
49 views

Using an offset variable in a Poisson GeneralizedLinearModelFit

In section "2.6 Exposure: Modeling Over Time, Area, and Space" of his book "Modeling Count Data" Joseph M Hilbe uses an offset (exposure) variable in his Poisson regression analysis of the FASTRAK ...
2
votes
1answer
53 views

Fitting data with 3 linear fits

I have a dataset that can be easily approximated by a piecewise function composing of 3 linear functions, but i am unable to get an accurate fit once the third linear function is required. The model ...
0
votes
0answers
47 views

Peak convolution

I am not an expert of wolfram mathematica, anyhow I decided to use it to perform analysis on some data I acquired. I found on this website a question about how to do peak deconvolution and I tried to ...
3
votes
1answer
68 views

What is a proper way to represent multidimensional data in TemporalData?

A TemporalData object can host multiple paths or it can admit a ValueDimensions option value greater than unity. In the former ...
0
votes
0answers
42 views

fitting different data sets with one same model with NonlinearModelFit [duplicate]

I have a bunch of list data sets, like 6 or 8 of them. They are 2D and look similar. Both x axis and y axis have variance (in each measurement, x axis also changed a little bit).I know the fitting ...
5
votes
1answer
331 views

Should a new user just default to LinearModelFit (vs Fit) [duplicate]

I tried searching but the noise in the responses is high due to 'fit' being both a function and a valid term. If I'm new to Mathematica should I just default to ...
3
votes
2answers
98 views

Optimize/fit data for 2 variables described by three functions

I have three equations that describe how parameters change: $$N_{1}(T,f)=f \ e^{-T (\sigma^{1}_c +\sigma^{1}_f)}$$ $$N_{2}(T,f)=-\frac{f \sigma^{1}_c \ (e^{-T (\sigma^{1}_c +\sigma^{1}_f)}-e^{-T \...
0
votes
0answers
33 views

Fitting of 2D data [migrated]

I have a 2D data-set. If we plot, it looks like above. Now if I want to know the central value of the distribution $\theta$ and width of the distribution $W$. How do I do that?
0
votes
1answer
73 views

How to get function of “GaussianProcess” prediction?

I am a new user of Wolfram Mathematica. I need your help. Let's say I have three variables: x, y, z. I want to calculate the "z" depending on x, and y. In other words, I want to find a function for z ...
2
votes
2answers
135 views

Fourier Transform to help guess with NonLinearModelFit

I imported some data in Mathematica which I cleaned a bit. This process went well. I also managed to plot it, and tried to take the Fourier transform of the data and plot it again. I'm not sure if I ...
0
votes
1answer
42 views

parameter fitting for a trascendental equation model

I want to solve the following problem with Mathematica: I have a physical model relating the $y$ variable with the $x$ variable given by the next expression: $$y=...
7
votes
5answers
1k views

Fitting a Cos^2 function

I have to fit a Cos^2 function to data I measured. The function is $a \cos^2(\frac{bx\pi}{180}+c)+d $ and I tried the FindFit and Linear Model Function. I have 4 datasets which I have to fit, the ...
0
votes
1answer
47 views

Ignoring one peak while fitting a Gaussian with multiple peaks [closed]

I have data that looks like this: When I try to fit a Gaussian to it, it obviously tries to fit the first peak, like so: This fit was found using ...
0
votes
0answers
49 views

Fitting results on two part graph

I have to do fitting of some experimental data that in the end should be represented like this: For the left part of graph from $(\pi,0)$ to $(0,0)$ experimental data is given as: ...
1
vote
2answers
81 views

Polynomial fit and Fourier transform plot

I'm pretty new to Mathematica so excuse me for obvious questions. I have a dataset, second column contains invoice amount and the first column contains days passed between each invoice date starting ...
0
votes
1answer
55 views

Evaluating fitted linear model [closed]

Apologies if this has been already answered, I have been fitting a linear model on some data and I am struggling to evaluate it later on. Dimensions[trainX] {...
1
vote
0answers
27 views

Does NonlinearModelFit result stores FitResiduals? [closed]

I fits a long data series with a complex model by NonlinearModelFit: fitnlm = NonlinearModelFit[...] Then I can use ...
0
votes
1answer
51 views

How can I parametrically fit a surface to another surface?

I begin with a function of two variables. A highly simplified version of that function is: F1->E^-E^- ϕ1 + E^-E^- ϕ2 $$e^{-e^{-\text{$\phi $1}}}+e^{-e^{-\text{...
0
votes
1answer
50 views

Improving the NonlinearModelFit

I've been trying to fit logarithmic function to the data below: ...
4
votes
4answers
641 views

How to fit the data?

Here is my attempt. ...
3
votes
1answer
85 views

Approximating decay rate of an amplitude and frequency of an oscillating function

I have an InterpolatingFunction constructed from a discrete set of values obtained by numerical methods. Let's denote it $f(x)$. The function demonstrates an ...
1
vote
0answers
57 views

Transform the data, and fitting it with a Lambert function

I got a list of numbers $x$: ...
2
votes
1answer
73 views

Determine a function based on the values and derivatives at different points

Googling didn't bring up anything useful for me, so I'm asking this question here. Suppose that I have the value of a function at some points plus the derivatives at those points. Now I am looking ...
0
votes
1answer
25 views

Fitting a numerical function with another function that depends on parameters

I'd like to fit a branch of the Lambert function : -ProductLog[-1, x] in the interval $[-0.35,0]$ with a function of the form $-a\log(-bx)+c+d x$ or $-a\log(-x)+...
0
votes
0answers
34 views
0
votes
1answer
44 views

How to find the fit for a numerical solution

I solved numerically a differential equation and I found a solution (solution that can be plot). I also tried an Ansatz to find an analytical solution and I got an expression. Using the numerical ...
2
votes
2answers
106 views

Interpolator surface

Writing: ...
2
votes
1answer
85 views

How can I generate a best fit quadratic function?

This is my first time using mathematica so I'm pretty confused. This question is based on the Sierpinski Triangle. The figure below shows the percentage of total even entries and total odd entries ...
0
votes
1answer
67 views

Fitting data using a parametric differential equation

I was fit the data using differential equation(eqns) and pfun I tried data fitting (I gave the parameter directly..a=22500, b=10^-22, c=2*10^-40 and scaling factor k=1.04 10^-36) ...
0
votes
0answers
21 views

In PearsonChiSquareTest[dataset1, dataset2], how exactly does M get chisqr?

I can't reproduce by hand Mathematica's PearsonChiSquareTest[dataset1,dataset2] on two datasets of discrete rand variables, with lengths ...
3
votes
4answers
275 views

Fitting of 2d data points with a function considering scaling, rotation and translation

I have the following set of 2d data points: ...
1
vote
3answers
143 views

Exact function that generated the data

I have "data" points as given below (e.g., for x-value = 1, the corresponding value of y is -23.110606616537147. (I apologize, it is rather large data array.) I need to find out the exact function ...
4
votes
2answers
241 views

Multi peaks fit (Voigt, Lorentzian or Gaussian)

I have started quite recently to use Mathematica and I don´t have experience in coding. What I need to do is to fit a peak which probably is a combination of two Voigt or Lorentzian. I have tried ...
4
votes
3answers
126 views

How do I find the root mean squared error of this fit?

I have the following data. ...
2
votes
5answers
153 views

Making batch data fitting robust — why does `NonlinearModelFit` fail occasionally?

I have over 1000 spectra I would like to batch fit and then use the results for further study. I'm not fitting anything especially complicated just a Lorentzian of the form, $$y(x) = A \frac{\gamma^{...
0
votes
0answers
39 views

Define output as the input

I want to find fitting parameters and then I want to use those parameters my further calculation. I used the following command for the fitting and I got values for the parameters. How should I define ...
-1
votes
3answers
149 views

Automatically fiting experimental data using NonLinearModelFit

Please, I have been working for some time to perform an automatic fit of my experimental data using an analytical function developed from a model based on the theory of kinematical diffraction. The ...
-1
votes
1answer
62 views

Gaussian fit with two variables

If I have an expression where two unknown parameters and a certain range of one parameter are present then how I can get best fitted values of such two parameters by varying this range?
2
votes
1answer
88 views

Properties of an arbitrary (i.e., not fitted) statistical model

Suppose that I have a data and a statistical model that is not the result of fitting, but has a different origin. For example, I have a list of measurements and a ...
0
votes
1answer
36 views

Fit data with a given function depending on parameters

I want to fit the data of a star's temperature with a function from a model. That function depend on several parameters. I want to know how can I find the value of those parameters. The data is: <...
-3
votes
1answer
118 views

Fit this data to a model in mathematica [closed]

I need to find a distribution or a model to fit this data set in Mathematica ...
2
votes
2answers
84 views

Obtaining the polynomial describing the motion

I have the following data points: Clear["Global`*"] dados={{0,0},{1,1000},{2,-750},{3,250},{4,-1000},{5,0}}; From these data I obtained the following ...
2
votes
3answers
100 views

How to get a plot with more precision in the data points?

Working with other software called SolidWorks I was able to get a plot with a curve very close to my data points: I tried to get a plot as accurate as this, but using the ...
1
vote
2answers
38 views

How to draw lines connecting nearby points [duplicate]

Suppose I have the following example data, data = Table[{Cos[theta], Sin[theta]}, {theta, 0, 2 Pi, Pi/8}]; which, when plotted, looks like this, ...