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

learn more… | top users | synonyms (1)

12
votes
0answers
469 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 ...
3
votes
1answer
317 views

How do I draw a credible velocity vs. time graph using Locators?

This is partly a math question, partly a Mathematica question. For educational purposes, I'm making a simple demonstration to create a velocity over time graph from six locators. On the basis of ...
1
vote
0answers
178 views

To what extent can NonlinearModelFit be sped up?

Can NonlinearModelFit be parallelized or compiled to allow one to achieve a scalable speedup for a fitting procedure? Attempting to use this function to fit a ...
6
votes
4answers
3k views

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

Imagine I have a set of data like the following: ...
0
votes
0answers
91 views

Inconsistent results in fits from NArgMin

EDIT: Just realized I had misspelled "inconsistent." I'm using version 7.0. I'm trying to fit a (noisy) data set to a large-order polynomial. (Just for context: there isn't a model for the ...
0
votes
1answer
363 views

Fit implicit function

Can anyone help me with fitting an implicit function to data? The function is given by: a*x^2 + 2*b*x*y + c*y^2 = e under the condition ...
0
votes
0answers
155 views

Interpolating function as a model in Mathematica's procedures for fitting

Is it possible to use interpolating function with parameters as a model for NonLinearModel fit (and other integrated methods for fitting)? Similar question was already posted earlier - How do I find ...
1
vote
0answers
543 views

Linear regression with x and y errors

I have a question about finding a linear regression weighted with x and y errors. I found the answer provided by 0x4A4D in Estimate error on slope of linear regression given data with associated ...
0
votes
0answers
112 views

FindFit for dimension reduction?

Given an n-dimensional function, can I use FindFit to produce an approximate (n-k)-dimensional function? Here is a simplified illustration of what I am trying to do. I have $$f(x,a,b,\mu,\sigma) = ...
6
votes
2answers
798 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 ...
2
votes
1answer
117 views

making a function of fit results

I have 13*25 datasets consisting each of around 40 points. They are all linear I can easily fit them using fit function but my problem is when I want to call them I want them to be functions. I want ...
2
votes
0answers
190 views

NonLinearModelFit with Two Dimensional List of Weights

I'm currently trying to fit Planck's law (B[λ, T]) to measurements, thereby determining Planck's constant. I have a list of triplets containing wavelength, ...
20
votes
5answers
3k 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 ...
1
vote
1answer
254 views

Combined NonlinearModelFit [duplicate]

I'm trying to fit a number of data sets. Each of the sets should evaluate to a simple linear solution.ax+b. The problem is, all data sets have interference from a ...
2
votes
3answers
660 views

Plotting a list along with its trend line [duplicate]

Say I have these data: data = {{1, 3}, {2, 4}, {3, 6}, {4, 7}}; I want to fit these data with a quadratic equation, like this: ...
0
votes
1answer
85 views

Solving one equation, then inputting the values into another for NonlinearModelFit

Considering the equation a*x^3 + a*x^2 + x + b == 0 I'm looking to find the best value for a and ...
-1
votes
1answer
211 views

How to define a pure function with a Module?

I was not able to use a self defined (using Module and For loops) piecewise function to fit data. It seems that the problem is that I have to define a pure function. I would like to learn how to ...
1
vote
1answer
1k views

Using NonlinearModelFit to fit data with errors

Assume we have some data of measurements SeedRandom[9]; data = Table[{i,2*(1 + 5*RandomReal[])*Exp[-0.01*(1 + RandomReal[])*i]}, {i, {0, 100, 200, 400, 700}}]; ...
17
votes
1answer
344 views

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

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

Performance in parameter estimation from ParametricNDSolve using varied initial conditions

I have 250 data points from a timecourse exeriment in a list, with columns specifying (1) time, (2-4) initial conditions, (5) absorbance reading. I want to fit 4 parameters (k1, k2, k3, k4) in a DAE ...
2
votes
1answer
339 views

How to adjust parameters to experimental data on a NDSolve problem

I have 2 differential equations with 2 variables, x and y,which are a function of t and I have the parameters k1, k2 y k3. ...
4
votes
4answers
328 views

Remove linear trend from data

I have a large data set with 150k lines and two data columns. I noticed that there is a linear trend, which I want to remove. So, I do the following: first fit with a linear model ...
4
votes
2answers
285 views

Linear regression in a chosen range of points

Hi I'm absolutely newbie in Mathematica and have following problem: My list looks like {{50, 0.75}, {51, 0.76}, ..., and I want to choose a range out of my ...
2
votes
2answers
103 views

Putting a matrix inside function

I want to fit a function to some data and inside the function there's a list here's my data ...
5
votes
0answers
170 views

Using perpendicular offsets in FindFit

I want to use perpendicular offsets in the built-in FindFit function. Are there any possible ways or do I have to code everything by myself?
5
votes
1answer
353 views

Does LinearModelFit perform an ordinary linear regression (least squares)?

Does LinearModelFit give an ordinary linear regression? I see lots of options, but nothing like "least squares" or OLR.
0
votes
3answers
996 views

Fit line similar to power of trendline in Excel

Is there a way to fit a line similar to power trendline in Excel? Something in this fashion: Fit[data, {1, x, x^(-n)}, x] ...
1
vote
1answer
145 views

How can I nicely overlay fits for multiple arrays with ListPlot or ListLogPlot?

I'm plotting multiple lists with ListPlot[] or ListLogPlot[]: ListLogPlot[{ListA, ListB, ListC, ListD, ListE}, PlotRange -> {{0, 100}, Automatic}] I also have ...
2
votes
2answers
199 views

FindFit: Fit that is always lower - Change of Norm?

I am trying to find a fitting function for a multidimensional set of data. I will have to find a fitting function that is always lower (conservative) than the data fitted. The easiest way is to look ...
6
votes
1answer
607 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 ...
4
votes
1answer
248 views

Using a user defined NormFunction in FindFit or NDSolve

I would like to use a different norm instead of the 2-norm in FindFit (Mathematica 9). For example, instead of using $$\sqrt{\sum (x_{\mathrm{model}} - ...
3
votes
2answers
458 views

How can I consistently get a good logistic regression fit?

I'm executing the command NonlinearModelFit[data, c/(1 + a Exp[-b x]), {a, b, c}, x] with the data being ...
3
votes
0answers
209 views

Is it possible to marginalize one or several parameters obtained from fitting procedure?

Statistical model analysis package has a few fitting functions. Their arguments are data points, fitting model and parameters in the fit. The result is a set of best values for parameters, which ...
1
vote
1answer
299 views

Method used by FindFit

Using FindFit, Mathematica selects an optimal algorithm when Automatic is selected. I'd like to know the name of the method ...
3
votes
1answer
266 views

How to get confidence bands of parameters from a fitting procedure?

I have done fitting of data points with a given model that has two parameters (A and B), using NonlinearModelFit. The result of the fit is the maximum of the ...
5
votes
1answer
513 views

Multinomial logistic regression

Has anyone done multinomial logistic regression in Mathematica? The binomial case is essentially done on the LogitModelFit documentation page and works fine. I am ...
3
votes
1answer
857 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 ...
1
vote
1answer
356 views

Problem using NDSolve

This might be some simple mistake, but I am running out of ideas. I am trying to fit an ODE system to some data. This error keeps appearing NDSolve::nlnum: "The function value {0.299812 - ...
5
votes
1answer
265 views

Specify a constraint on an interval under FindMinimum

I have an interpolated function that looks like this: $\hskip1.2in$ and, based on extreme and critical points, I want to use a polynomial to approximate the function. The points in question are: ...
1
vote
1answer
504 views

FindFit: getting confidence intervals for the returned parameters

I'm using FindFit[] to fit a function to some experimental data. I'd like to know what error bars are on the fitted parameters. Scipy's ...
0
votes
0answers
173 views

Fitting a theoretical density function with log-return sample

I am working on a exercise to fit a theoretical density function,presented below, with log-return series of a stock. $\frac{1}{2}a e^{a(x-\mu)} \quad \text{if x } < \mu $ or $ ...
-1
votes
1answer
103 views

FindFit and Integration errors

First off, appologies for what may sound like a newbie question, as I am very new to using Mathematica. I am trying to find a way to get Mathematica to give me an expression that would describe the ...
1
vote
2answers
914 views

Finding a best fit curve and plotting it [closed]

I have a list as shown below: m01 = {{250, 0.083121}, {200, 0.0888446}, {150, 0.0992422}, {100, 0.121567}, {50, 0.186825}} I'm new to Mathematica, and would like ...
3
votes
1answer
424 views

NonlinearModelFit returning nonsense for very simple data

In fitting the following data, if I first log transform the y-values and use LinearModelFit I get a set of parameters that fits the data: ...
3
votes
1answer
526 views

Error message from evaluating NonlinearModelFit

I am trying to fit data to a Morse potential using NonlinearModelFit as follows: ...
4
votes
2answers
473 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 ...
6
votes
1answer
353 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 ...
6
votes
1answer
209 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 ...
13
votes
4answers
1k views

Mathematica Implementations of the Random Forest algorithm

Is anyone aware of Mathematica use/implementation of Random Forest algorithm?
1
vote
1answer
310 views

Fitting parameters of user defined function returning discrete values

So, I'm fairly new to Mathematica (apologies in advance for the noobiness), and I'm having some problems regarding fitting the parameters of a user defined function to data. I'll give a representative ...