Questions tagged [data-fitting]

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

853 questions
5
votes
1 answer

Global distribution fitting sharing some parameters without any specification of the bin size in python

I have several data sets that fit separately very well to a vonMises distribution. I am looking for a way of fitting all of them sharing mu but with different kappas without to care about the election of the bins. When one wants to fit with only one…
alpelito7
  • 435
  • 2
  • 10
5
votes
1 answer

Gaussian data fit varying depending on position of x data

I am having a hard time trying to understand why my Gaussian fit to a set of data (ydata) does not work well if I shift the interval of x-values corresponding to that data (xdata1 to xdata2). The Gaussian is written as: where A is just an…
andrerud
  • 146
  • 1
  • 11
5
votes
4 answers

Finding the point of a slope change as a free parameter- Python

Say I have two lists of data as follows: x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] y = [1, 2, 3, 4, 5, 6, 8, 10, 12, 14] That is, it's pretty clear that merely fitting a line to this data doesn't work, but instead the slope changed at a point in the…
kb3hts
  • 165
  • 1
  • 4
  • 9
5
votes
1 answer

How to use uncertainties to weight residuals in a Savitzky-Golay filter.

Is there a way to incorporate the uncertainties on my data set into the result of the Savitzky Golay fit? Since I am not passing this information into the function, I asume that it is simply calcuating the 'best fit' via an unweighted least-squares…
RobG
  • 51
  • 2
5
votes
1 answer

gnuplot - get errors on fit parameters, get fit output values as variables, print variable to screen

Initial Question (Partially Answered) I am using gnuplot's fitting routines to fit a function to some data, and extract a "characteristic decay time constant". (I call this parameter d in my fitting function.) I have used the script code set fit…
5
votes
3 answers

How To Fit Multivariate Normal Distribution To Data In MATLAB?

I'm trying to fit a multivariate normal distribution to data that I collected, in order to take samples from it. I know how to fit a (univariate) normal distribution, using the fitdist function (with the 'Normal' option). How can I do something…
5
votes
1 answer

Fitting distribution with fixed parameters in SciPy

Is it possible to fix parameters while fitting distributions in SciPy? For example, this code: import scipy.stats as st xx = st.expon.rvs(size=100) print st.expon.fit(xx, loc=0) results in non-zero location (loc). When some parameter is provided to…
Vladimir
  • 1,363
  • 2
  • 14
  • 28
5
votes
1 answer

How can i reduce the linear fit plot to a certain interval?

what i do is to fit two linear function´s to my data. i know how to select the data for the various fitting functions. My problem is that i want the fitted lines only to be plottet in a certain interval. What i did till now: f(x) = a*x + b; fit…
esrehmki
  • 177
  • 1
  • 7
5
votes
3 answers

Transform data to fit normal distribution

I have a rather easy-to-understand question. I have a set of data and I want to estimate how good this data fit a standard normal distribution. To do so, I start with my code: [f_p,m_p] = hist(data,128); f_p = f_p/trapz(m_p,f_p); x_th =…
fpe
  • 2,700
  • 2
  • 23
  • 47
5
votes
1 answer

Fitting 2-D splines to noisy data with gaps using scipy.interpolate.LSQBivariateSplines

I have a numpy array with rectangular data on a grid and would like to fit a 2-D spline to it to reproduce the large-scale variations while getting rid of all/most of the noise. The data also has some regions marked as invalid with values of NaN. I…
rkotulla
  • 51
  • 1
  • 3
4
votes
3 answers

Difficulty fitting piecewise linear data in R

I have the following data (cost of a product vs. time) that looks like the following: annum <- c(1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919) cost <- c(0.0000, 18.6140, 92.1278,…
4
votes
1 answer

How can I fit this sinusoidal wave with my current data?

I have some data I gathered analyzing the change of acceleration regarding time. But when I wrote the code below to have a good fit for the sinusoidal wave, this was the result. Is this because I don't have enough data or am I doing something wrong…
4
votes
1 answer

Why is there a difference between do(lm...) and geom_smooth(method="lm")?

I have an external calibration curve that slightly goes into saturation. So I fit a polynomial of second order, and a dataframe of measured samples, of which I'd like to know the concentration. df_calibration=structure(list(dilution = c(0.1, 0.2,…
TobiO
  • 1,335
  • 1
  • 9
  • 24
4
votes
1 answer

Calculating the centroids of two superposed gaussian functions

I am trying to find a solution to the following problem. I have a set of points which should model a sum of 2 Gaussian functions centered at different points. I need to find these two points. Up to now my approach has been to find the centroid of…
4
votes
0 answers

Fitting Compound Distributions with R

I am trying to fit a compound distribution (Normal - Poisson) to a given data: d2<-c(5,2,1,3,0,0,8,0,4,0,9,1,0,3,15,0,0,0,10,10,16,10,5,10,10,5,5,0,0,0,0,0,0,0,0,0,0,0) My R code is as follows: library("fitdistrplus") library("Compounding") cc <-…
Meliodas
  • 41
  • 1
1 2
3
56 57