Questions tagged [data-fitting]

Data fitting is to fit a line through a data set i.e. a series of data points.

853 questions
4
votes
3 answers

Mathematica: Processing Fit Parameters

I want to access the fit-parameters of a NonlinearModelFit. Here is the code model = a*Cos[b*t + c]; fit = NonlinearModelFit[data, model, {a, b, c}, t, Method -> NMinimize] When I use the command: fit["BestFitParameters"] the values are returned…
4
votes
2 answers

fit a function to a histogram created with frequency in gnuplot

Intro In gnuplot there's a solution to create histogram from file named hist.dat what likes 1 2 2 2 3 by using commands binwidth=1 set boxwidth binwidth bin(x,width)=width*floor(x/width) + binwidth/2.0 plot [0:5][0:*] "hist.dat" u…
DanielTuzes
  • 2,494
  • 24
  • 40
4
votes
1 answer

scipy.optimize.leastsq returns best guess parameters not new best fit

I want to fit a lorentzian peak to a set of data x and y, the data is fine. Other programs like OriginLab fit it perfectly, but I wanted to automate the fitting with python so I have the below code which is based on…
Eoin Murray
  • 1,935
  • 3
  • 22
  • 34
4
votes
1 answer

Linear regression in Objective-C

I´m trying to implement a method that fits a line to a set of points in 2D. I wrote the following code that reads the data from two Array (X, Y coordinate) and should calculate the parameters of the best fitting line with the least squares…
d00d
  • 514
  • 10
  • 20
3
votes
2 answers
3
votes
2 answers

Ellipse fitting to determine rotation (Python)

I am looking to fit an ellipse to some data points I have. What I want: to determine the rotation angle of my data using an ellipse The data: the data I have is in polar coordinates (θ, r) theta = [0.0, 0.103, 0.206, 0.309, 0.412, 0.515, 0.618,…
Sorade
  • 915
  • 1
  • 14
  • 29
3
votes
2 answers

find out the relative contribution of base data set through global fitting using Matlab?

I have obtained 2 data curves (y1 and y2) from my experiment. Both curves have the same x. For each curve, they should be described by their own base data set. y1 = a* bd1_y1 + b* bd1_y2 + (1-a-b)* bd1_y3 y2 = a* bd2_y1 + b* bd2_y2 + (1-a-b)*…
tytamu
  • 555
  • 3
  • 11
  • 20
3
votes
1 answer

Comparison of curve_fit and scipy.odr - absolute sigma

I currently want to fit data with errors in x and y and im using the scipy.odr package to get my results. Im just wondering about the correct use of errors sx and sy. So here is an example. Lets assume im measuring a voltage V for different…
eax
  • 71
  • 1
  • 4
3
votes
2 answers

How to fit a negative binomial, normal, and poisson density function on the same ggplot2 (R) but scaled to the count data?

I have some count data. I want to plot histogram with the count data and add the negative binomial, normal, and Poisson density function but fit the functions to the count data. I tried following this example but (a) I have trouble fitting the…
Rspacer
  • 2,369
  • 1
  • 14
  • 40
3
votes
0 answers

RAM prediction that will be allocated for the mixed models calculation

Is it possible to at least approximately forecast the RAM capacity that will be needed to calculate the mixed models with Julia? (having information about the formula, dataset and server characteristics) Of particular interest is the ability to…
red_quark
  • 971
  • 5
  • 20
3
votes
1 answer

I want to fit a function with integer parameters

I want to fit a function with GNUPLOT that is like a Fourier expansion. I have 3 terms with many parameters that should be integer and real. I don't know how to set some variables to fit as integer numbers I have something like that, where n1,n2,n3…
3
votes
1 answer

MATLAB Curve Fitting in 3D, with additional boundaries

Introduction Let's say I have a set of experimental data, and need to find a polynomial approximation, which describe selected series. The experiment result depends on two variables - time and concentration. Let the exemplary data looks as…
3
votes
2 answers

Unable to fit data due to "can't multiply sequence by non-int of type 'numpy.float64'" error

I'm trying to fit and plot a simple data in a .txt file with a linear function (a*x+b) using matplotlib and scipy. I run into an error concerning the test function: "can't multiply sequence by non-int of type 'numpy.float64'" I have tried changing…
3
votes
1 answer

Error with fitting a Generalized Extreme Value (GEV) using `extRemes` in R?

I have some data and I want to fit a Generalized Extreme Value (GEV) distribution using extRemes package in R. However, an error occurs: library(extRemes) Mydata =…
Yang Yang
  • 858
  • 3
  • 26
  • 49
3
votes
1 answer

how to make a better curve fit while focusin on some better accuracy

the past two days I have been working on a specific data fit (orange line of picture 1 ). Thing is, I want it to be accurate on the bigger θ[0.1,1]. As a matter of fact, I wanted to start at the same point (so for θ=1 we got ψ=1 too) with this…
Billy Matlock
  • 340
  • 2
  • 14