best-fit-curve

Simple multidimensional curve fitting

I have a bunch of data, generally in the form a, b, c, ..., y where y = f(a, b, c...) Most of them are three and four variables, and have 10k - 10M records. My general assumption is that they are algebraic in nature, something like: y = P1 a^E1 + P2 b^E2 + P3 c^E3 Unfortunately, my last statistical analysis class was 20 years ago....

Method to find "cleanest" subset of data i.e. subset with lowest variability

Hi all... I am trying to find a trend in several datasets. The trends involve finding the best fit line, but if i imagine the procedure would not be too different for any other model (just possibly more time consuming). There are 3 conceivable scenarios: All good data where all the data fits a single trend with a low variability All ...

Curve fitting unsorted points on a plane

Question: How do you fit a curve to points on a plane if they aren't single valued? For the example shown, how would one fit a curve (like the black one) to the noisy blue data? It's similar to spline smoothing, but I don't know the order of the data. Matlab would be preferred, but pseudocode is fine. Or a pointer to what the correc...

Fitting a step function

I am trying to fit a step function using scipy.optimize.leastsq. Consider the following example: import numpy as np from scipy.optimize import leastsq def fitfunc(p, x): y = np.zeros(x.shape) y[x < p[0]] = p[1] y[p[0] < x] = p[2] return y errfunc = lambda p, x, y: fitfunc(p, x) - y # Distance to the target function x ...