# What is Fitting: Definition and 242 Discussions

Curve fitting is the process of constructing a curve, or mathematical function, that has the best fit to a series of data points, possibly subject to constraints. Curve fitting can involve either interpolation, where an exact fit to the data is required, or smoothing, in which a "smooth" function is constructed that approximately fits the data. A related topic is regression analysis, which focuses more on questions of statistical inference such as how much uncertainty is present in a curve that is fit to data observed with random errors. Fitted curves can be used as an aid for data visualization, to infer values of a function where no data are available, and to summarize the relationships among two or more variables. Extrapolation refers to the use of a fitted curve beyond the range of the observed data, and is subject to a degree of uncertainty since it may reflect the method used to construct the curve as much as it reflects the observed data.

View More On Wikipedia.org
1. ### Analyzing Hysteresis Curve Fitting: Overfitting or Not?

We recently did an experiment to generate the hysteresis curve of a certain material. The experiment involved switching the current in the wire looped around a ring of the material, and recording the first throw of the ballistic galvanometer. I am not going into the details of calculations...
2. ### Power factor of a retrofitted LED unit in a fluorescent fitting

A poster on another forum has fitted a large number of 230V 50Hz 24W nominal LED tubes, apparently designed to be plugged straight into the old fluorescent fittings. He has found, by clamp meter measurement, that the new LED lights appear to be consuming 80W, not the claimed 24W. A number of...
3. ### Nonlinear Equation Fitting: Exploring Solutions

I was trying to fit a set of data to the nonlinear equation $$y=\frac{kx}{5+cx}$$ and find the parameters k,c that will result in a best fit, but (I was told without explanation) that the parameters change as we increase x, so regular fitting techniques such as nonlinear least square will not...
4. ### Circuit equivalent for fitting my data

I did a few experiments recently of impedance spectroscopy, and I've gathered some data that i'm having some issues to find an equivalent circuit that can fit the data. The equivalent circuit that I've got, it's pretty similar with the data (graph and circuit below) But the problem is, at low...
5. ### MATLAB Curve Fitting in MATLAB: Error Diagnosis

I have two 1D matrices X(1,j) and Y(1,j) of equal length. To fit Y to a model asin(bx) I tried: fit = fittype(@(a,b,X), a*sin(b*X)); [fitted, gof] = fit(X, Y, fit) coefficients = coeffvalues(fitted) this gives the message: Error using fittype>iDeduceCoefficients The independent variable x does...
6. ### I A few questions about doing a Gaussian Fit

A few questions about doing a Gaussian Fit : 1) Is gaussian fit and gaussian regression the same thing ? 2) I have a gaussian function that will return a list of gaussian numbers giving an initial list length. So if you input 5 you will get: 1,2,6,4,1. My question is if I have an image and I...
7. ### Software advice on fitting an orifice within a cylinder

I have a stp file (PF does not support it so I cannot upload it here. If there is a way I can share it please let me know) of an orifice and I want to create a new file where the orifice is fit inside a cylinder. What software do you recommend me to use? Thank you! :)
8. M

### Mathematica Fitting solution function of NDSolve with a curve

The following solves an IVP, giving the output as the function f3[x]: s3 = NDSolve[{(-z1[t]^(3/2) + (1 + z1[t]^2)^(3/4))/( 3 (-z1[t] + Sqrt[1 + z1[t]^2])) == z1[t] z1'[t], z1 == 0.0001}, z1, {t, 0, 30} f3[x_] := z1[x] /. First[s3]; My question is, how do I curve fit f3[x] to the...
9. ### I Fitting Data to Grafted Distribution

I have a set of data (representing the strength distribution of samples), and I would like to fit a normal-Weibull grafted distribution. To the left of a specified graft point, the distribution is Weibull, and to the right it's normal. At the graft point, the value and the first derivative are...
10. ### Cramer's rule and first degree polynomial curve fitting

Hi, I did the first degree curve fitting in MATLAB. Please see below which also shows the output for each code line. But I wasn't able to get the same answer using Cramer's rule method presented below. I'm sure MATLAB answer is correct so where am I going wrong with the Cramer's rule...
11. ### Calculate the energy consumption from a double fitting light

Hello everyone. I have a question that as simple as it looks it is making me doubt if I answered the correct solution. A room is illuminated by 12 double fitting 85W fluorescent lights and I got to calculate the energy consumption. I multiplied 12 x 2 because it says it is double fitting but I...
12. ### I Fitting rovibrational molecular data

Hello! I have some data for rovibrational transitions between a ##X^2\Sigma^+## and ##A^2\Pi_{1/2}## and I need to extract the molecular parameters (e.g. B, D, ##\gamma## etc) for the 2 levels. I tried pgopher for a while, using Hund case B and A for the 2 states, respectively. However it...

14. ### I Natural Log Function Fitting

Hello, I'm trying to follow Wolfram to do a least square fitting. There are multiple summations in the two equations to find the coefficients. Are the i's the same in this case? Thanks!
15. ### Python Fitting xtickslabels on a plot (matplotlib)

How could I improve the below code to fit all the xtickslabels on my plot more nicely (i.e. more spacing between the labels, higher resolution)? Thanks! from pyplot import * yearmonthday=['2003-01-01', '2003-02-01', '2003-03-01', ...] #len(yearmonthday) is 155 kwh = [88883, 99221, 100002, ...]...
16. ### I Fitting a SiII curve in a supernova spectra

Hello guys (and girls), I'm trying to determine the dark phase of a type Ia supernovae. In order to do that I need to calculate the photosphere's velocity. So I'm trying to determine the redshift of the Si II in the spectra, by finding the minima in the absorption line. But what kind of...
17. ### I Fitting points z = f(x,y) to a quadratic surface

Hi! I am aware that standard fitting numerical methods like Levenberg-Marquardt, Gauss-Newton, among others, are able to fit a dataset z = f(x,y) to a quadratic surface of the form z = Ax2 + Bxy + Cy2 + Dx + Ey + F, where A to F are the coefficients. Is there a simpler method that exists? I'm...
18. ### I Central Limit Theorem and fitting data

I am working with a simulation which generates an arbitrary number ##n## of identical curves with different phases and calculates their (normalized) sum. As expected, the fluctuation depth of the curves decreases as we increase ##n##. Here is an example of my simulation (when ##n>1##, the...
19. ### MATLAB How to transform a plot to use a logarithmic scale?

I wrote the following code in MATLAB: t = [0:0.001:0.1]; noise = randn(1,size(t,2)); a = 15*10^9; b = 15*10^(-3); c = 7*10^8; y = a*exp(-t/b)+c+noise*100000000; fun = @(p,t)p(1)*exp(-t/p(2))+p(3); p0 = [15.5*10^9, 14*10^(-3), 6*10^8]; p = lsqcurvefit(fun, p0, t, y); t_fit = [0:0.0001:0.1]; y_fit...
20. ### AN Standard 37 degree taper fitting

Does anyone know the reasoning behind the decision to use 37 degrees for the conical taper on an AN fitting? I understand this is a standard dimension for the fittings, but I am hoping to get a little background on how this came to be.
21. ### I Fitting functions based on imperfect data

I have a set of values and I'm trying to come up with functions to fit that data. Here is what I know about the data: It is rounded down / floored to the nearest significant digit (i.e. 1 for v1 and v3, 0.1 for v2). Columns v1 and v3 look linear (e.g. first order polynomial). Column v2 looks...
22. ### I Other linear fitting than least squares

I'm analysing some data and my task is to get a line that best fits the data, using least square I'm getting these dashed curves (red and blue) with low correlation factors. Is there another method that takes into consideration the amount of data placed into the direction of a line?
23. ### Basic doubts about measurements and fitting

Homework Statement Let's say I'm doing a experiment in order to measure a resistance of a single resistor of 200 ohm by its V against I graph, where V is the voltage in the resistor's terminal given by and voltmeter and I the current of the circuit, given by and ammeter. The angular coefficient...
24. ### I Curve fitting the luminosity distance and redshift data

Can anyone recommend papers that directly curve-fit redshift as a function of luminosity distance for type Ia supernova and gamma ray bursts? I am looking for papers that do not curve-fit the data via an assumed model, even one as simple as Friedmann–Lemaître–Robertson–Walker (FLRW) metric. I...
25. ### I Fitting a curve over noisy data

Hi all, I performed a resonance experiment over the past two weeks, in which I collected the intensity of a Fabry-Perot cavity whilst adjusting the mirror distance with a piezo-element (the specific setup of the experiment is fairly detached from the question I will ask). My raw data is...
26. ### Bi-exponential function fitting in Origin Lab SW

I can't understand the exponential function fit for this set of data works well: ExpDec2 exponential function fit 0 3,04 10 2,77 20 2,52 30 2,27 40 2,09 50 1,92 60 1,75 70 1,62 80 1,51 90 1,43 100 1,36 110 1,29 120 1,24 130 1,19 140 1,14 150 1,09 160 1,05 170 1,02 180 0,99 190 0,97 200 0,95 210...
27. ### I Linear fitting in physics experiments with errors

Hello! I have a question that maybe has to do more with Mathematics, but if you do experimental physics you find it quite often. Let's assume that we want to measure two quantities x and y that we know that they relate to each other linearly. So we have a set of data points xi and yi...
28. ### Intensity for Young’s Double Slit Interference

Homework Statement Hi The experimental setup involved a helium neon laser of wavelength 670nm +- 1nm, pointed towards a lens with focal length 500mm +- 1mm. (so that the equations used corresponded to the far field diffraction pattern) and onto a photo diode so that for all intents and...
29. ### MATLAB Parameter fitting with a numerical solution

Suppose I have some experimental data on the diffusion of some concentrate into a cylindrical medium. I don't a priori know the initial concentration or diffusion constant. I have some code to solve the PDE given in the cylindrical domain which solves the equation for given initial...
30. ### I Fitting two models in sequence with parameters in common

I wonder if anyone can please help / point me to some info on how to solve this problem. I posted the same question on another website, and so far there is no conclusive answer. I have some pharmacokinetic data for a molecule that was administered in rat, first IV (intra-venously), then PO...
31. ### I Finding the Right Curve Fit: A Question About Curve Fitting

Hello everyone, A question about curve fitting. Hope you can share some helpful hints. Given some data we plot a graph y versus x. How do we approach the problem from a curve fitting standpoint? For example, using Excel, if the data "looks" linear from the graph, we choose a linear fit and...
32. W

### Capacitor - Least squares fitting

Homework Statement We had a laboration for calculating ε_r in a parallel plate capacitor which we stuffed with plastic plates. All data we picked up was the area A, the distance d (and thus 1/d) and the capacitance C. We are now supposed to use the least squares-method to find ε_r, something we...
33. R

### How to determine max torque of threaded fitting

I am trying to determine the failure mode of an aluminum aircraft fitting. It's a standard AN814-3D, if that matters. Material is 6061-T6. Book tensile strength is 45,000 psi. Thread is a 0.375-24 standard 60 degree UN thread. Thread relief is 0.310 diameter. I.D. of fitting is 0.125 diameter...
34. ### I Fitting a line by minimizing absolute deviation

Hey guys!. I need to use this method of minimization. The procedure to follow is explained here: http://es.tinypic.com/r/35mmtg0/9 However, I do not fully understand. What do I have to do? What I got from the paper is that I only have to minimize the equation 15.7.16, by using bisection. With...
35. ### A Advanced Data Fitting - More than Simple Regressions

Hello All, I want to improve myself in data fitting in order to derive new equations for the data from experimental results and/or performance analysis. I am an engineering researcher and since I found some out-of-world formulations derived from performance data, I need to learn this advanced...
36. ### Statistical weighting of data to improve fitting

Homework Statement I am trying to perform a weighted fit of a data set ##(x,y)## shown below. The only information I have are the two vectors ##x## and ##y## and the uncertainty present in the ##y## values (##=0.001##). Homework Equations The Attempt at a Solution Statistical weighting of...
37. ### Getting Started with XPS Peak Fitting: Questions and Answers

Hi, guys. I'm beginning to fit XPS peaks from a environmental measurement but, as I'm unfamiliar with the exact process I have a lot of doubts. I have solved some of them using the info in http://xpssimplified.com/periodictable.php [Broken] and in the XPS manual from Moulder and Stickle but I'm...
38. ### I Peak profile fitting in X-ray Crystallography, why Voigt?

Hi,I've been doing a lab cycle on X-ray crystallography. We are using Cu X-ray source on chloride salt crystals. It seems that the Bragg peak profile are commonly acknowledged to be a Voigt function, which is a convolution of Gaussian and Lorentzian. I am wondering what's the physical reason for...
39. ### A Curve Fitting Data: Gamma Spectroscopy Lab Results

Hi I have some data from a gamma spectroscopy lab and using a series of known radioactive sources I obtain a calibration curve. The equipment is a scintillation crystal coupled to a photo-multiplier tube connected to a multi-channel analyser to obtain an energy spectrum. Using Excel I add a...
40. ### Fitting a thermocouple to a motor

Hi. It's my first post I work in a manufacturing plant where a hydraulic pump motor has failed. The cause was bearing failure and the motor locked up. The motor still insulation tested ok, but is being sent out for rewind and new bearings I am looking at ways to predict early failure? I want...
41. ### I About chi-squared and r-squared test for fitting data

hi all, i just want you to tell me if my ideas are correct or not : As far as i can see the R^2 test is usually used in OLS (ordinary least squares) method where many conditions for data is showed (something like linearity in coefficients, expectation values for perturbations must be zero, and...
42. ### I Monte Carlo for fitting

Hello I use a python package called emcee to fit a function to some data points. The fit looks great, but when I want to plot the value of each parameter at each step I get the plot.png below. In their example (with a different function and data points) they get the plot1.png image. Why is my...
43. ### I Likelihood of some points fitting a derived function....

Hello! I have some concentrical spheres with many points inside. And I need to plot the total mass of points in each shell (so between 2 spheres) versus the radius of that shell (defined as (r1+r2)/2, where r1 and r2 are the radius of the 2 spheres forming the shell). I have 10 shells so my plot...
44. ### I Fitting circles inside other circles

I'm working on the following fun problem. I have a circle of a given radius, R0. (Green circle in the image). I want to be able to supply a radius of the first circle that is to fit into this large circle. Let's say R1 is 0.75 * R0. Following this I find the best position of R2 (to maximise...
45. ### I Slope of LS line = Cov(X,Y)/Var(X). Intuitive explanation?

The slope of a fitted line = Cov(X,Y)/Var(X). I've seen the derivation of this, and it is pretty straightforward, but I am still having trouble getting an intuitive grasp. The formula is extremely suggestive and it is bothering me that I can't quite see its significance. Perhaps, my mental...
46. ### I Covariance in fitting function

Hello! I have to calculate the covariance between 2 parameters from a fit function. I found this package in Python called iminuit that did a good fit and also calculate the covariance matrix of the parameters. I tested the package on a simple function and I am not sure I understand the result...
47. ### I Question about fitting periodic data

My experience with data fitting is poor so I am in real need for help. The potential in the following is periodic over [0,Pi] I need to find a fitting function that I can use to perform further mathematics. Fourier series does not work, but a 40-degree polynomial give the following fit...
48. ### Curve fitting for Gravity/Conservation of Energy Lab

Homework Statement [/B] The problem has to do with sig figs going down to 1. I've checked them multiple times by hand and with sigfig calculators but it is all the same. With 1 sig fig my standard deviation ends up being 0 which I am not sure that is acceptable. It makes sense as the points are...
49. ### Calculating errors after curve fitting (linearizing) graphs

Homework Statement I did a lab this week measuring periods of swings of a simple pendulum. We need to curve fit the equation T=k*l^n and we got ln(T)=n*ln(l)+ln(k), and we need to plot the data we collected into the linear graph, meaning out y axes is ln(T) and our x axes is ln(l). So far all...
50. ### Curve fitting (Linearization) of functions (and thus graphs)

Ok, first week of first year of undergraduate physics lab and they explain that we want all our graphs to be linear, and in order to do that we can change our x and y axes to be log(x) or y^2 or whatever. They did some simple examples such as y=(k/x)+c and explained that if the x axes is 1/x we...