An on-line algorithm for fitting straight lines between data ranges

Applications often require fitting straight lines to data that is input incrementally. The case where a data range [<italic>α<subscrpt>k</subscrpt></italic>, <italic>ω<subscrpt>k</subscrpt></italic>] is received at each <italic>t<subscrpt>k</subscrpt></italic>, <italic>t<subscrpt>1</subscrpt></italic> < <italic>t<subscrpt>2</subscrpt></italic> < … <italic>t<subscrpt>n</subscrpt></italic>, is considered. An algorithm is presented that finds all the straight lines <italic>u</italic> = <italic>mt</italic> + <italic>b</italic> that pierce each data range, i.e., all pairs (<italic>m, b</italic>) such that <italic>α<subscrpt>k</subscrpt></italic> ≤ <italic>mt<subscrpt>k</subscrpt></italic> + <italic>b</italic> ≤ <italic>ω<subscrpt>k</subscrpt></italic> for <italic>k</italic> = 1, … , <italic>n</italic>. It may be that no single line fits all the ranges, and different alternatives for handling this possibility are considered. The algorithm is on-line, producing the correct partial result after processing the first <italic>k</italic> ranges for all <italic>k</italic> < <italic>n</italic>. For each <italic>k</italic>, the set of (<italic>m</italic>, <italic>b</italic>) pairs constitutes a convex polygon in the <italic>m</italic>-<italic>b</italic> parameter space, which can be constructed as the intersection of 2<italic>k</italic> half-planes. It is shown that the <italic>O</italic>(<italic>n</italic> log<italic>n</italic>) half-plane intersection algorithm of Shamos and Hoey can be improved in this special case to <italic>O</italic>(<italic>n</italic>).

[1]  D. T. Lee,et al.  An Optimal Algorithm for Finding the Kernel of a Polygon , 1979, JACM.

[2]  Ashok K. Agrawala,et al.  An optimal algorithm for mutual exclusion in computer networks , 1981, CACM.

[3]  O P Buneman,et al.  Automatic recognition of significant events in the vital signs of neonatal infants. , 1979, Computers and biomedical research, an international journal.

[4]  Glenn Ricart Efficient synchronization algorithms for distributed systems , 1980 .

[5]  Michael Ian Shamos,et al.  Geometric intersection problems , 1976, 17th Annual Symposium on Foundations of Computer Science (sfcs 1976).

[6]  Michael L. Baird,et al.  Structural Pattern Recognition , 1981, IEEE Transactions on Pattern Analysis and Machine Intelligence.

[7]  Franco P. Preparata,et al.  An optimal real-time algorithm for planar convex hulls , 1979, CACM.

[8]  J. O'Rourke,et al.  Model-based image analysis of human motion using constraint propagation , 1980, IEEE Transactions on Pattern Analysis and Machine Intelligence.