# Tagged Questions

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

136 views

### Decompose Point-Spread Function into Seidel Aberration/Zernike Polynomials

I have measured the point spread function (PSF of a microscope) and I want to quantify it. For that purpose I want to fit my PSF data to the primary Seidel optical aberrations (or Zernike Polynomials, ...
309 views

### Computing launch parameters for hitting a point in 3D with projectile under influence of wind

The end goal of this problem is to compute functions which describe the launch parameters which are needed to hit a specified goal in 3D in the presence of wind disturbances. This is as far I have ...
71 views

### Fit a complicated function to a constant with NonlinearModelFit

I wish to fit a complicated parametric function (logder, with lambda parameters) to a constant (L) in order to minimize its dependence with the variable k in a given interval. To do that, I use a ...
62 views

### Fitting data with a complex function, but requiring real parameters

I am trying to fit a complex data with a complex function, with the real fitting parameters. I was trying to put there constraints like this, but I got error: ...
64 views

### Fitting data in form $f = f_0 + c A^x$ [closed]

The Fit[] function in Mathematica can fit data in form of $f = f_0+c_1x+c_2x^2+...$ ($f_0$ and $c_i$ are unknown constants), is there a function can fit date in ...
77 views

### PredictionBands and the presence of {0,0} point

We know from this post, that the default fitting method cannot handle data with a {0,0} point, and that there are alternative methods. But, with these alternative methods, the prediction bands ...
98 views

### FindFit runs extremely slow for my Function,how do I optimize this?

My function is the first order Bessel Function, and I am basically just trying to get this to fit in a way that does not take forever. I define the function as follows, (it seems to work faster if I ...
117 views

### Fitting Legendre polynomial - Integer constraints in Fitting functions

I have some data in the form of {theta,y} and I am trying to fit a Legendre polynomial to it, however I don't know how I can get it to vary the m and l parameters in integer increments as I don't know ...
71 views

### Encoding variables

I'm trying to fit a Logistic Model using LogitModelFit in Mathematica. The data I'm using contain qualitative variables that I have to encode. I've searched in ...
38 views

### Fit a custom process to a data: inhomogeneous 2-state Markov chain

I would like to fit a custom process - a time inhomogeneous 2-state Markov chain, to data. The time inhomogeneity is a result of the transition probabilities varying sinusoidally through time with a ...
54 views

### NonlinearModelFit returning unexpected result

I am attempting to perform a weighted fit of some data. The Fit function produces the correct quadratic fit, which I am fine with, but it does not appear to support ...
121 views

### How to do dynamic range selection for data fitting in Log plot?

In linear plot, this can be achived by Locator like this: http://mathematica.stackexchange.com/a/24935/13580 ...
95 views

### How to control precision of parameters in NonlinearModelFit?

I am using NonlinearModelFit for fitting a dataset to some complex numerical model function that depends on a few parameters. The final required precision of these parameters is very low, like 3 ...
53 views

### ANOVA on data with different lengths

I have data in the following form: ...
75 views

### Kalman filter estimation

Does anyone have any examples of the estimation of Kalman filters in Mathematica? I am new to these filters and struggling to compose the likelihood function. Some examples would be really helpful. ...
242 views

### FindFit “is not a real number” error when fitting a parametric function to the data

I am using Mathematica's FindFit function to fit a parametric solution to my data and I am getting the error ...
161 views

### How can the Theil-Sen estimator be made to work on larger datasets?

The Theil-Sen estimator finds the slope and intercept of a line passing through a set of points by calculating the median slope and median intercept of the set of lines passing through all possible ...
262 views

### RSquared: LinearModelFit vs NonlinearModelFit

I'm trying to understand the differences between LinearModelFit and NonlinearModelFit. One thing I notice is that the computation of AdjustedRSquared seems to be different, even when the model results ...
52 views

### NonlinearModelFit not hunting for good values

I have the following data which come from complex values but I have turned them into a 3D list ...
645 views

### Fit convoluted Gaussian and Lorentzian functions to a peak profile [duplicate]

I have a peak profile data like this: ...
210 views

### Unable to fit function convolved with NIntegrate with FindFit even with NumericQ

I am attempting to fit to the convolution of a simple function with a Gaussian. (I realize this could be done with Convolve also, but I thought I could make it go faster this way). I am able to ...
48 views

### How do I add custom deviation when using LinearModelFit?

I have a set of data in the form a list S1={{x,y},{x,y}} etc. I also have a function that calculates a corrected standard deviation in the y direction for ...
80 views

### Expand a fitting using FindFit[]

I need to implement multidimensional optimization using FindFit[]. But it's essential to exclude some parameters from the main procedure of optimization and to move on from direct optimization in ...
156 views

### How to derive SinglePredictionBands from a NonlinearModelFit model

I have found NonlinearModelFit to be extremely useful in my work. Here I have fit 4 points to a function and am being asked to explain how the 95% SinglePredictionBands associated with the plot below ...
103 views

### LinearModelFit - Number of unique basis functions & Invalid variable errors

I'm having trouble with a simple linear fit model. Here is my code ...
113 views

### How well does my function fit data? [duplicate]

Oleksandr Karsten suggested me to mark the difference between this question and the one that is already answered: in the other question it is calculated a ...
151 views

### Fitting an imported .txt data

I have some data in a .txt file, and I'm trying to import it to Mathematica and fit it with a function. The data is a 647x647 matrix of values. This seems like it ...
117 views

### How to fit points in a picture using locators

I've got a problem doing some analysis work on some of my spectra. I am basically looking for features that look like parabolas. In need of a tool to quickly find two parabolas in a spectrum (they are ...
126 views

### How to make a diagnostic plot for the regression?

Context I am interested in LinearModelFit, and would like to make diagnostic plots using Mathematica. I cannot find them in Mathematica document center. For example, the following R program makes ...
106 views

### Plots to check all assumptions of linear regression

I'm running a linear regression with LinearModelFit and would like to plot graphs to check the assumptions of linear regression: linearity, independence of the ...
161 views

### NonlinearModelFit - “Encountered a gradient that is effectively zero”, all variables are 1, 1, 1 [duplicate]

I have data of the form {149.45, 0.371093}, {149.362, 0.375976}, {149.277, 0.380858}, ... }, where each element of the list is {x, y}. The plot of this, using ListPlot, gives an approximate Gaussian. ...
87 views

### Ordinary Least Squares (OLS) with RLink

I need to calculate the parameters b0, b1 and b2 in: ...
77 views

### Regression with 3 variables

I'm trying to find a function starting from its values but I can't find anything related to functions with 2 variables and I don't know how to go on. So, given this sample data, I'd like to know how ...
62 views

### How to fit this data to be used in NIntegrate later?

I have a list of data points that resemble a chi-squared distribution (long tailed gaussian) that I am having trouble fitting or finding an equation with. The goal is to use the fitted equation in an ...
59 views

### Why does my Dynamic NonliearModelFit keep running?

I have complex data and which I am fitting to a complex formula. In order to use NonlinearModelFit I split the formula and the data into real and imaginary parts. ...
139 views

### FindFit::nrlnum: error with FindFit

I am trying to write a code to fit actual data of the orbit of a star with Mathematica 8. First I tried to write a code to fit a mock orbit, using the Application with differential equations (the ...
136 views

### FindFit working with Integrate but not NIntegrate - I am using “?NumericQ”

I'm having some syntax problems with finding a fit to an equation that doesn't have an analytical expression for it's integral. Because I think the problem is one of syntax, I am substituting a ...
291 views

### Test Goodness of fit for FindFit

Is there any way to get an estimate of the goodness of fit from FindFit, for instance getting the final error? The documentation doesn't provide any hints, and a quick Google search didn't return any ...
60 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 ...
112 views

### Fitting curves with NonLinearModelFit not working with charge and discharge like data

I'm trying to get a reasonable fit out of mathematica, but i'm not very practical with it. I'm not that good with mathematica at all actually(like cleaniness of the code...). btw, here's my problem: ...
46 views

### Troubles with FindFit for ODE (elaboration)

I have asked a question Troubles with FindFit for ODE and get a good-working answer from @belisarius. Nevertheless I need to clarify is it possible to define the same model with ...
141 views

### Remove redundant parameters from equation

I have random expressions like (b1 x + b2 x)/(b3 + b4/b5 x) + Sin[b6 x] where $x$ is a variable and {b1, ..., b6} are parameters to be fitted. This expression is ...
140 views

### How do I find out what a Mathematica function is doing (which numerical method it uses and how)?

Long story short, I am working on a project which entails fixing a bug I have found in Mathematica (8 and 10). In general, I would like to know what a specific Mathematica function is actually doing ...
136 views

### Find Numerical Derivatives (With Errors) given some data

I have a question. Suposse I have some data with their respective errors: ...
182 views

### Find GeometricTransform from 3D object external surfaces to a positional point cloud data

I am looking for another way to approach this problem. Any suggestion on how to optimize the computing speed is welcome. I have a BSplineFunction which accurately ...
154 views

### Applying LinearModelFit[] to data obtained with WeatherData[]

I am trying to perform a linear regression on some weather data, but I can't seem to figure out how to perform the operation. What I have right now is this: ...
130 views

### Mixture coefficients and Parameter estimation for moving Normal distributions

I am searching for a way to do the following steps below. I am stumped and I have stumped a few profs too. Any help would be appreciated. I would like to import data from, say, excel or a .txt file ...
68 views

### Handling msg for fitting

I have a trivial question: I do Monte Carlo with some curve fitting. Now always when a random run creates a complex fitting solution it should write 1 in a Matrix. How can I handle such msgs in a ...