The revolutionary project management tool is here! Plan visually with a single glance and make sure your projects get done.

Dear All

I have vector of points for the curve..I wanted to retrieve parametric equation of the curve with the help of these points.

Can I do so?If yes ,please guide me for the same.

Thanks.

I have vector of points for the curve..I wanted to retrieve parametric equation of the curve with the help of these points.

Can I do so?If yes ,please guide me for the same.

Thanks.

There are an infinite number of functions that pass through any set of points,

and there are many simple ways of finding some example of such a function,

but deciding which such function is preferable in a given application may not be an easy or well defined problem.

If the parameter values are another set of free variables, that could further multiply the number of potential functions that fit, which can potentially make the problem of finding some example of such a function easier, and can potentially make the problem of finding the preferred example of such a function more difficult.

No parameter are also unknown.

I will explain you what I exactly wanted to do..

I have set of points for the curve/line.Now I wanted to retrieve attributes/property of that curve by which I can redraw that again.(approximatley).

I am not sure whether it is possible or not.Please help as I am quite new to these concepts.

Thanks

Do you know or have reason to expect that the parametric equations will have a particular form?

Can you quantify how approximately you want to redraw the curve?

Can you quantify a trade off between simpler functional forms and closer approximations?

A common algorithm to appxoximate a given type of formula into existing data is the "least squares" method. It's by far to complex to explain here, but for certain cases it's already coded somewhere - just serarch for "least squares fit" and dig thru the results ...

Do you have some sample or dummy data you can share? The more we know, the more we can help.

To fit a parametric curve into a vector of given, exact matching X,Y points, you need to have at least as much X,X points as you have unknown parameters in your formula. Simple example:

If your parametric curve formula reads

But that simple approach fails if there are too few points (which couldn't be cured) or the points are not exactly matching the formula, i.e. due to measurement uncertainties. And here comes the least squares algorithm into account ...

It's usually used with more points than unknown parameters and works by iterative approximation. It uses some start values for the parameters and calculates the deviation of the points from the estimated values of the curve. Each deviation is squared and the squares are summed. That sum is a measurement for the quality of the approximation.

In the next iteration step the algorithm varies the parameters slightly and tries to minimize the sum of squares. By using the squares, two things are achieved: The sum doesn't have to deal with negative values, and points with great deviations have more weight when the parameters are varied. The variation of the parameters follows specific rules and contains differential mathematics ...

You could find a detailled description of the algorithm in the english Wikipedia at the lemma "Least squares (function approximation)" and the more basic article "Least Squares".

see http://blog.ivank.net/interpolation-with-cubic-splines.html for cubic splines.

Sara

There is still not enough information to determine which, if any, of these types your problem belongs to.

@BYTECHINDIA: You'll possibly have to fiddle around with the inital parameter values (start values). If chosen bad, the iteration result might be lousy, or you might end up with not comming to convergence. I've used a software packet named

Then you can draw the sort of curve through the data that would be acceptable for your application.

If you are willing to share the plot and drawing with us, we can all make some progress.

Inverting a matrix is the

But if you don't understand matrix inversion, we may need to go back a few steps.

Do you understand the concept of a matrix representing a system of equations?

The best first step for understanding your data is to plot it.

If you are willing to share the plot and drawing with us, we can all make some progressHowever, there may be reason to be cautious about doing that, because it can make it impossible to judge how likely it would be that any equation that you or we come up with would generalize to the parts of the curve for which you do not have points.

With enough free parameters, you can fit any set of points to an arbitrary accuracy,

so just because an equation fits the points you are given does not give you reason to believe that it will also fit at other places you haven't sampled.

But, when you can fit many points to a good accuracy with few free parameters,

(where "many", "few" and "good" can be given precise mathematical definitions)

then you can make certain probabilistic conclusions about how likely it will be that

the euation will also be a good fit on the points you haven't sampled.

When you apply a specific algorithm, you can quantify the number of free parameters that are being tried.

When you try a bunch of different algorithms, there are ways to quantify the total number of free parameters being tried over the set of all those algorithms.

But it can be very hard to know the set of algorithms tried when people look at a set of points and come up with an equation,

and it can be even harder when a bunch of people look at it, especially when you don't even know how many people are looking at it.

I agree - curve fitting is some kind of fine art. Using it without refering to the neuronal net device between your ears could lead to (euphemistic spoken) very bad fitted results. And using it on a regular computed basis requires underlying data that comes from a well known source ... in a way that the matching function type is well known and good start values of the parameters are easily to be determined.

If not, one has to plot the data and think a bit about it ... choosing a proper function type is done best when one understands the basic properties (i.e. physical laws) behid the data. Proper start values need some consideration, too.

And last but not least, the fitted function is usually of (very) limited use outside of the underlying data range: If the data points the function is fitted into range from x= 1 to X=100, I wouldn't expect usable results for X=1000. Or X=150, to be true.

curve fitting is some kind of fine artIt can be a science, if you follow a careful discipline.

plot the data and think a bitIf you want to be able to justify a statement that a function you come up with has at least a certain probability of being with at least a certain accuracy for points not in your sample set, then that is what you should

choosing a proper function type [which] is done best when one understands the basic properties behind the data

But we still don't know whether the purpose of the curve fitting in question is art, or science.

And you're right - understanding the basics of the data is the first requirement of good curve fitting. But having a plot of the data will help anyhow ...

But when you just "think a bit about it" waiting for the muse to strike, you can't define the space of functions that you were searching through.

Just a faint remark, a bit abroad of pure science:

Sometimes the laws behind the data are present but hidden, anyhow a generic function type might already be sufficient. In that case a plot might help to attract the muse ;-) I know that results from such curve fits are be taken with a hint of sceptic, but nevertheless they might me helpful.

My all-time favorite extrapolation question:

http://www.experts-exchange.com/Programming/Algorithms/Q_24761243.html

I am looking at "least square method"Perhaps it would help if we described the type of data for which least square is most appropriate.

If you know that the data was produced by a process of the form

a*f(x)+b*g(x)+c*h(x)+...+ gaussian random number

for known functions f(x),g(x),h(x),... and unknown parameters values a,b,c,...

and you have data samples of from least as many x points as there are unknown parameter values.

then ordinary least square can produce the maximum likelyhood estimator for a,b,c,...

An efficient method to find those values essentially involves matrix inversion for a matrix of the same order as the number of unknown values you are trying to find.

Based on knowledge of the source or utility of the data, and how much data we are talking about, there can be an art form to selecting an appropriate set of f(x),g(x),h(x),.. functions with which to use this method.

One commonly used set is x^0, x^1, x^2, ...

The main thing here that suggests to me that this problem might not be of that type, is that the x values also seem to be free parameters.

But it sounds like it could be converted into a problem of that type by arbitrarily fixing the x values. e.g. to 0,1,2,...

How well this might fit the intent or requirements of the problem is unknown.

Thanks to all of you for the comments.As I am working on imageprocessing algo using opencv.In opencv I found approxpoly function which basically coverts set of vector points into polynomial which basically help to redraw the curve and can help me for matching purpose also.Currently using that only.The complete overview of project is not yet clear and this is our first project towards image processing,I might have put different question.Currently keeping the question open till the complete picture of project comes out.

Thanks again to all of you for the kind support.

All Courses

From novice to tech pro — start learning today.