# Tagged Questions

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

225 views

### Fitting Function with 3 parameters

I am trying to fit a function with 3 parameters however the result strongly depend on the initial values of parameters: ...
683 views

### Discrete peaks to curve via Voigt summation

I have two data sets. One is an experimental recording of an absorption spectrum, composed of regularly spaced (wavenumber, intensity) coordinates with a fine wavenumber resolution, thus making ...
60 views

### Fitting for multiple data in Mathematica [duplicate]

I've just started to use Mathematica for programming and I was wondering how I could do Fitting for several data sets. For example, I have one curve. For this curve I need to plot a fit curve, if my ...
98 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 ...
391 views

### Fitting a variable using multiple equations

I would like to find the best fit of two variables for a number of approximate equations, such as: 1x+2y+2=7.04 2x+y+4=7.98 1.5x+1.5y-2=2.53 1.8x+3y-1=6.77 That ...
322 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 ...
535 views

### Model fitting to noisy data with a custom minimization function

I'm looking into fitting some data with Mathematica. I've got my head around how NonlinearModelFit works (I've been using the Levenberg-Marquardt algorithm for some ...
209 views

### Least Square Fitting

stuck on a mathematica assignment and could really use some help. A) Fit a function with the shape log(Y) = a0 + a1log(U) to the datapoints (log(Ui), log(Yi) with an least square fitting. Show this ...
475 views

### Disentangling the data

An experiment yields a functional dependence on two variables $F(x,y)$, can be imagined as a 2D map. It is known that the function can be factored as follows $F(x,y)=fx(x) gy(y) +gx(x) fy(y)$. Given ...
85 views

### Inaccuracy of Piecewise function? [duplicate]

I have the following issue and can't find a solution so far. ...
92 views

### Trouble fitting an explicitly complex model with the TransformedFit package

This is follow up from a previous question in which @Oleksandr R. suggested the use of a package he developed for splitting a model and data into real and imaginary parts to avoid a problem with ...
401 views

### NMinimize holding problem

I have a function that I want to minimize numerically through an NMinimize command (because it's very complicated analytically). The minimizer call looks as follows: ...
592 views

### Multiple Linear Regression - obtaining equation with constant term

I am trying to use the LinearModelFit function to obtain a linear regression of my 5 inputs for my single output. I have the input data: ...
1k views

### Fitting piecewise functions

I have several large data sets which follow the following pattern: A position is measured, a force is applied until a new equilibrium is found. I'd like to find a fit for the position, at least at the ...
135 views

### What does LinearModelFit depend on except for its arguments?

I thought this would be always true, but most likely it returns false. ...
214 views

### How to fit exponential function which is not converging

I performed an experiment where I measured diffusion in a lipid bilayer. I performed the measurement by fluorescently labeling some molecules in the bilayer, and the irradiating them with light ...
460 views

### Fit two intersecting straight lines in Mathematica

I am trying to do a Kurie analysis of the double beta decay of Strontium-90. Here we have two straight sections, and I need to obtain a value for the intersection along with an error for it. I ...
700 views

284 views

### Fitting data using a series of Sin and Cos

I have the following data representing the normal displacement caused by a normal load applied at the middle cross section of a cylinder: I've made the data available here. I am trying to fit ...
527 views

### Can ParametricNDsolve be used for coupled PDEs with 5 parameters?

I have a system of coupled PDEs with five parameters that I only know ranges for rather than explicit values, and I was wondering if I could define a parametric equation with ParametricNDSolve and ...
706 views

### Fit data with linear combinations of Cos and Sin

Recall that if $f$ is a piecewise continuous function on the interval $[-\pi, \pi]$, then the Fourier series of $f$ is $$f(x) = \sum_{n=0}^{\infty} (a_n \cos(nx) + b_n \sin(nx)).$$ See for example, ...
3k views

### NonlinearModelFit does not find a good fit

I am trying to fit my data to the following function, $$\frac{a b t \left(\log \left(\frac{-a d t+a t-1}{a d t}\right)-2\right)}{4 (a t-1)}-c$$ ...
143 views

### Minimizing the maximal residual in mathematica

With this: d1 = 10; d2 = 4; mat = RandomReal[{-1, 1}, {d1, d2}]; vec = RandomReal[{-1, 1}, d1]; LeastSquares[mat, vec] ...
867 views

### histogram fit for probability density [closed]

I am trying to fit the (probability density) histogram of some data with the exponential function, but I am having difficulties. My raw data are in file called ...
258 views

### FindFit giving weird values on a logistic equation

I was trying to fit a set of data onto a logistic equation, however it ended up telling me that the initial value when $t=0$ is greater than the maximum limit, thus I am led to believe that it isn't ...
370 views

### Exporting tables of interpolating functions

A few weeks ago I asked a question about manipulating parameters in NDSolve (Looping with NDSolve?) , and received some very helpful advice about the manipulate environment; now I want to take the ...
2k views

### Line of best fit on LogLog plot

I have a LogLog plot, and i'm unsure about how to fit a line to it. The data represents a calibration curve. ...
122 views

### Replicating Excel output using Mathematica

I have 2 columns of data in Excel. One is inputs the other is outputs. I ask Excel to make a graph of that data and to fit the data to a power trendline. Excel does this and it's fine as far as it ...
555 views

### Can't find a fit for Erf

I have the following numbers ...
114 views

### How can I get a fully functional FittedModel when fitting data to a pointwise function?

When I am fitting data with a pointwise function using NonlinearModelFit, the produced FittedModel fails to calculate variances ...
96 views

### Constraining some rows from LeastSquares to lines

For two matrices, A and B, with dimensions {n,p} and ...
154 views

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

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

### Least Square Data Fit /Design Matrix

I am trying to learn how to use the DesignMatrix function in Mathematica and how to perform a LeastSquares fit. I am at end of ...
279 views

### Is it possible to monitor the sum of squared errors in a NonlinearModelFit or FindFit procedure during the process?

Since fitting procedures using NonlinearModelFit (or FindFit) sometimes take very long, I would like to monitor the sum of ...
271 views

### Multi-Fitting with Nonlinear model

I want to fit experimental data by the H-N model. Here is the H-N model: \text{EHN}(T)\text{=}\text{E$\infty$}+\frac{\text{E0}-\text{E$\infty$}}{\left(1+\left(i \omega\tau(T_g)10^{-\frac{\text{C1} ...
565 views

### Fitting a beta distribution to a probability density curve

If I have a spectral data set showing measured energy on the y-axis and frequency on the x-axis, how would I go about fitting this to a beta distribution? For example, lets say I had the data for the ...
183 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: ...