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

learn more… | top users | synonyms (1)

17
votes
2answers
2k views

How to fit 3 data sets to a model of 4 differential equations?

I'm a biologist and a newbie in Mathematica. I want to fit three data sets to a model consisting of four differential equations and 10 parameters. I want to find the parameters best fitting to my ...
16
votes
5answers
7k views

Estimate error on slope of linear regression given data with associated uncertainty

Given a set of data, is it possible to create a linear regression which has a slope error that takes into account the uncertainty of the data? This is for a high school class, and so the normal ...
13
votes
4answers
4k views

Using FindFit to fit $a\,b^t$: how to avoid introducing complex numbers?

I'd like to find a model $f(t)=a\,b^t$ which matches the following data ...
30
votes
4answers
5k views

Simultaneously fitting multiple datasets

What is the proposed approach if one wants to simultaneously fit multiple functions to multiple datasets with shared parameters? As an example consider the following case: We have to measurements of ...
19
votes
4answers
2k views

Mathematica envelope for the bottom of a plot, a generic function

I have the following set-up: xaxis = Table[x, {x, 0, 10, 0.01}]; yaxis = Table [Sin[x] + Abs[RandomReal[{-1, 1}]], {x, 0, 10, 0.01}]; ListLinePlot[Transpose[{ xaxis, yaxis}]] My ...
15
votes
3answers
2k views

Fitting fractional complex data with NonlinearModelfit

I've difficulites with the NonlinearModelFit function. In principle Mathematica should be able to deal with complex data. E.g. if I define the following table ...
12
votes
3answers
2k views

How to use FindFit to fit an implicit function?

Now I am trying to fit some data with a implicit model function. Firstly, I tried a toy example. Toy example with input and output ...
16
votes
5answers
1k views

Finding the intersection of a curve with an interpolation function

There are no issues trying to find the intersection points of two defined curves. ...
11
votes
6answers
9k views

How to determine the center and radius of a circle given three points in 3D?

I was wondering if anyone could give me a hand with this problem I have. I have six points on a plane, and I am trying to determine if they form a circle or not. I know that any three points in 2D ...
17
votes
5answers
6k views

Problem with NonlinearModelFit

I'm having trouble with a non-linear fit: fit = NonlinearModelFit[data, y0 + A Sin[\[Pi] (x - xc)/w], {y0, xc, A, w}, x] where ...
6
votes
4answers
4k views

Fitting a two-dimensional Gaussian to a set of 2D pixels

Imagine I have a set of data like the following: ...
20
votes
5answers
4k views

How to perform a multi-peak fitting?

I am wondering how to implement the multi-peak detecting and fitting in Mathematica. Following is an example of fitting the data using three peaks (such that the data ~ peak1 + peak2 + peak3). The ...
19
votes
2answers
1k views

Finding the area, algebraic curve and jaggedness of an arbitrary shape

I start with a photograph of a shape (physically made by the flow of a liquid into another), of which I can extract the border, manually or using Mathematica's feature detect feature : Using the ...
12
votes
2answers
594 views

Is it possible to use the LevenbergMarquardt algorithm for fitting a black-box residual function?

I have a black-box multiargument multiparametric function of the type SRD[dataPoint_List,params_List] which accepts experimental data along with the parameters of ...
10
votes
2answers
2k views

FindFit returns worse result when putting constraints on parameters

I want to fit some data to a model of exponential decay using the FindFit function: ...
4
votes
1answer
450 views

NonlinearModelFit does not find a good fit

I am trying to fit my data to the following function, $$\frac{a b t \left(\log \left(\frac{-a d t+a t-1}{a d t}\right)-2\right)}{4 (a t-1)}-c$$ ...
4
votes
5answers
2k views

How to plot Fit functions?

If I do something like this f[x_]:=x^2 Plot[f[x],{x,1,10}] Mathematica plots the function $f(x)=x^2$, as expected. However, ...
18
votes
3answers
2k views

Data fitting with Image processing feature detection

I have some 2D data that once plotted looks like the following ...
8
votes
3answers
883 views

Ηow to create an interpolated CDF from its samples?

I want to use a distribution I have only aggregate statistics on, namely its CDF sampled at certain points. I would like to keep it "nonparametric" (remain noncommittal on the parametric form), but I ...
4
votes
1answer
1k views

Methods for NonlinearModelFit

I am using NonlinearModelFit for a thesis project. I get quite different results if I change the Method to LevenbergMarquardt or QuasiNewton or ConjugateGradient ...
7
votes
1answer
382 views

How does Mma compute Confidence Intervals?

I am trying to understand how Mma computes the Confidence Intervals after a NonlinearModelFit. Consider the following example: ...
2
votes
0answers
588 views

ParametricNDSolveValue or NDSolve + fitting

I have been trying to find the value for the parameter kestim that yields the best fit of a model to some data points. datac has ...
16
votes
2answers
1k views

FindFit returns Infinity::indet error when data contains {0,0}

Let's consider the following data: data = Table[{q, 2*q^2}, {q, 0, 2}]; and then, do a very simple fitting to this data: ...
2
votes
1answer
853 views

Combined fitting via NonlinearModelFit

I am trying to fit my data to a combined function model. Say I have two functions with some common parameter(s) f[x_]:= a*x^2 + b*x + c g[x_]:= d*x^2 + e*x + c ...
4
votes
2answers
514 views

What can I do to eliminate the error FindFit::nrjnum:?

I am testing the "Power Law with finite-time singularity" hypothesis for world population growth for a project. The data I'm using (same behaviour should also be exhibited by the stock market, thats ...
2
votes
2answers
152 views

Fitting a variable using multiple equations

I would like to find the best fit of two variables for a number of approximate equations, such as: 1x+2y+2=7.04 2x+y+4=7.98 1.5x+1.5y-2=2.53 1.8x+3y-1=6.77 That ...
1
vote
0answers
104 views

Developing easy code to apply Delta Method to generate prediction bands for custom distributions

I think that this is an interesting issue for all those who when to not only adjust one prediction function, but also to obtain the prediction bands to asses the graphical or tabular error I'm trying ...
40
votes
4answers
2k views

How to visualize 3D fit

I have a data set of x,y,z values and I fit a function of x,y to the data. This works, but I can't come up with a nice way to ...
25
votes
4answers
567 views

What is the natural way of using Dataset to get a FittedModel?

The new Dataset in Mathematica 10 is a great addition to the language, potentially reducing the convenience gap with R. Given this, I would like to understand what the equivalent simple or natural ...
17
votes
5answers
2k views

Mathematica Implementations of the Random Forest algorithm

Is anyone aware of Mathematica use/implementation of Random Forest algorithm?
17
votes
1answer
356 views

Unexpected behavior of confidence bands for data presenting two regions with uneven noise

Let's generate some noisy data with uneven noise. ...
13
votes
0answers
527 views

Nonlinear least squares on a GPU with Mathematica 9

Update: A Mathematica wrapper for (https://github.com/zitmen/cuLM) should allow for us to directly implement the Levenberg-Marquardt algorithm in CUDA for nonlinear least squares fitting. In a ...
13
votes
3answers
561 views

Fitting ellipse to 5 given points on the plane

Five points are required to define a unique ellipse. An ellipse has five degrees of freedom: the $x$ and $y$ coordinates of each focus, and the sum of the distance from each focus to a point on the ...
8
votes
2answers
654 views

What is the best distribution for my histogram?

I defined a security bound for a random walk (cube with 15 lengh) and i have this code to obtain a sample of the random times at which the random walk crosses the boundary for the first time: ...
4
votes
1answer
258 views

Fitting piecewise functions

I have several large data sets which follow the following pattern: A position is measured, a force is applied until a new equilibrium is found. I'd like to find a fit for the position, at least at the ...
12
votes
1answer
397 views

Does anyone have experience with performing symbolic regression using Mathematica?

I understand that there is at least one Mathematica package, DataModeler commercially available for symbolic regression. I'm seeking any observations with this or any other similar tool. I'm ...
8
votes
1answer
174 views

Inconsistent DistributionFitTest results?

In pondering this question, I used Mariana's function to generate the following data. ...
4
votes
1answer
924 views

How do I find the best parameter to fit my data if the model is a interpolating function?

Hi I have a question regarding to find the best parameters for my model to fit my data. I have 3 ordinary equation, and I now just picked some parameters (...
2
votes
1answer
254 views

Model fitting to noisy data with a custom minimization function

I'm looking into fitting some data with Mathematica. I've got my head around how NonlinearModelFit works (I've been using the Levenberg-Marquardt algorithm for some ...
4
votes
2answers
83 views

2D smoothing spline interpolation

Does Mathematica have 2D smoothing spline interpolation built in? I requires an interpolation method with smooth first derivatives and cubic bivariate splines fulfill this nicely. In python I would ...
7
votes
2answers
245 views

Does FindFit support complex numbers or doesn't it?

Inspired by this previous question: Findfit doesn't give the good fit; Changing the starting values will not change the results. Consider the following complex-valued dataset. ...
6
votes
1answer
332 views

Having trouble fitting data using NonlinearModelFit

I'm trying to fit data = {{2002, 45000}, {2004, 90000}, {2005, 120000}, {2013, 211000}}; to an exponential function ...
5
votes
3answers
262 views

Determing two Nonlinear model fits with 95% confidence bands from one data set

I have the following data which is postulated to have contributions from two different sources .....as can be seen from the confidence band, many points are out of the band. Question: How can I ...
5
votes
2answers
1k views

In finding a logarithmic fit for some data (of the form a*Log[b*x]), WolframAlpha succeeds where Mathematica 7.0 fails, why?

I would like to fit a function of the form: $a \log(b x)$ to a set of data: ...
4
votes
0answers
201 views

Using FindFit to fit nonlinear ODE parameters, subject to a constraint (an inverse problem) [duplicate]

Similar to this post I am finding that constraints tend to make FindFit poor at finding a good fit. However, unlike the previous post, the constraints are required ...
2
votes
3answers
315 views

Estimating a distribution using binned data

I have data from which information has been irretrievably lost through binning and I am trying to find a plausible distribution from which it derives. There is an academic paper suggesting that the ...
1
vote
2answers
212 views

Can't find a fit for Erf

I have the following numbers ...
0
votes
2answers
128 views

Least Square Fitting

stuck on a mathematica assignment and could really use some help. A) Fit a function with the shape log(Y) = a0 + a1log(U) to the datapoints (log(Ui), log(Yi) with an least square fitting. Show this ...
6
votes
2answers
182 views

Implement planar correction for skewed 3D profilometric data

I have some data that represents small-scale surface topography. The data is planar but not flat because it's impractical to level this microscope to a tolerance of microns. It looks like this: I'd ...
6
votes
1answer
370 views

Mathematica vs Sigmaplot (Non LinearModelFit)

I asked a question in a previous post that was closed because "The title of the question is not correct and the issue here is too trivial to help anyone later". NonLinearModelFit It's possible ...