data-fitting

How can fit the data on temperature/thermal profile?

余生长醉 提交于 2019-11-28 14:29:05
I have a dataset consisting of a certain temperature profile and I wanna fit or map the measurement points on temperature profile which is following: Dwell-time: 30 mins Ramp-time: 1 min Number of periods: 1000 cycles Measure points period: 16 mins Measure points can be happened in either in high regim +150 or low regim -40 Note: The T0 (initial time) is not clear so time reference is not clear eg. T0=0 . I already fetched the data in Pandas DataFrame: import numpy as np import pandas as pd from scipy.optimize import curve_fit df = pd.read_csv('D:\SOF.csv', header=None) data = {'A': A[:,0], 'B

Fitting a student t distribution in R using fitdistr() yields error “non-finite finite-difference value”

六月ゝ 毕业季﹏ 提交于 2019-11-28 11:34:51
问题 Reproducable example which will give the mentioned error code every time is: (Note that even without set.seed, the error comes up every time) library(MASS) set.seed(seed = 1) data<-rnorm(n = 10000,mean = 0.0002,sd = 0.001) fitdistr(x = data,densfun = "t") The error message is: Error in stats::optim(x = c(-0.000426453810742332, 0.000383643324222082, : non-finite finite-difference value [2] In addition: Warning message: In log(s) : NaNs produced The problem is the "non-finite finite-difference

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

╄→尐↘猪︶ㄣ 提交于 2019-11-28 08:39:00
问题 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 [800:1250][-2:8] f(x) 'Daten.txt' u 1:2 via a,b g(x) = c*x + d; fit [1258:1650][-2:8] g(x) 'Daten.txt' u 1:2 via c,d plot "Daten.txt" u 1:2 w l, f(x) t title_f(a,b), g(x) t title_g(c,d) it results in a picture i´m not allowed to post... How can i make

Fitting a 2D Gaussian function using scipy.optimize.curve_fit - ValueError and minpack.error

早过忘川 提交于 2019-11-27 06:41:52
I intend to fit a 2D Gaussian function to images showing a laser beam to get its parameters like FWHM and position. So far I tried to understand how to define a 2D Gaussian function in Python and how to pass x and y variables to it. I've written a little script which defines that function, plots it, adds some noise to it and then tries to fit it using curve_fit . Everything seems to work except the last step in which I try to fit my model function to the noisy data. Here is my code: import scipy.optimize as opt import numpy as np import pylab as plt #define model function and pass independant

Fitting a closed curve to a set of points

非 Y 不嫁゛ 提交于 2019-11-27 03:34:48
I have a set of points pts which form a loop and it looks like this: This is somewhat similar to 31243002 , but instead of putting points in between pairs of points, I would like to fit a smooth curve through the points (coordinates are given at the end of the question), so I tried something similar to scipy documentation on Interpolation : values = pts tck = interpolate.splrep(values[:,0], values[:,1], s=1) xnew = np.arange(2,7,0.01) ynew = interpolate.splev(xnew, tck, der=0) but I get this error: ValueError: Error on input data Is there any way to find such a fit? Coordinates of the points:

fitting data with numpy

一曲冷凌霜 提交于 2019-11-27 00:27:36
Let me start by telling that what I get may not be what I expect and perhaps you can help me here. I have the following data: >>> x array([ 3.08, 3.1 , 3.12, 3.14, 3.16, 3.18, 3.2 , 3.22, 3.24, 3.26, 3.28, 3.3 , 3.32, 3.34, 3.36, 3.38, 3.4 , 3.42, 3.44, 3.46, 3.48, 3.5 , 3.52, 3.54, 3.56, 3.58, 3.6 , 3.62, 3.64, 3.66, 3.68]) >>> y array([ 0.000857, 0.001182, 0.001619, 0.002113, 0.002702, 0.003351, 0.004062, 0.004754, 0.00546 , 0.006183, 0.006816, 0.007362, 0.007844, 0.008207, 0.008474, 0.008541, 0.008539, 0.008445, 0.008251, 0.007974, 0.007608, 0.007193, 0.006752, 0.006269, 0.005799, 0.005302,

Getting standard errors on fitted parameters using the optimize.leastsq method in python

我们两清 提交于 2019-11-26 21:25:35
I have a set of data (displacement vs time) which I have fitted to a couple of equations using the optimize.leastsq method. I am now looking to get error values on the fitted parameters. Looking through the documentation the matrix outputted is the jacobian matrix, and I must multiply this by the residual matrix to get my values. Unfortunately I am not a statistician so I am drowning somewhat in the terminology. From what I understand all I need is the covariance matrix that goes with my fitted parameters, so I can square root the diagonal elements to get my standard error on the fitted

Fitting a 2D Gaussian function using scipy.optimize.curve_fit - ValueError and minpack.error

谁说胖子不能爱 提交于 2019-11-26 10:28:35
问题 I intend to fit a 2D Gaussian function to images showing a laser beam to get its parameters like FWHM and position. So far I tried to understand how to define a 2D Gaussian function in Python and how to pass x and y variables to it. I\'ve written a little script which defines that function, plots it, adds some noise to it and then tries to fit it using curve_fit . Everything seems to work except the last step in which I try to fit my model function to the noisy data. Here is my code: import

Fitting a closed curve to a set of points

喜夏-厌秋 提交于 2019-11-26 09:27:13
问题 I have a set of points pts which form a loop and it looks like this: This is somewhat similar to 31243002, but instead of putting points in between pairs of points, I would like to fit a smooth curve through the points (coordinates are given at the end of the question), so I tried something similar to scipy documentation on Interpolation: values = pts tck = interpolate.splrep(values[:,0], values[:,1], s=1) xnew = np.arange(2,7,0.01) ynew = interpolate.splev(xnew, tck, der=0) but I get this

fitting data with numpy

。_饼干妹妹 提交于 2019-11-26 09:18:29
问题 Let me start by telling that what I get may not be what I expect and perhaps you can help me here. I have the following data: >>> x array([ 3.08, 3.1 , 3.12, 3.14, 3.16, 3.18, 3.2 , 3.22, 3.24, 3.26, 3.28, 3.3 , 3.32, 3.34, 3.36, 3.38, 3.4 , 3.42, 3.44, 3.46, 3.48, 3.5 , 3.52, 3.54, 3.56, 3.58, 3.6 , 3.62, 3.64, 3.66, 3.68]) >>> y array([ 0.000857, 0.001182, 0.001619, 0.002113, 0.002702, 0.003351, 0.004062, 0.004754, 0.00546 , 0.006183, 0.006816, 0.007362, 0.007844, 0.008207, 0.008474, 0