Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

Maths challenge: comparing two curves on a graph



5:14 am on Dec 17, 2004 (gmt 0)

10+ Year Member

Imagine you had two squiggly lines on a graph. Is there any mathematically way to compare their similarity?

This is SEM related research I promise!


5:55 am on Dec 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

I dont know what u mean by sq...
If the lines are in the same plane then simplest way to compare there similarity is there slopes
if the are in different planes then you have to use concepts in 3D geometry


6:02 am on Dec 17, 2004 (gmt 0)

10+ Year Member

3d sounds good - do you know anywhere for a good intro to that subject?


11:37 am on Dec 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

I tried to write here some equations to explian the 3D lines but its not possible here in this forum

any ways you can see this ,its good start for you

First link is for basics


and second one is for finding the distance between two lines which are skew


hope this helps


12:12 pm on Dec 17, 2004 (gmt 0)

10+ Year Member

benevolent001 - thanks very much for your help.

Those links are interesting, but what I am really after when I say "squiggle" is a curved line like a piece of string, perhaps in an S-shape, or in a more complex curving shape. It may have several changes of direction. I would like to find a way to compare the twists and turns of one such line to another line.

I am interested in the 3D aspect too, in which case it becomes more like comparing complex 3d shapes I suppose.


12:18 pm on Dec 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

what i think you might use concepts of angles or slope of tangent to curves at the points where they turn

this would give you idea for similarity between curves

hope this helps


2:18 am on Dec 29, 2004 (gmt 0)

10+ Year Member

You could use a least squares linear regression and then compare the % correlation between these lines. This is used in economics quite often.


7:05 pm on Dec 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Do these lines represent cost and returns on SEM campaigns, by chance?


7:08 pm on Dec 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

You must notice they are squiggly lines


7:17 pm on Dec 29, 2004 (gmt 0)

10+ Year Member

If one of the axis is time based why not convert them to frequency domain using a fast fourier transform then you can make all sorts of comparisons using signal analysis software to look at phase, coherence etc


7:09 pm on Dec 30, 2004 (gmt 0)

10+ Year Member

WOW! This thread makes me think....

What would be the mathematical methods/approaches for comparing "two curves on a graph" -- 2D -- where one "curve" represented price action of an investment such as, for example, the current front month COMEX futures contract price for gold -- and some other "curve", where the second curve is either:

a) another commodity futures contract (like silver futures compared to gold futures for example), or

b) a non commodity "correlating" curve (think US Dollar Index movement compared to the price movement of Gold for example -- and how this correlation strengthens and weakens over time), or

c) some technical analysis indicator like a slow stochastic, RSI, MACD, etc.

One complication is that some technical indicators like stochastics, MACD lines, etc. themselves are made up of two "curves" -- the interplay of which make up the technical indicator's "value".

Basically, my newest hobby is paying attention to (and placing small bets on) options in the futures market, so I'm wanting to develop some method for analysis and predicting probability of future price movements in the futures markets.

I've been using "just" my programmer's brain for about a year to do the above analysis. I predict correctly more often than not, but would like to codify and test out the theories, patterns and correlations I think are predictive.

Not sure the best type of mathematical approaches, methods and tools for doing this.

The posters in this thread really impressed me with their knowledge, thus my question:

What is/are the best type of mathematics for doing the above analysis/correlations/back testing?

Thank you very, very much!

Happy New Year's to all,



Featured Threads

Hot Threads This Week

Hot Threads This Month