Questions tagged [fitting]
Questions on the use of Mathematica to construct models for approximating empirical data.
267
questions with no upvoted or accepted answers
27
votes
0
answers
1k
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 ...
15
votes
0
answers
334
views
New issue or new setting(s) of Goodness-of-Fit Tests in 11.3@student edition
Bug introduced in 11.3 or earlier and persisting through 11.3.0 or later
Just before upgrading to 11.3.0 on last Friday, i was having p-value results from 11.2.0.
Not worrying about upgrade may ...
14
votes
0
answers
947
views
Implementation of Partial Least Squares (PLS)?
I'm looking for a PLS implementation for Wolfram Mathematica. I just can't seem to find any implementation for it - do you know one? In general, I'm a bit confused that there exist only so few third-...
7
votes
0
answers
301
views
Multivariate Adaptive Regression Splines (MARS) - Mathematica implementation?
Does anybody have or know of a Mathematica implementation of the Multivariate Adaptive Regression Splines (MARS) algorithm?
7
votes
0
answers
198
views
Is there a way to produce a FittedModel object as the solution to a regularized regression?
I can get the Ridge or Tikhonov regression solution to Y = \[Beta].X easily enough as
...
6
votes
0
answers
530
views
How to fit B-splines to unstructured grids (triangulated surfaces)?
As a continuation of trying to calculate curvature tensors on triangulated surfaces (here), I am interested in trying other methods. One approach is to use NURBS. To be more precise I would like to be ...
6
votes
0
answers
559
views
Custom Methods for NMinimize/NonLinearModelFit
Is there a way to write custom methods for NonLinearModelFit or NMinimize?
To give background, I currently have a batch of code ...
6
votes
0
answers
392
views
Problems extending NelderMeadMinimize into 2D
Update
The eventual route I followed was to adapt a version of the NM-simplex written in C and link to it with MathLink. Once I've tested this out fully I'll post it here.
I've been playing around ...
5
votes
0
answers
84
views
CirclePoints and CircleThrough
$Version
12.2.0 for Microsoft Windows (64-bit) (December 12, 2020)
For points (located on a unit circle),
...
5
votes
1
answer
129
views
Is MeanPredictionBands synonymous with a confidence interval in Mathematica?
I am a little confused by Mathematica's use of the term prediction interval in NonlinearModelFit. We are given two kinds of prediction bands as an option: ...
5
votes
0
answers
317
views
Histogram (automatic binning)
There are different methods for choosing widths of bins for a histogram, like Freedman-Diaconis rule. In Mathematica, without choosing a specific method, with the command ...
5
votes
0
answers
91
views
Improving speed performance of 'Fit' with BSplines?
Context
In the context of this (vaguely controversial) question,
I am stumbling into a performance issue with Fit.
Let me illustrate on fitting a set of ...
5
votes
0
answers
64
views
What does the PerformanceGoal option of FindMinimum do?
FindFit and FindMinimum both have a PerformanceGoal option. It is not documented. What does ...
5
votes
0
answers
170
views
What are the most reliable test of goodness of fit in Mathematica
I realise this is possibly a VERY open ended question, and potentially has answers dotted around e.g. here
.
What are the most robust methods of testing the result of ...
5
votes
0
answers
709
views
Estimate process parameters of geometric Brownian motion with a two-state Markov chain
I have the following sequence.
Consider a model that follows a geometric Brownian motion whose drift switches between two different regimes representing the up trend and down trend. The regime ...
5
votes
0
answers
390
views
Softmax Regression Classification Algorithm
I'm following the Stanford Machine Learning course while simultaneously developing my Mathematica abilities. I'm having issues with my Softmax Classifier implementation (for ref, have a look at these ...
5
votes
0
answers
156
views
Fitting data with unique variable per measurement
Imagine we are in the following situation, we have a nonlinear system of functions $f$ with coördinates $x_i$, and unknown parameters $\delta_i$'s and $t$. Let this system be defined as,
\begin{...
5
votes
0
answers
153
views
Third syntax version of LogitModelFit: unexpected result of "BestFit"
The third listed syntax version of LogitModelFit allows one to specify input in a simple way: Only a design matrix (with a row of values of the explanatory input ...
5
votes
0
answers
546
views
Module in numerical model for NonlinearModelFit is slow and leaks memory
I am trying to make a NonlinearModelFit where the model is the result of a numerical calculation. My code works, but it is very slow and also seems to have a memory ...
5
votes
0
answers
930
views
Analytical model fitting
I have a special type of model fitting problem that I am trying to solve in Mathematica. Any insight how to attack it using available tools of Mathematica will be great to hear.
We have a variable
$$
...
4
votes
0
answers
121
views
How can I get the standard error of parameters from FindFit?
I used FindFit with Norm function as written below.
...
4
votes
0
answers
140
views
Fit Markov Chain
Assume a simple Markov Chain with the transition matrix
...
4
votes
0
answers
87
views
How to get statistics of FindFit with changed norm-function?
I changed the norm-function of FindFit according to this answer, because apparently it is not supported for NonlinearModelFit ...
4
votes
0
answers
85
views
Optimization`FindFit`ObjectiveFunction and PenaltyFunction
Consider the following toy example:
model = a Cos[w t];
data = Table[{t, Cos[2.1 t]}, {t, 0, 10, .25}] + RandomReal[.1, 41];
as both an unconstrained problem:
<...
4
votes
0
answers
392
views
Goodness of Fit of Copula Distribution
I am trying to find out goodness of fit of copula distribution, but Mathematica 10 gives me the same answer for each copula type. e.g
...
4
votes
0
answers
212
views
Memory problem in Mathematica 10
I'm having a problem with memory. I'm doing nonliner fits of several data lists to a system of differential equations. When I evaluate the "Do" cycle the memory grows with the iteration step up to my ...
3
votes
0
answers
86
views
Finding multiple minimizers
Is it possible to find all (or as many as possible) minimizers of a given function? For example, minimizing the function $\cos(\pi(p-q))+\cos(\pi(q+p))$ for $-3\leq p,q\leq 3 $ can be done using ...
3
votes
0
answers
204
views
Errors Using FindFit and FindRoot
I'm trying to fit the following equation to data:
where
and x and y are the dimensionless variables x=V/Vr and y=Ir/(2*I0). n=1 and I'm trying to find Vr and R.
The blue is an example of the curve ...
3
votes
0
answers
114
views
Can FindFit be used with units?
I am trying to use the units capabilities of Mathematica throughout a course that I am teaching, but am finding that it isn't uniformly implemented across many functions. In particular, I would love ...
3
votes
0
answers
5k
views
Failed to converge to the requested accuracy or precision within 100 iterations for NonlinearModelFit
So I have a lot of data, from the following type:
...
3
votes
0
answers
308
views
How to extract the conditional variance from a fitted GARCH model?
In R's garchFit (fGarch) I can simply call "@h.t" or "@sigma.t" to get the conditional variance or standard deviation for a fitted GARCH model.
Is there a convenient way achieve this with Mathematica'...
3
votes
0
answers
345
views
Power law fitting package that optimizes fitting parameters based off of the KolmogorovSmirnov MC method
I'm exploring power law fitting and would like to get to a point of making a power law package like what was discussed in this post, where OP references the R poweRlaw package. As per the comments/...
3
votes
0
answers
68
views
Meaning/Format of RAW Image Data
I took photographs and I want to fit the (overall intensity or red intensity) of the photographs to a function of (x,y). I have some questions about how RAW data is structured. What is the difference ...
3
votes
0
answers
138
views
Estimating VARX(p,q) models in Mathematica
I would like to estimate the parameters of a vector autogressive process VARX(p,q) with n endogenous variables y and m exogenous variables x:
$$
y_t = v + B_1 y_{t-1} + ... + B_p y_{t-p} + \theta_0 ...
3
votes
0
answers
295
views
Least squares approximation
I have data points which is mydata = {{0, 0}, {1, 1}, {2, 0}};
From this data, I need to do the least squares approximation by using Bernstein polynomials to produce a set of Bezier points. Before ...
3
votes
0
answers
158
views
PearsonChiSquareTest for count/frequency data?
I read with interest a previous question on the PearsonChiSquareTest from a few years ago, and one answer was very helpful:
Performing a chi-square goodness of fit ...
3
votes
0
answers
167
views
Writing a function to set up and solve the least squares problem
I have setup the explicit line equation for a given set of points using least-squares approximation and the knots computed below. I have tried extending the same code for use with an arbitrary degree, ...
3
votes
0
answers
288
views
The CorrelationMatrix is equal to corrcoef of Matlab?
How can I generate a matrix which is equivalent to the results of the "correlation coefficients" command (corrcoef) in Matlab?
When I make a LinearModelFit, I can get a CorrelationMatrix, but is this ...
3
votes
0
answers
901
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, ...
3
votes
0
answers
1k
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 ...
3
votes
0
answers
274
views
Mathematica Complains about Non Symmetric Covariance matrix, when it's not the case
I was doing some fitting with Mathematica7 using NonlinearModelFit. It's quite long the program to do the fit and that's why I am not displaying here ...
It goes ok, and I can get the fit parameters ...
2
votes
0
answers
123
views
How to perform feature selection for machine learning applications?
Feature selection is fairly easy in e.g. Python's scikit-learn which sports a module and tutorials or MATLAB.
Mathematica even touts that it uses feature selection ...
2
votes
0
answers
71
views
ProbitModelFit is causing kernel crashes in Mathematica 12.0
Mathematica 12.0
I am running ProbitModelFit on a small data set (~130 rows). Intermittently, the function causes a kernel crash. I am curious if anyone else is ...
2
votes
0
answers
96
views
Matrix regularization, how to pick $\lambda$
Since v12 FindFit[] now supports regularisation, such as Tikhonov regularization. Do there exist statistics to help guide the choice of the hyper-parameter $\...
2
votes
0
answers
92
views
Finding percentage of points within tilted ellipse?
I am trying to find the number of data points that I have that are within a tilted ellipse that I have generated to represent the 68% confidence region. I generated some data using:
...
2
votes
0
answers
236
views
How to fit my data with following equation?
I have set of data of electronic specific heat ($C_{el}/\gamma_n T$) vs temperature ($T/T_c$). My fit equation is this
$$\frac{C_{el}}{\gamma_n T}=-\frac{6}{\pi ^2}\alpha \frac{\mathrm{d} }{\mathrm{...
2
votes
0
answers
78
views
Strange result in LinearModelFit ANOVATable
For one of the models I'm building, the p-value in the ANOVA table obtained from the "ANOVATable" properties of a LinearModelFit ...
2
votes
0
answers
89
views
What does the following error message mean, in the context of NonlinearModelFit?
I am deliberately not including data or a model for this question, as I want a more general answer so that I may be able to trouble shoot this myself in the future.
When performing a fit, usually a ...
2
votes
0
answers
131
views
How can you set the fit tolerance in `NonlinearModelFit`?
In NonlinearModelFit how can you set the tolerances of where the fitting terminates. I know you can set MaxIterations but how ...
2
votes
0
answers
99
views
What is optimized for each available FitRegularization setting?
Fit and FindFit now have a FitRegularization option, but the documentation is brief. What is optimized/minimized when each available setting is used?