# Tagged Questions

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

882 views

### In a ListPlot of LinearModelFit, plot error band

This is similar to this question. The fitted line can be plotted alongside with the data with this code: Show[ListPlot[data], Plot[lm[x], {x, 0, 5}]] I would ...
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} ...
141 views

### Estimated Variance in LinearModelFit

Suppose that lmModel is a linear model which is fit using LinearModelFit. How come ...
79 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 ...
184 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 ...
169 views

### Troubles with FindFit for ODE

I need to use FindFit for ODE with arbitary number of parameters. This code (from documentation) works: ...
2k views

### How to enter an equation into FindFit?

I have the equation ...
126 views

### Simultaneous plotting

For my experiment, I have to simultaneously fit the real part and imaginary part of cavity reflection data which is given here column 1: frequency, column 2: reflection magnitude, column 3: phase I ...
306 views

### Find the best fitting function for some experimental data

I am almost new in Mathematica, and so I have some problems that may appear basic for you. I am given a set of data taken from an experiment. I am supposed to find the curve that best fits them. The ...
60 views

### Is this behavior of DistributionFitTest together with StableDistribution a bug?

I have been using DistributionFitTest to fit the following data: ...
535 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 ...
309 views

### Fitting the Plot by fourier Series of either sine or cosine

I have list of data and its plot and I don't know how to fit the plot with fourier series of either sine or cosine. Full Data: ...
529 views

### Fitting one function to another

I'd like to see how close I can fit an exponential function to a cosine function in the domain of $\;-\frac{\pi}{2}$ to $\frac{\pi}{2}$ in the least squares sense. ...
101 views

### How do I test for the occurrence of an error message and act on it?

I want to see how well some curves fit a data set. If a curve doesn't fit after 100 iterations, I get the error cvmit. How do I test for and handle this error ...
104 views

### Fitting problem

I have two points stored in data: data = {{0.0166667, 2.86927*10^-12}, {0.0333333, 1.12725*10^-11}}; ...
185 views

### FindFit with a sophisticated function (integral)

I am trying to find a fit to the distribution function (empiricial data) in terms of a function which is itself an integral of a product of two simpler functions (two polynomials), that is the model. ...
190 views

### Automatically detect higher slope in numerical data (within a certain range)

Suppose the dataset data is part of some simulations whose results should follow a certain model. Here is data and its ...
206 views

### FindFit with parameters which are simultaneously in initial conditions

I have RLC circuit. I would like to find R and L by using FindFit, but L is in initial condition and I have problem with it. Could you help me ? ...
674 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: ...
888 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 ...
1k views

### Having Trouble Fitting Complicated Exponential Function with FindFit

I am working on high pressure shock experiments and am trying to figure out a the temperature of a sample under strong shocks. I have a measure value from 4 wavelengths of a pyrometer and am using a ...
140 views

### Ordinary Least Squares (OLS) with RLink

I need to calculate the parameters b0, b1 and b2 in: ...
181 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: ...
84 views

### Finding NonlinearModelFit of multiple data sets with the same parameters and in two dimensions

I have multiple sets of data (between 3 and 6 depending on the cases) dependent of space, time, and some parameters. The data are the response of a harmonic oscillator under a non-trigonometrical ...
123 views

### How to get the “AdjustedRSquared” from FittedModel

This my result of model fit: ...
113 views

### Why is TimeSeriesForecast linear?

When I use FinancialData with TimeSeriesForecast, the resulting graph is always linear and thus not very accurate. ...
51 views

### Displacement around the x axis, how to change a function location

While plotting a function I want to change the location of x. I am doing a regression with the logistic function ...
477 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 ...
168 views

### Saving data from NonlinearModelFit

If you use NonlinearModelFit the results are put into some sort of output package. How do you save these packages so that you can go back to them later? My particular problem is that I generating ...
446 views

### FindMaximum of loglikelihood in Gaussian Process

I am trying to implement a Gaussian Process and have problems to maximize the loglikelihood because the function consists of a determinant of a matrix that is dependent of 2 variables and the product ...
72 views

### Filtering Background with resonance or Peaks

I have some data, the blue curve which I want to filter out the background to get a flat signal with dips(Idea is to divide signal (except the dips) by the background). The orange curve is my best ...
59 views

### Looking for a convenient way to replace a large data sample with an analytic approximation

Suppose that data is a large data sample, and that Histogram[data] produces a very smooth-looking distribution. Since ...
583 views

### SinglePredictionBands versus MeanPredictionBands from NonlinearModelFit

From my Statistics lectures I know the term confidence and prediction interval, whereas the confidence interval is smaller than the prediction interval. If I plot the mean and single prediction bands ...
358 views

### How do I find the best fit?

I am trying to solve following system of three differential equations ...
148 views

### Estimate parameters of AR1 process

I am trying to estimate the parameters of a series $Z_t=W_t^\beta$, where W_t follows an AR1 process with mean 2, $\rho=0.9$ and $\sigma=0.1$: $W_t = \rho W_{t-1} + (1-\rho) \bar{W} + \epsilon_t$ ...
231 views

### Judging the quality of fitting an EventData object to a distribution using LogRankTest

I have $389$ data points defined in an EventData object and want to judge the quality of fit of this data to a fitted $3$-parameter Weibull distribution. This ...
683 views

### Generating a “best fit” curve to a set of noisy data corresponding to a moving object

Please note that this is an extension of a previous question: Interpolating a sparse list of two-dimensional coordinates We have an ordered array of coordinates corresponding to the position of an ...
722 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. ...
1k views

### Error message from evaluating NonlinearModelFit

I am trying to fit data to a Morse potential using NonlinearModelFit as follows: ...
47 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 ...
98 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, ...
59 views

### LinearModelFit gives bad fit for simple data set [closed]

I want to fit the rather simple data set: ...
101 views

### How to find the best fit for given input data? [closed]

I have the following data: ...
360 views

### Fitting data to a complicated function

So, where to begin. I have a certain dataset that I want to fit to a function. However, the function is rather complicated (matrix inversions, linearsolve) and does in general not have a closed form ...
377 views

### Fitting data to plot using errors as weights [closed]

I have some enzyme kinetics data that I want to fit to the Michaelis-Menten curve in order to obtain the kinetic parameters of the enzyme. Is it meaningful, statistically and functionally speaking, ...
161 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 ...
174 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 ...
516 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, ...