Questions tagged [fitting]

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

220 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
26
votes
0answers
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
0answers
327 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
0answers
829 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-...
14
votes
0answers
733 views

PenaltyFunction Option in NMinimize

I am curious if anybody has some experience in using the built-in Option "PenaltyFunction" in any of the numerical optimization functions like NMinimize. According to the documentation the user ...
7
votes
0answers
286 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?
6
votes
0answers
167 views

What does “Solved to an acceptable level” mean in the context of NonlinearModelFit in M12

I made a simple cosine fit to some data: ...
6
votes
0answers
474 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
0answers
182 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
0answers
387 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
0answers
75 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
0answers
59 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
0answers
150 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
0answers
408 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 ...
5
votes
0answers
656 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
0answers
353 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
0answers
154 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
0answers
151 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
0answers
523 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
0answers
911 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
0answers
67 views

How can I get the standard error of parameters from FindFit?

I used FindFit with Norm function as written below. ...
4
votes
0answers
122 views

Fit Markov Chain

Assume a simple Markov Chain with the transition matrix ...
4
votes
0answers
77 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
0answers
74 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
0answers
324 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
0answers
208 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
0answers
129 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
0answers
95 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
0answers
3k 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
0answers
252 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
0answers
222 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
0answers
58 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
0answers
126 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
0answers
220 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
0answers
141 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
0answers
156 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
0answers
267 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
0answers
840 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
0answers
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
0answers
257 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
0answers
81 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
0answers
202 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
0answers
52 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
0answers
90 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
0answers
78 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?
2
votes
0answers
113 views

How to speed up multiple calls of NonlinearModelFit?

I'm trying to do an insane amount of non-linear fits to large amounts of data sets. However, I found that the NonlinearModelFit is horribly slow. Here's the setup: ...
2
votes
0answers
29 views

Defining postive parameters for an indexed array in NonlinearModelFit

I'm fitting the model with this code: ...
2
votes
0answers
195 views

Fitting to an implicit function

I am trying to fit a data ...
2
votes
0answers
312 views

Data fitting with differential equation and non analytical integral

I would like to fit a set of data (measured value vs time) with a model that contains a differential equation and an integral that has to be evaluated numericaly. The integral also contains Bessel ...
2
votes
0answers
555 views

LinearModelFit[ ] and missing data

I have a data set where there is a lot of missing values; they are labelled Missing["Non-mesuré"]. When I append this data to another list of same length which has ...
2
votes
0answers
458 views

How to get the reduced chi-squared value for a best fit line/curve with error bars on both x and y axis?

Suppose I have a set of data ({xi,yi},like data from lab experiment) and I have errors associated with each xi and yi. If I do a best-fit line/curve, how do I get the reduced chi-squared value for ...

1
2 3 4 5