curve-fitting

How can optmize fitting data on thermal profile properly?

纵然是瞬间 提交于 2019-12-10 12:26:31
问题 I have tried to fit data on the high and low-temperature regime of the thermal profile, but I couldn't fit properly. According to the experiment report, there should be 3 to 4 measurement points on each level however I couldn't manage it till now due to always there are some points could be outside of thermal profile curve and ruin everything. I checked this post about optimize.curve_fit() , and I'm unsure it can help in my case to optimize it. As it is illustrated in the last picture,

Curve fitting in MATLAB: different result form toolbox vs command line?

廉价感情. 提交于 2019-12-10 11:27:21
问题 This is the data I am using for Y data: 0.577032413537833 0.288198874369377 0.192282280031568 0.143824619265244 0.114952782524097 0.0960518606520442 0.0824041879978560 0.0719078360110914 0.0640919744028295 0.0572120310249072 0.0519630635470660 0.0479380073164273 0.0443712721513307 X is simply the integer value from 1 to 13 and I know that this is power function of form a*x^b+c from running GUI cftool on MATLAB with rather high R-square value (1) To perform the fit on command line, I used: >>

Separating gaussian components of a curve using python

蹲街弑〆低调 提交于 2019-12-10 11:01:03
问题 I am trying to deblend the emission lines of low resolution spectrum in order to get the gaussian components. This plot represents the kind of data I am using: After searching a bit, the only option I found was the application of the gauest function from the kmpfit package (http://www.astro.rug.nl/software/kapteyn/kmpfittutorial.html#gauest). I have copied their example but I cannot make it work. I wonder if anyone could please offer me any alternative to do this or how to correct my code:

I know scipy curve_fit can do better

前提是你 提交于 2019-12-10 02:50:17
问题 I'm using python/numpy/scipy to implement this algorithm for aligning two digital elevation models (DEMs) based on terrain aspect and slope: "Co-registration and bias corrections of satellite elevation data sets for quantifying glacier thickness change", C. Nuth and A. Kääb, doi:10.5194/tc-5-271-2011 I have things a framework set up, but the quality of the fit provided by scipy.optimize.curve_fit is poor. def f(x, a, b, c): y = a * numpy.cos(numpy.deg2rad(b-x)) + c return y def compute_offset

Vertical line fit using polyfit

牧云@^-^@ 提交于 2019-12-10 02:02:15
问题 Its just a basic question. I am fitting lines to scatter points using polyfit . I have some cases where my scatter points have same X values and polyfit cant fit a line to it. There has to be something that can handle this situation. After all, its just a line fit. I can try swapping X and Y and then fir a line. Any easier method because I have lots of sets of scatter points and want a general method to check lines. Main goal is to find good-fit lines and drop non-linear features. 回答1: First

fit to time series using Gnuplot

安稳与你 提交于 2019-12-09 19:22:32
问题 I am a big fan of Gnuplot and now I would like to use the fit-function for time series. My data set is like: 1.000000 1.000000 0.999795 0.000000 0.000000 0.421927 0.654222 -25.127700 1.000000 1994-08-12 1.000000 2.000000 0.046723 -0.227587 -0.689491 0.328387 1.000000 0.000000 1.000000 1994-08-12 2.000000 1.000000 0.945762 0.000000 0.000000 0.400038 0.582360 -8.624480 1.000000 1995-04-19 2.000000 2.000000 0.060228 -0.056367 -0.680224 0.551019 1.000000 0.000000 1.000000 1995-04-19 3.000000 1

Restricting values for curve_fit (scipy.optimize)

拜拜、爱过 提交于 2019-12-09 11:17:22
问题 I'm trying to fit a logistic growth curve to my data using curve_fit using the following function as the input. def logistic(x, y0, k, d, a, b): if b > 0 and a > 0: y = (k * pow(1 + np.exp(d - (a * b * x) ), (-1/b) )) + y0 elif b >= -1 or b < 0 or a < 0: y = (k * pow(1 - np.exp(d - (a * b * x) ), (-1/b) )) + y0 return y As you can see the function i am using has some restrictions on the values it can accept for parameter a and b. Any guess on how to handle the incorrect values? Should the

Stretching out an array

风格不统一 提交于 2019-12-09 10:32:17
问题 I've got a vector of samples that form a curve. Let's imagine there are 1000 points in it. If I want to stretch it to fill 1500 points, what is the simplest algorithm that gives decent results? I'm looking for something that is just a few lines of C/C++. I'll always want to increase the size of the vector, and the new vector can be anywhere from 1.1x to 50x the size of the current vector. Thanks! 回答1: Here's C++ for linear and quadratic interpolation. interp1( 5.3, a, n ) is a[5] + .3 * (a[6]

Linear / Non-Linear Fit to a Sine Curve

徘徊边缘 提交于 2019-12-09 08:12:20
问题 I've had a look at this and this. But I have a slightly different problem. I know that my data is a sine curve, of unknown period and unknown amplitude, with additive non-gaussian distributed noise. I'm attempting to fit it using the GSL non-linear algorithm in C, but the fit is absolutely terrible. I'm wondering if I'm (wrongly) using a non-linear fitting algorithm where I should be using a linear one? How do I tell if a particular dataset requires a linear or a non-linear algorithm? EDIT:

Looking for C/C++ library calculating max of Gaussian curve using discrete values

这一生的挚爱 提交于 2019-12-09 07:56:58
问题 I have some discrete values and assumption, that these values lie on a Gaussian curve. There should be an algorithm for max-calculation using only 3 discrete values. Do you know any library or code in C/C++ implementing this calculation? Thank you! P.S.: The original task is auto-focus implementation. I move a (microscope) camera and capture the pictures in different positions. The position having most different colors should have best focus. EDIT This was long time ago :-( I'just wanted to