Questions tagged [fitting]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
54 views

How to speedup calling the interpolation function? [duplicate]

Consider the following data: ...
  • 5,092
0 votes
0 answers
34 views

Fit curve line doesn't extend over the correct domain

I'm trying to plot points as well as a non-linear fit function onto the same image. I used the command: ...
3 votes
0 answers
32 views

Performing Tobit Regression in Mathematica by Maximum LogLikelihood

I am trying to estimate a tobit model by maximum likelihood method in Mathematica. I can not find the build-in function. So I try to perform it manually. Here is the log likelihood function of Tobit ...
0 votes
0 answers
22 views

Using FindFit for Approximation Fourier Series

I am expecting to have a list of discrete points, which I would like to approximate using Fourier's series, then plot Fourier series approximation alongside with discrete points, then plot terms of ...
2 votes
1 answer
71 views

'NonlinearModelFit' for SIR ODE model, and adding a penalty function (soft constraint)

This is a modification of the question Is it normal that adding constraints on the parameters of NonlinearModelFit increases execution time 100 times?? I want a program that fits a SIR model to ...
  • 1,314
1 vote
1 answer
76 views

How to plot a curve with an experimental plot [closed]

There is an experimental curve in this paper : https://arxiv.org/pdf/1211.2616.pdf ( Fig. 21. ) I want to make a new plot of the experimental curve with my theoretical model curve. How to do so by ...
  • 323
3 votes
1 answer
88 views

Is it normal that adding constraints on the parameters of NonlinearModelFit increases execution time 100 times??

Normally, reducing the optimization domain by adding constraints should reduce the time of execution. In my case however, this puts the NonlinearModelFit in a coma. Without constraints, 8 seconds ...
  • 1,314
0 votes
1 answer
46 views

Can constraints on the parameters be imposed in NonlinearModelFit? [closed]

Hi I cannot figure out this from the documentation of this command. For example, take one of the examples in the documentation, where I also added initial guesses for the parameters. ...
  • 1,314
6 votes
2 answers
426 views

How to force fit of the data to exactly match one of its points?

Consider the following data: ...
  • 5,092
0 votes
0 answers
99 views

Fitting NDSolve solution to data

I have a system of DDEs with 2 free parameters I solved with NDSolve, as you can see below ...
1 vote
0 answers
58 views

Finding knot vector for Spline fitting

I have the following code from Mathematica: ...
  • 45
0 votes
1 answer
103 views

How to find Specific Fit of a Distribution?

I want to fit a data set: ...
  • 1,238
2 votes
1 answer
77 views

(Beginner question) How to solve large gradient region from experimental data?

I have a data like this. data ={100, 103, 101, 105, 100, 80, 83, 70, 71, 60, 40, 43, 20, 22, 10, 5, -1, -3, -2, 0, 1, 4, 3, 8, 7, 4, 3, 1, 0, 1, 2, 10, 5, 2} ...
  • 99
3 votes
1 answer
80 views

Nonlinear model Fit [closed]

I am trying to fit my data to the function: a + (b*(c/2)^2)/((T - d)^2 + (c/2)^2) I entered nlm = NonlinearModelFit[data, a + (b*(c/2)^2)/((T - d)^2 + (c/2)^2), {a, b, c, d}, T] However it returned [0....
  • 33
2 votes
2 answers
121 views

Fourier series fit doesn't consider different local maxima of the data

I'm trying to appropriately fit a fourier model to experimental data. But the problem is that the resulting fit doesn't consider the varying local maxima of the data. Here's the data: ...
0 votes
0 answers
63 views

How to fit piecewise functions with unknown domain?

Thank you for your comments, I will discribe the question in more detail. I have a piecewise function as below and I'm looking for the parameters :...
  • 1
0 votes
0 answers
94 views

Fitting a 2D elliptic paraboloid

I have a set of data as follows: ...
  • 79
0 votes
2 answers
45 views

How to archive scatterplot with randomly jittered x-values for visualization purpose? [closed]

I want to fit my data or just plot a figure with randomly jittered x-values like this: Here I give an example: ...
  • 28
9 votes
2 answers
239 views

Curve tracing for a given data set

I want to trace the curve for the given data set. This is my code ...
  • 1,094
2 votes
2 answers
101 views

How can I find an intermediate function between a set of functions?

I have 5 nonlinear functions, which are very complex and long. For this reason I will not include them here. But the plots of four of them are given here: I am looking for some functionality which ...
  • 989
1 vote
1 answer
73 views

Fitting data with results generated from a numerical model

I have system of 10 equations that I am solving to try and model some data collected. The model using the real world values doesn't produce the best result so I wanted to try and fit the model to the ...
  • 182
6 votes
5 answers
260 views

How can we fit a closed curve?

...
2 votes
1 answer
132 views

Arbitrary shape cut into triangles and packed into rectangle of the same area

I've been trying to code this idea in lots of different approaches but I've reached a wall here. Mathematica isn't my strong suit and I've been unable to find a solution to the RegionMeasure error. ...
0 votes
1 answer
58 views

How to efficiently apply LinearModelFit for each column in a matrix

I have a source vector and a matrix of targets that I want to fit a linear model for. What is a more "Mathematica" way of doing this?. Here is my code to do it for the first column in target ...
0 votes
1 answer
53 views

Fitting parameter to match a dataset to another dataset

I am using a Module which calculates 3D-data based on 5 parameters and another input dataset. I'd like to fit the result of this modul to another set of data. Since my code became very long I will ...
1 vote
1 answer
79 views

Fitting an inverse power law [closed]

Is there any reasonably fast way of finding a function of the type that best fits a given data, for some K and n? For example, the following data closely follows an inverse power law ...
  • 4,362
1 vote
1 answer
177 views

Fitting data with Arrhenius Equation

I have the following data: DataAZ400K = {{293, 1.98}, {313, 1.34}, {326, 1.58}, {344, 2.54}, {358, 3.8}, {373, 6.12}}; I want to fit this data with an ...
0 votes
1 answer
75 views

Interpret P-value in ANOVA table and Parameter Table

I wonder how different between P-value in these 2 tables since they are not equal. I have check on Mathematica document. There is no information about these 2 tables in comparison.
0 votes
1 answer
72 views

Problem with NMinimize and NonlinearModelFit

I have data points of some experiment and system of ODE, that approximate this data. ...
0 votes
0 answers
50 views

NonLinearModelFit Usage Help

I am using FindFit to fit a piecewise linear interpolant (vs. x) to data (vs. t) using a convolution. The FindFit portion of my notebook is attached below. The fit appears to be reasonable despite ...
2 votes
3 answers
160 views

Calculating derivative of experimental data (with noise) using tangent method

I have some experimental data and I need to do a derivative. I looked at various answers how to approach that at e.g. here. But I am not happy with them (the curve is not smooth as needed plus the ...
  • 3,396
5 votes
2 answers
160 views

Parametric curves from 2D data using DFT

There is a very cool application in maple for generating parametric Curves from 2-D Data using Discrete Fourier Transforms https://www.maplesoft.com/Applications/Detail.aspx?id=154546 I wonder if a ...
4 votes
2 answers
438 views

Evaluating an integral symbolically seems impossible

I have an integral of general form $$ i_n(z)=\dfrac{z^2}{K_2(z)}\int_1^{\infty} \dfrac{\left(x^2-1\right)^{n+\frac{3}{2}}}{x^{2n+1}} \exp(-zx) dx $$ $K_2(z)$ is the bessel function and $0.01 \...
  • 693
2 votes
2 answers
90 views

Insufficient memory in Nonlinear Model Fit with ParametricNDSolve

I try to fit parameters to ODE solver with chemical kinetic eqations: ...
  • 225
-1 votes
3 answers
91 views

Interpolation of a function from numerical data and getting plots [closed]

I need to plot between two functions $f(h)$ and $g(h)$. I have the numerical data of $f$ w.r.t. $h$. So I just tried to get the expression of the function using the codes f[x_]=Fit[data,{1,x,x^2},x] ...
0 votes
1 answer
107 views

How can I calculate the parameter function of this curved like 3d mesh?

...
  • 8,399
0 votes
0 answers
49 views

Parameter distribution from NonlinearModelFit result

Is it possible to construct a parameter distribution (e.g. Normal or StudentT) from the Estimate and Standard Error of a NonlinearModelFit result? The SE is the square root of the variance but what is ...
3 votes
1 answer
120 views

MeanPredictionBands not working in ResourceFunction["MultiNonlinearModelFit"]

I have a problem creating MeanPredictionBands for a FittedModel from the ...
2 votes
1 answer
81 views

How to properly fit experimental data to a nonlinear model?

So I'm trying to fit experimental data to a nonlinear model using the NonLinearModelFit command, but it isn't quite working. The plotted data set looks like this: The data is to be fitted with ...
3 votes
1 answer
107 views

How can one find the corresponding black body temperature, when trying to fit the integrated planck function (energy flux) to a value

Given a certain numerical value for the energy density flux $F$ of a star, e.g. the solar constant $s_\odot = 1362~\frac{W}{m^2}$, and a certain wavelength range corresponding to the irradiated energy ...
1 vote
1 answer
67 views

Implementing a way of generating binary data for use in a logistic regression

Background I want to generate a set of test data to be used in a logisitic regression. As an example consider the scenario where a cannonball is fired at a wall. There are only two outcomes: the wall ...
  • 107
0 votes
1 answer
97 views

Problems with FindFit-function

this it's my first question in this forum, so first hello! I have a problem with one of two datasets. With the first is everything fine and it works the way i imagined it would. With the second ...
5 votes
1 answer
118 views

Logistic regression - Confidence interval for x axis

Background I have a set of binary test data of the form ...
  • 107
0 votes
0 answers
52 views

NonlinearModel Fit Help?

I'm trying to fit some data to a nonlinear model, but I'm getting the following error: NonlinearModelFit:: Failed to converge to the requested accuracy or precision within 1000 iterations. This is my ...
0 votes
0 answers
50 views

LinearModelFit not working

Why will the following run ...
  • 973
1 vote
2 answers
101 views

Mathematica "FindFit" starting value

I believe I have encountered a case in Mathematica where the FindFit function is not able to capture the fitting parameter value even when the starting value is approximately equal to the best-fit ...
  • 11
3 votes
0 answers
34 views

Minor inconsistency in Fit/Log

I was trying to fit a powerlaw to some data and noticed some inconsistency in the behaviour of mathematica. This works ...
  • 22.2k
10 votes
2 answers
396 views

Is there a method faster than FindFit to fit conical elliptical cylinder to point data?

I have a code that fits conical elliptic cylinders to point data. It utilizes FindFit. Usually, I need to fit over 1,500 "cylinders"**, each are ...
  • 333
5 votes
2 answers
416 views

Finding an exponential curve

I'm working on an exercise in Stewart's Single Variable Calculus: Early Transcendentals, 8th Edition, which asks you to find an exponential curve that fits some data. I tried using the FindFit ...
  • 197
6 votes
4 answers
517 views

How to estimate Taylor series expansion from the function values

I have a function $y=y(x)$ which can be sampled for any $x_i\in (-0.5,0.5)$ with $\epsilon=10^{-10}$ accuracy. I can generate any number of data points $(x_i,y_i)$. It is known that it can be expanded ...
  • 73

1
2 3 4 5
33