Questions on the use of Mathematica to construct models for approximating empirical data. (FindFit[], Fit[], LinearModelFit[], NonlinearModelFit[], etc.)
0
votes
1answer
21 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}}];
...
2
votes
1answer
257 views
non-linear trend reduction using thresholds
Doing some mappings of the earth magnetic field results in the left-hand figure below (which consists of 181 profiles):
To improve this I tried a non-linear trend reduction using, for example,
...
10
votes
0answers
122 views
10
votes
2answers
350 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 ...
1
vote
0answers
78 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 ...
1
vote
1answer
89 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.
...
3
votes
2answers
119 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 ...
3
votes
4answers
163 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
...
0
votes
3answers
221 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]
...
2
votes
2answers
66 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
...
13
votes
5answers
2k 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 ...
5
votes
0answers
64 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?
3
votes
1answer
85 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.
1
vote
1answer
52 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
76 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 ...
1
vote
1answer
140 views
How can I fit a matrix function with multiple variables to given eigenvalues?
I have a 5x5 matrix function H[kx]
...
1
vote
0answers
171 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 ...
6
votes
1answer
115 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 ...
2
votes
2answers
95 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
...
-1
votes
0answers
55 views
Why is NonlinearModelFit calling the model function with symbolic arguments?
I have a model to fit which is made of numerical functions and so it can give a value for any numerical value of the arguments, but creates an error when called with symbols. ...
2
votes
0answers
80 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 ...
2
votes
1answer
70 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 ...
1
vote
0answers
64 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 ...
1
vote
0answers
55 views
Fitting a set if data to a 'plane'
I have a set of data ({{1,4,2},{1,-1,2},{-1,2,4},{2,1,5},{-1,1,4},{1,1,2},{5,2,2}}) that I am some how supposed to fit to "the plane, that is with the function ...
6
votes
6answers
1k 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 ...
4
votes
1answer
135 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 ...
0
votes
1answer
93 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
135 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:
...
0
votes
0answers
69 views
FindFit and NIntegrate with dependency between integration variables
I am trying to use FindFit and NIntegrate in this situation:
...
1
vote
1answer
87 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
128 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
56 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 ...
4
votes
2answers
161 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 ...
0
votes
0answers
156 views
NonlinearModelFit and NMinimize [closed]
I'm doing a non-linear fit on some data. The calculation residual is low, but I prefer to minimize another objective function such as:
...
2
votes
2answers
220 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
128 views
Error message from evaluating NonlinearModelFit
I am trying to fit data to a Morse potential using NonlinearModelFit as follows:
...
3
votes
1answer
119 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:
...
10
votes
4answers
606 views
Mathematica Implementations of the Random Forest algorithm
Is anyone aware of Mathematica use/implementation of Random Forest algorithm?
5
votes
0answers
192 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 ...
0
votes
0answers
86 views
NMinimize::nnum: Question for fitting the data
I'm just wondering if someone could help me solve NMinimize::nnum: problem? I still can't find a solution for it. I used NDSolve to solve my functions. And trying ...
6
votes
1answer
136 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 ...
0
votes
1answer
171 views
Problem with NIntegrate in NonlinearModelFit
We are receiving many error messages when using NIntegrate with NonlinearModelFit. Here is a much-simplified version of the code. It arrives at the correct answer after several messages saying that it ...
15
votes
1answer
505 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$, ...
0
votes
0answers
125 views
FindFit for an implicit function [closed]
Is FindRoot generally employed in the function definition when using FindFit on an implicit function (as in an example given in ...
1
vote
1answer
133 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 ...
9
votes
3answers
807 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
...
0
votes
0answers
177 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 ...
1
vote
1answer
185 views
Optimizing the fitting of Ordinary Differential Equation(NDsolve) involving interpolation functions
I am a newbie to this forum. I am trying to use NDsolve to solve some ODEs involving the interpolation function. Then, I will compare the fitted curve and data to determine the ODE coefficients.
...
5
votes
1answer
142 views
LinearModelFit with millions of rows
I'd like to do a simple regression with millions of rows of (x,y) data. It seems to be too long for Mathematica. Is there a way to speed it up? It shouldn't be that hard to do, I am not sure what ...
0
votes
1answer
109 views
System Identification with large Input/Output Data
I have some questions about system identification.
I made some measurement of current step (input) and voltage response(output) and I want to fine the parameters of my impedance.
The sample rate is ...



