1 view

Given two sets of data over the same interval, I can plot them in the same X-Y graph and can check visually if the two lines converge, diverge or remain 'detached' or 'disconnected' over the interval. The sketches below give some idea of what I mean by each scenario. The first is convergence, the second is divergence, and the last one is a disconnection. As seen, the data are nonlinear.

Given a large collection of such pairs of datasets (the intervals are always the same), what would be a reliable and efficient way to programmatically decide which scenario a pair of dataset belongs to?

A possible (but likely buggy) method is to:

1. divide the interval into halves

2.count the number of intersections between two lines in each half

3. if the number of intersections in the first half is far fewer than that in the second half, then two lines converge

Conversely, the two lines diverge; if no intersection in both the first and the second halves, then the two lines remain detached.

Any suggestions for a better alternative?

by (108k points)

You just have to subtract the values from one of the lines, from the first one and the other one. Now form equal-sized parts on the X-axis (maybe 3-5 of them) and summarize all values in each slice. If the slices manage to get less they are converging. If the slices manage to get higher, they are diverging. You can also firstly check for intersections to discern conversion and diversion from detachment.

If you are looking to learn more about Artificial Intelligence then you visit Artificial Intelligence Tutorial and Artificial Intelligence Course. Also, if you are appearing for job profiles of AI Engineer or AI Expert then you can prepare for the interviews on Artificial Intelligence Interview Questions.