Welcome to WebmasterWorld Guest from 23.22.240.119

Forum Moderators: phranque

Message Too Old, No Replies

# Maths challenge: comparing two curves on a graph

#### musicales

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

#### Preferred Member

joined:May 8, 2002
posts:440

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!

#### benevolent001

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

#### Senior Member

joined:Oct 22, 2004
posts:1082

I dont know what u mean by sq...
but
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

#### musicales

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

#### Preferred Member

joined:May 8, 2002
posts:440

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

#### benevolent001

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

#### Senior Member

joined:Oct 22, 2004
posts:1082

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

[cs.fit.edu...]

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

hope this helps

#### musicales

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

#### Preferred Member

joined:May 8, 2002
posts:440

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.

#### benevolent001

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

#### Senior Member

joined:Oct 22, 2004
posts:1082

hmm
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)

#### New User

joined:July 19, 2004
posts:26

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

#### shorebreak

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

#### Senior Member

joined:July 30, 2003
posts:998

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

#### benevolent001

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

#### Senior Member

joined:Oct 22, 2004
posts:1082

You must notice they are squiggly lines

#### Symbios

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

#### Preferred Member

joined:May 28, 2003
posts:420

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

#### midwestguy

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

#### Junior Member

joined:July 27, 2003
posts:79

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,

Louis