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

learn more… | top users | synonyms (1)

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 ...
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 ...
25
votes
4answers
570 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 ...
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
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 ...
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 ...
18
votes
3answers
2k views

Data fitting with Image processing feature detection

I have some 2D data that once plotted looks like the following ...
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 ...
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
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 ...
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. ...
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 ...
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. ...
16
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 ...
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: ...
15
votes
1answer
943 views

Compact Rational Function Fitting

I have some data from a study that I am trying to fit with a rational function of arbitrary form: $y(x) = \frac{\sum_{i=n}^m A_ix^{i/q}}{\sum_{j=o}^p B_jx^{j/r}}$ where $i$, $j$, $k$, $l$, $m$, $n$, ...
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 ...
13
votes
3answers
565 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 ...
13
votes
3answers
1k views

Finding a fit to a multi-dimensioned function

I have a model function $f:\mathbb{R}^2\rightarrow\mathbb{R}^2$, and a bunch of data points for which I'd like Mathematica to fit for me. Unfortunately FindFit ...
13
votes
0answers
530 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 ...
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 ...
12
votes
1answer
398 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 ...
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 ...
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 ...
11
votes
3answers
300 views

Disentangling the data

An experiment yields a functional dependence on two variables $F(x,y)$, can be imagined as a 2D map. It is known that the function can be factored as follows $F(x,y)=fx(x) gy(y) +gx(x) fy(y)$. Given ...
11
votes
1answer
317 views

Fit two intersecting straight lines in Mathematica

I am trying to do a Kurie analysis of the double beta decay of Strontium-90. Here we have two straight sections, and I need to obtain a value for the intersection along with an error for it. I ...
11
votes
2answers
821 views

Trying to fit an unknown extreme distribution

First up, I'm quite new to Mathematica so any hints on better code would be greatly appreciated. I have some histogram frequency data from an unknown distribution that I'm trying to fit. Here's the ...
11
votes
1answer
1k views

Fitting a spline to data with FindFit?

I am trying to find a function that fits my almost linear data. A high order polynomial model has too much residual. So I was hoping to use Mathematica to fit splines to the curve. This is what I ...
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: ...
10
votes
2answers
313 views

Unexpected differences with various uses of NormFunction

I would expect all of the following to give the same answer (2.12467) but only half of them give this answer. The others seem to be using the default ...
10
votes
1answer
600 views

Curve fit based on minimal data

Inspired by the fantastic answers here and here, I would like to ask a questions along similar lines. I have 6 curve types that follow these rules: Type A: If point 1 is positive and point 2 is ...
9
votes
1answer
795 views

Measure length and diameter of objects in an image

I am new to Mathematica, and I am trying measure length and diameter of rectangular objects in an image. I wanted to fit rectangles in the objects, and then get the values. Can I do that with ...
8
votes
4answers
2k views

Can one force a linear regression fit to go through the origin?

As the question says, can one force a fit through the origin $(0,0)$ as one can when fitting a trendline to your data in MS Excel? If so, how do you do that?
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 ...
8
votes
2answers
661 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: ...
8
votes
1answer
175 views

Inconsistent DistributionFitTest results?

In pondering this question, I used Mariana's function to generate the following data. ...
7
votes
2answers
247 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. ...
7
votes
1answer
174 views

Least Square Data Fit /Design Matrix

I am trying to learn how to use the DesignMatrix function in Mathematica and how to perform a LeastSquares fit. I am at end of ...
7
votes
1answer
386 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: ...
7
votes
1answer
305 views

Fitting a numerical integral via NonLinearModelFit to magnetic data

I'm new to Mathematica and I'm currently trying to fit $$m_T (H,T) = N_T \int\limits_0^{\infty} \frac{x k_\text{B} T}{\mu_0 H} \mathcal{L}(x) \text{pdf}(D_\text{mag}) \text{d}D_\text{mag}$$ with ...
6
votes
2answers
2k views

NonlinearModelFit Problem

I have some problems with the NonlinearModelFit: NonlinearModelFit[data, A (1 + Cos[a x]) + B (1 + Cos[b x]) + c , {A, B, a, b, c}, x] The model should fit my ...
6
votes
3answers
2k views

Finding the linear regression of data and plotting it

This is for a physics report that I have to hand in. I have a list of two-dimensional data points that approximately form a linear line. I want to: calculate the best linear fit. put both data ...
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: ...
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
224 views

Obtaining standardised regression coeffiecients

Regression coefficients are the constant that indicate the rate of change in one variable as a function of change in another. Standardised regression coefficients are the same, but refer to a change ...
6
votes
1answer
335 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 ...
6
votes
2answers
889 views

How can I compute and plot the 95% confidence bands for a fitted logistic regression model?

I have a set of binary data that I' d like to fit a logistic regression model to and show the 95% confidence band around the fitted function. I can produce the regression model but how do I compute ...
6
votes
1answer
120 views

Why LinearModelFit is slower than NonlinearModelFit?

Why LinearModelFit is slower than NonlinearModelFit? ...
6
votes
1answer
736 views

Smoothing/Averaging 2D Vector Fields

I have a list of 2D vectors defined by {{x,y},{u,v}} and would like to smooth or average the vectors. For example here are 2 vector fields, the second has noise ...
6
votes
2answers
184 views

how recover lost data of coordinates from contourplot of mention data?

I have made Contour Plot for a lot of data, like this ...