Title:
Method and system to identify discrete trends in time series
Document Type and Number:
Kind Code:
A1

Abstract:
A signal processing system and method for breaking a time series into piece-wise discrete trends and determining whether new data represents the continuation of a trend. The method identifies and utilizes at least one set of trend determination parameters, which have favorable trend fit characteristics relative to other possible sets of parameters. In a semi-automated embodiment, the error and trend length characteristics are cross-plotted for multiple sets of possible parameters, and one or more of the parameter sets is selected from the graph. In an automated embodiment, an objective function is formulated from the characteristics, and an optimization technique is applied to identify one or more good parameter sets.
Inventors:
Boerner, Sean T. (Corinth, TX, US)
Application Number:
09/815360
Publication Date:
01/09/2003
Filing Date:
03/22/2001
View Patent Images:
Images are available in PDF form when logged in. To view PDFs, Login  or  Create Account (Free!)
Primary Class:
International Classes:
(IPC1-7): G06F017/60
Attorney, Agent or Firm:
Rick, Yeager B. (10805 Mellow Lane, Austin, TX, 78759, US)
Claims:

What is claimed is:



1. A system, for use in an information processing apparatus, for breaking a time series into a plurality of discontinuous trends, the system comprising: input means for inputting time series data, the time series comprising a plurality of data elements; processing means for generating a plurality of sets of trend determination parameters for the time series; selecting a useful group of sets from the plurality of sets of trend determination parameters for the time series, such that the useful group of sets includes at least one member; processing the time series with each member of the useful group of sets of trend determination parameters to generate a set of trends and trend attributes for each member; and output means for outputting the trends for each member.

2. The system of claim 1 wherein the processing means further comprises deciding, based on the composite results of a plurality of the members of the useful group of sets of trend determination parameters , whether the newest data element of the time series represents a continuation of a dynamic trend.

3. The system of claim 1 wherein the input means for inputting time series data further comprises inputting a plurality of time series data sets to a computer; and selecting a particular time series from a plurality of time series data sets.

4. The system of claim 1 wherein the input means for inputting time series data further comprises inputting a plurality of of vector datasets to a computer; and selecting a particular vector data set from a plurality of time series data sets.

5. The system of claim 3 wherein selecting a particular time series from a plurality of time series data sets is comprised of for each of the plurality of time series data sets: selecting at least a portion of the elements in the data set to create a selected data subset; normalizing the selected data subset to generate a normalized subset for the time series; storing the normalized subset on the computer; calculating, on a processor, the slope of a best-fit polynomial regression through the normalized subset; and selecting a particular time series that has a large absolute slope and a large correlation coefficient between the trend and the data elements.

6. The system of claim 1 wherein generating a plurality of sets of trend determination parameters is comprised of specifying a range of values for each of a plurality of trend determination parameters; and generating the sets of trend determination parameters by selecting unique combinations of trend determination parameter values, such that the values are within the range of values for each of the plurality of trend determination parameters.

7. The system of claim 6 wherein specifying a range of values for each of a plurality of trend determination parameters is comprised of specifying a minimum value for a first trend determination parameter of initial data window size; specifying a maximum value for a first trend determination parameter of initial data window size; specifying a minimum value for a second trend determination parameter of deviation limit; and specifying a maximum value for a second trend determination parameter of deviation limit.

8. The system of claim 1 wherein generating a plurality of sets of trend determination parameters for the time series and selecting a useful group of sets from the plurality of sets of trend determination parameters for the time series, such that the useful group of sets includes at least one member is comprised of: specifying a range of potential values for each of a plurality of trend determination parameters; creating an objective function from at least one indications of trend results, such that the objective function generates a resultant value for a set of trend determination parameters; and selecting a useful group of sets of trend determination parameters by applying an optimization procedure to the objective function and the range of potential values for each of the plurality of trend determination parameters.

9. The system of claim 1 wherein selecting a useful group of sets from the plurality of sets of trend determination parameters for the time series is comprised of: for each trend determination parameter set: applying the trend determination parameters to at least a portion of the time series data elements, thereby generating at least one trend and at least one trend attribute parameter; identifying the dynamic trend and at least one dynamic trend attribute parameter. calculating at least one indication of trend results between the time series and the trend set; and storing at least one indication of trend results on the computer; selecting at least one set of trend determination parameters based on at least one indication of trend results for each of the sets.

10. The system of claim 9 wherein applying the trend determination parameters to at least a portion of the time series data elements thereby generating at least one trend and at least one trend attribute parameter is comprised of assigning each of the data elements to at least one trend by generating a first trend with at least a portion of the data elements; identifying the first trend as the current trend; evaluating each subsequent data element to determine whether the data element is a continuation of the current trend, and assigning the data element to the current trend if it is a continuation of the current trend, and assigning the data element to a new trend if it is not continuation of the current trend, and identifying the new trend as the current trend; and determining at least one trend attribute for each trend.

11. The system of claim 9 wherein calculating at least one indication of trend results between the time series and trend set is comprised of calculating at least one measure from the group consisting of: the number of trends in the subset of the time series, the RMS Error between the input data values and trend values, the average trend length; the average trend length divided by the minimum number of data points needed to define a trend (window size parameter), the average percent return of the trends, the summed cumulative percent return of the trends; the fraction of correct predictions, the fraction of incorrect predictions, the quotient of the root mean square error and the average length of the trends divided by the minimum number of data points needed to define a trend, and the RMS error*Ls the efficiency of the trends, where efficiency is defined as the average return of the trends divided by the average length of the trends, and compounded return of the trends.

12. The system of claim 9 wherein selecting at least one set of trend determination parameters based on at least one indication of trend results for each of the sets is comprised of plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters and its associated trend results, where a first axis represents a first measure of trend results and a second axis represents a second measure of trend results; and selecting from the graph at least one data point that represents a trend determination parameters set that has desirable trend results.

13. The system of claim 12 wherein plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters and their associated trend results and selecting from the graph at least one data point that represents a parameters set that has desirable trend results is further comprised of: plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters, where the y-axis represents the product of the root mean square error and the deviation limit for the set of trend determination parameters, and the x-axis represents the average trend length for the set of trend determination parameters; selecting at least one set of trend determination parameters associated with a point from the graph that has a minimum value for the product of the root mean square error and the deviation limit for a given average trend length;

14. The system of claim 12 wherein plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters and their associated trend results and selecting from the graph at least one data point that represents a parameters set that has desirable trend results is further comprised of: plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters, where the y-axis represents the root mean square error for the set of trend determination parameters, and x-axis represents the average trend length for the set of trend determination parameters; selecting at least one set of trend determination parameters associated with a point from the graph that has a minimum value for the root mean square error for a given average trend length;

15. The system of claim 12 wherein plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters and their associated trend results and selecting from the graph at least one data point that represents a parameters set that has desirable trend results is further comprised of: plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters, where the y-axis represents the summed cumulative percent return of the trends for the set of trend determination parameters, and x-axis represents the average percent return for the set of trend determination parameters; selecting at least one set of trend determination parameters associated with a point from the graph that has a maximum value for both the summed cumulative percent return and the average percent return;

16. The system of claim 12 wherein plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters and their associated trend results and selecting from the graph at least one data point that represents a parameters set that has desirable trend results is further comprised of: plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters, where the y-axis represents the summed cumulative percent return of the trends for the set of trend determination parameters, and x-axis represents the fraction of correct predictions for the set of trend determination parameters; selecting at least one set of trend determination parameters associated with a point from the graph that has a maximum value for both the summed cumulative percent return and the fraction of correct predictions;

17. The system of claim 12 wherein plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters and their associated trend results and selecting from the graph at least one data point that represents a parameters set that has desirable trend results is further comprised of: plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters, where the y-axis represents the average percent return of the trends for the set of trend determination parameters, and x-axis represents the fraction of correct predictions for the set of trend determination parameters; selecting at least one set of trend determination parameters associated with a point from the graph that has a maximum value for both the average percent return and the fraction of correct predictions;

18. The system of claim 12 wherein plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters and their associated trend results and selecting from the graph at least one data point that represents a parameters set that has desirable trend results is further comprised of: plotting on a graph a representative data point for each of the plurality of sets of trend determination parameters, where the y-axis represents the average percent return for the trends for the set of trend determination parameters, and x-axis represents the average trend length for the set of trend determination parameters; selecting at least one set of trend determination parameters associated with a point from the graph that has a maximum value for the average percent return for a given average trend length;

19. The system of claim 9 wherein selecting at least one set of trend determination parameters based on at least one indication of trend results for each of the sets is comprised of specifying an objective function that incorporates at least one measure of trend results, such that minimization of the objective function produces desirable trend results; applying an optimization technique to the objective function such that the optimization technique minimizes the objective function; and selecting at least one set of trend determination parameters as a result of minimizing the objective function.

20. The system of claim 1 wherein processing the time series with each member of the useful group of sets of trend determination parameters to generate a set of trends and trend attributes for each member is comprised of for each member applying the trend determination parameters to at least a portion of the time series data elements, thereby generating at least one trend and at least one trend attribute parameter; and identifying the dynamic trend and at least one dynamic trend attribute parameter; and storing at least one dynamic trend attribute parameter on the computer.

21. The system of claim 20 wherein applying the trend determination parameters to at least a portion of the time series data elements thereby generating at least one trend and at least one trend attribute parameter is comprised of assigning each of the data elements to at least one trend by generating a first trend with at least a portion of the data elements; identifying the first trend as the current trend; evaluating each subsequent data element to determine whether the data element is a continuation of the current trend, and assigning the data element to the current trend if it is a continuation of the current trend, and assigning the data element to a new trend if it is not continuation of the current trend, and identifying the new trend as the current trend; and determining at least one trend attribute for each trend.

22. The system of claim 21 wherein generating a first trend with at least a portion of the data elements is comprised of recalling the first trend determination parameter, the data window size, from the set of trend determination parameters; forming a proposed trend data set by selecting a number of data elements from the time series, such that the number of data elements selected is at least as large as the value of the data window size trend determination parameter; calculating a first best-fit curve through the proposed trend data set; and identifying the best fit curve as the first trend.

23. The system of claim 21 wherein evaluating each subsequent data element to determine whether the data element is a continuation of the current trend is comprised of forming a proposed trend data set from the selected data elements; calculating a new best-fit curve through the proposed trend data set; calculating at least one measure of predictive error for the new best-fit curve with respect to the values of the data elements in the proposed trend data set; projecting the best-fit curve to the location of the subsequent data element; evaluating the deviation of the subsequent data element from the projected best-fit curve value at the new location; and applying at least one acceptance criteria to the measure of predictive error, and if the acceptance criteria is met setting the subsequent data element to the proposed trend data set, identifying the new best-fit curve as the current trend, and if the acceptance criteria is not met setting the subsequent data element to a new trend set, determining a new trend, and identifying the new trend as the current trend.

24. The system of claim 23 wherein calculating at least one measure of predictive error for the new best-fit curve with respect to the values of the data elements in the proposed data set is comprised of evaluating the derivative of the best-fit curve; obtaining an estimated value of the best-fit curve at the new element; calculating the residuals between the proposed trend data set and the new best-fit curve; normalizing the residuals; quantifying the spread of the distribution of the normalized residuals; calculating the deviation of predicted trend value at the new element from the actual value of the new element; and normalizing the deviation of predicted trend value at the new element from the actual value of the new element using the spread of the distribution of normalized residuals.

25. The system of claim 23 wherein applying at least one acceptance criteria to the measure of predictive error is comprised of designating a first test criterion as true if the sign of the derivative of the trend curve generated through the proposed trend dataset changes compared to the sign of the derivative of the trend curve generated previously; designating a second test criterion as true if the absolute value of normalized deviation exceeds the deviation limit parameter; designating a third test criterion as true if the absolute value of normalized deviation exceeds the deviation limit parameter and the normalized deviation is in the opposite direction as the direction of the trend as designated by the derivative of the trend curve through the proposed trend dataset; designating a fourth test criterion as true if the correlation coefficient between the proposed trend curve and the proposed trend dataset decreases below the correlation limit parameter; designating a fifth test criterion as true if the number of times that the absolute value of normalized deviation exceeds the deviation limit parameter; and the normalized deviation is in the opposite direction as the direction of the trend as designated by the derivative of the trend curve through the proposed trend dataset; exceeds the number of values parameter; designating a sixth test criterion as true if the absolute value of the normalized deviation from a flat trend exceeds the flat trend deviation limit; and determining whether at least one of the first, second, third, fourth, fifth, and sixth test criteria is true.

26. A system for use in an information processing apparatus for breaking a time series into a plurality of discontinuous trends and determining if a new data element represents a continuation of the latest trend the system comprising: input means for inputting time series data, the time series comprising a plurality of data elements; processing means for generating a plurality of sets of trend determination parameters for the time series by specifying a range of values for each of a plurality of trend determination parameters, and generating the sets of trend determination parameters by selecting unique combinations of trend determination parameter values, such that the values are within the range of values for each of the plurality of trend determination parameters; selecting a useful group of sets from the plurality of sets of trend determination parameters for the time series, such that the useful group of sets includes at least one member by, for each trend determination parameter set: applying the trend determination parameters to at least a portion of the time series data elements, thereby generating at least one trend and at least one trend attribute parameter, identifying the dynamic trend and at least one dynamic trend attribute parameter, calculating at least one indication of trend results between the time series and the trend set, and storing at least one indication of trend results on the computer, selecting at least one set of trend determination parameters based on at least one indication of trend results for each of the sets; processing the time series with each member of the useful group of sets of trend determination parameters to generate a set of trends and trend attributes for each member by applying the trend determination parameters to at least a portion of the time series data elements, thereby generating at least one trend and at least one trend attribute parameter, assigning each of the data elements to at least one trend by generating a first trend with at least a portion of the data elements; identifying the first trend as the current trend; evaluating each subsequent data element to determine whether the data element is a continuation of the current trend, and assigning the data element to the current trend if it is a continuation of the current trend, and assigning the data element to a new trend if it is not a continuation of the current trend, and identifying the new trend as the current trend; and determining at least one trend attribute for each trend, and identifying the dynamic trend and at least one dynamic trend attribute parameter; evaluating at least one new data element for the time series by determining for each member whether the new data element represents a continuation of a dynamic trend; deciding, based on the composite results of the members, whether the data element represents a continuation of a dynamic trend; and output means for outputting the trends for each member.

Description:

FIELD OF INVENTION

[0001] The present invention relates to a computer-implemented system and method to process one or more time-series signals into representative piece-wise discrete trends. Applications include processing prices from financial data such as stocks, options, futures, commodities, currencies, indices, foreign government and municipal securities, bonds, treasury bills, foreign exchange rates, and interest rates; identifying features on a digital electrocardiogram (EKG) output such as anomalous trend lengths, amplitudes, shapes, or coefficients indicative of a problem with the patient; and identifying features from digital signals measured from machinery to investigate and identify problems with the machinery.

SUMMARY OF PRIOR ART

[0002] The prior art includes computational procedures for filtering noisy data. Kostelich and Yorke considered the motion of points around a phase space attractor. (Kostelich, Eric. J. and James A. Yorke, 1990, “Noise reduction: finding the simplest dynamical system consistent with the data”, Physica D v. 41, pp. 183-196. ) They described a method called time delay embedding method to filter noise in chaotic experimental data whose dynamics are low dimensional. In their method, they created a series of vectors of m-dimensional points that are separated by a constant time delay (I.e. if m=3, x i =(s i ,s i+τ ,s i+2τ )). A linear approximation of the vectors (x i ,x i+δ ,x i+2δ ,Λ) separated by a distance δ would make it possible to calculate a linear approximation to the dynamics in the neighborhood of x i . Abarbanel suggested that instead of using strictly linear mappings in the neighborhood of x i , the process could be generalized to include polynomial mappings. (Abarbanel, Henry D. I., Reggie Brown, John J. Sidorowich and Lev Sh. Tsimring, 1993, “The analysis of observed chaotic data in physical systems”, Rev. Mod. Phys. , v. 65, no. 4, October 1993, pp. 1331-1993.)

[0003] U.S. Pat. No. 5,537,368 issued Jul. 16, 1996 to O'Brien Jr. et al., considered the problem of detecting signals from an underwater target. They derived a signal processing system consisting of a series of Kalman filters in parallel to process an incoming signal. Each of the Kalman filters fit a polynomial trend of order i (i=0, 1, 2, . . . ) to a data stream. The coefficients of the polynomial, the data stream, and fit values representing the degree of fit of the polynomial to the data stream were exported to a target motion system to determine the velocity and position of a target.

[0004] U.S. Pat. No. 5,956,702 issued Sep. 21, 1999 to Matsuoka and Golea, noted the problems with using a Kalman filter to process discontinuous changes in the time series trend, and taught a neural network to estimate a discontinuously changing time series trend. Wolberg discussed using non-linear kernel regression to estimate prices at in the future. (Wolberg, John R., Expert Trading Systems: Modeling Financial Markets with Kernel Regression , John Wiley & Sons, Inc., New York, 2000.)

[0005] The regressions are performed over a window that can either move or stay fixed as new points are added. He introduced the concept of a “growing option”, where the values of new points are included in the regression for predicting the next point. After each point is predicted, it is then included in the prediction of the next point. Wolberg did not discuss discontinuities in the regressions, but did point out that regression models that are created in one period of time may not be useful in the future.

SUMMARY OF THE INVENTION

[0006] An embodiment of this invention relates to processing discrete financial time series signals such as stock prices, options prices, futures prices, commodities prices, currency exchange rates, economic and financial indices, foreign government and municipal security prices, bond prices, treasury bill prices, foreign exchange rates, and interest rates. The invention is not restricted to financial applications. In this application, the term “time series” refers to both its literal definition of a string of values, representative of some process continuing through time, each separated by a constant time interval, dt; and a vector of numbers separated by a constant interval or a pair of vectors where one of the vectors contains the location of the data elements in the second vector. In this application, the elements of a time series may be single data points or sets of data points. The vectors data elements don't necessarily have to be equally spaced. For example, a pair of vectors could include the land elevations and locations of those elevations along a trajectory that extends from Dallas to San Francisco.

[0007] Over a period of time, these types of time series exhibit fluctuations, which can be characterized by a plurality of discrete “trends”, where each trend represents a sequence of data elements when the data is generally increasing or decreasing at a certain linear or non-linear rate. Typically the data is “noisy” in that the data points may each deviate from the values defined by the trend. Typically, these trends do not last indefinitely, and it is of great interest to financial managers and others to determine when a trend has ended.

[0008] The current invention addresses the analysis of time series data in a manner that provides useful information about the trends for a particular data set and how accurately those trends track the actual data. The method is based on the observation that while many different sets of discrete trends can be computed for a particular data set, a few of those trend sets are much better at tracking subsequent data than others. In general, the method produces a relatively large number of discrete trend sets for a particular data set; evaluates the relative effectiveness of how well each set tracks the time series over which it was tested, and selects a few of those trend sets that are most effective in that tracking. The method then employs those more effective trend sets to evaluate subsequent data.

[0009] In one embodiment a particular set or vector of time series data may be input to a processor for analysis.

[0010] In an alternative embodiment, the processor may access and analyze multiple sets of time series data to determine one or more sets which meet a selection criteria. Typically this selection criteria is related to relatively strong “trending” over a period of time, and the detection can often be made by a simple first-order, linear regression fit to the data. In that case, frequently the time series datasets that have regressions with larger slopes and higher correlations with the time series garner more interest.

[0011] The selected time series is fed into the processor to derive the optimum parameters for processing the time series. A subset of the time series is used as a “training” set. Inherent in deriving the parameters is the actual processing of the time series into discrete trends. One goal is to find the parameters that minimize the error between the time series and trend values, while maximizing the average length of the trends. Another goal is to find the trends that generate the greatest return from the beginning to the end of the trend. The two goals are not necessarily the same.

[0012] Once the parameters have been selected, they are applied to the time series. In this step, an initial window size (m 1 ) data values are selected from the beginning of the time series. In the preferred embodiment, a polynomial curve, representing the trend, is fit through these data values. Each subsequent data value in the series is then added, and the trend is recalculated. A trend is determined to have ended when either: a) the last data value added to the trend exceeds a standard deviations limit, L s , of normalized deviations from the trend in the direction opposite to that of the trend; or b) the trend direction or derivative changes from positive to negative or vice versa. The last data value that was not part of the last trend becomes the first data value in the new trend. In trends after the first trend, the last m 1 data values from the previous trend are used in addition to the n points from the new trend to fit the trend curve.

[0013] Once the trends have been identified, the trends, the original time series, and other results are exported for further optional processing and to calculate values such as the average length of the trends, the beginning and ending times and/or dates, the beginning and ending data values, and the average of the first derivatives of the trends.

[0014] In applying this tool to multiple financial time series, such as stock prices and interest rate indices, it is apparent that the optimum trend determination parameters and the resulting trends differ from stock to stock. Some stocks are strongly trending, while others display other recognizable characteristics. Some stocks seem to display no apparent patterns after processing with this tool with the options available at this time. This tool has the ability to extract patterns from some seemingly random time series. While the patterns aren't deterministic, there seems to be a character or “personality” in regards to the length and shape of the patterns for many of the stocks processed so far. The trends resulting from different sets of trend determination parameters for a given model illustrate different aspects of that “personality”.

[0015] Specific trends either move up or down or are flat. These different trends identify different “states” of the process. It is reasonable to assume that within a trend that some mathematical methods of prediction or trading might be realized, and that a method of prediction or trading would not necessarily work once the trend had ended. Certain trading systems might work within a flat trend might not work for a trend moving up or down.

[0016] While individual models, each based on a single set of trend determination parameters, may do moderately well in defining when trends begin and end, better models may be achieved by combining the trends from different models to produce a composite model. For example, frequently after a single trend has ended, several very short trends will follow. Some of the trend algorithms described in this application do not do perform well while prices are oscillating within a lateral range. They will produce numerous short trends in these models, which would not be wise to trade. Therefore, several models could be combined so that once a trend ended; the next trend that would be selected would be one that had the most data elements lasted the longest up to that point.

[0017] The methods described in this application only take into account the previous values of a time series or vector to evaluate a new data element to determine whether it is within a trend or not. These methods can be improved to include other information that might affect the prices of a security, including other financial information. A method of doing this is an extension of the regressions described in this application and is multiple regression with additional independent variables.

[0018] One of the outputs of this process is a set of normalized deviations from the dynamic trend. This time series oscillates between positive and negative values and could be used with thresholds as a trading indicator.

[0019] If this method is able to extract a deterministic component of price movement from securities that can be modeled and simulated, then this has ramifications in regards to not only being able to make predictions about the future value of security prices, or to define different “states” in which to trade, but also to how options are priced.

BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above-mentioned and other objects and features of the present invention will become apparent from a reading of the following detailed description with reference to the accompanying drawings, in which:

[0021] FIG. 1 is a flowchart of the major analysis steps.

[0022] FIG. 2 is a detailed flowchart of the time series data set selection steps.

[0023] FIG. 3 is a detailed flowchart of the procedure for deriving the trend determination parameters.

[0024] FIG. 4A is a detailed flowchart of the procedure for processing a time series to derive the trends.

[0025] FIG. 4B is a diagram of the time series and the window length parameters that are used to filter the time series for the first and subsequent trends.

[0026] FIG. 5 is a chart describing the post-processing of the time series trends.

[0027] FIG. 6 is a representative plot of the product of the root mean square (RMS) error and the deviation limit, L s , versus the average trend length for a time series data set with multiple trend determination parameters.

[0028] FIG. 7 is an example of a trend set fit to the closing stock prices for DELL Computer Corporation. The data that were used to select the trend parameters was from Jan. 1, 1994 to Jan. 1, 1999. The selected trend parameters were then applied to the data from Jan. 1, 1994 through Jan. 23, 2001.

[0029] FIG. 8 is a detailed flowchart of the of the procedure for deriving the trend determination parameters for the embodiment—“Alternatives to the Deviation Window Size (m 2 )”

[0030] FIG. 9 is a detailed flowchart of the procedure for processing a time series to derive the trends for the “Correlation Coefficient Measure” embodiment.

[0031] FIG. 10 is a detailed flowchart of the of the procedure for deriving the trend determination parameters for the embodiment—“Statistical Process Control Alternative”

[0032] FIG. 11 is a detailed subset of the flowchart of the procedure for processing a time series to derive the trends for the embodiment—“Statistical Process Control Alternative”

DETAILED DESCRIPTION OF EMBODIMENT

[0033] Selecting a Time Series Data Set

[0034] In this embodiment, a plurality of time series data sets is analyzed in order to identify one or more data sets for further analysis. Referring now to FIG. 1 , which is a flowchart of the major analysis steps, in step 100 each of the data sets is analyzed to determine if the set is strongly trending. For each set, the last M 1 data elements are extracted from the time series, and a line is fit through the points using multiple regression. In this example, M 1 is selected to be about 30 data points, or approximately 1.5 months of data. The normalized slopes and correlation coefficients are recorded. Upon such analysis of each of the data sets, a data set is selected for further analysis. When identifying financial instruments to trade, a time series that has a large increase or decrease in normalized slope with a correspondingly large absolute value of the correlation coefficient would be a likely candidate for subsequent processing. Time series data sets that have a small slope would generally be avoided.

[0035] Referring now to FIG. 2 , which is a more detailed flowchart of the data set selection steps, the initial search is performed through the following steps for each time series data set i:

[0036] In step 110 , each time series data set, y 1,j , j=1, N 1 , where N 1 is the number of elements in time series, is loaded into the processor. Note that a mathematical transform of a time series is also a time series (i.e. y i,j n =ln(y i,j ), j=1,N i is also considered to be a time series).

[0037] In step 120 , an initial window size M 1 , is read by the processor, and the last M 1 data points from the time series, y i,j =y i,N 1 −M 1 +j , j=1,M 1 , are selected.

[0038] In step 130 , the series of the last M 1 data points is normalized by dividing each data point by y i,1 , so that the first data value is 1.0. The normalized time series is designated as y′, where y′ i,1 =1.0. The normalization is performed in order to permit sorting of the data sets on a consistent basis, such as the slope of a line fit through the last M 1 data points. Alternate methods of normalization may be used such as: a) dividing the time series its mean or median; b) ranking the values in the time series and using the ranks instead of the time series values themselves in the regression; or c) calculate the Fourier transform of the time series, zero the zero-th frequency contribution, and back-transform the series back to the time domain.

[0039] In step 140 , a line, y′ i,j =a′ i x i,j +b′ i , is fit through the M 1 data points (x i,j ,y′ i,j ) j=1,M 1 , x i,j =j using linear regression. The slope of the line, a′ i , is stored on the processor so that it may be used as a time series data set selection criterion. Alternate methods of data fitting may be used such as higher order polynomial regression or nonlinear regression. In this embodiment, the average of the first derivatives would be stored on the processor as a′ i .

[0040] In step 150 , if there are remaining time series data sets, steps 110 - 140 are repeated. After each data set has been analyzed in steps 110 - 140 , the results are reviewed in step 160 . In this embodiment, the time series data sets are sorted according to the normalized slopes; a time series data set is selected for further processing and loaded in the processor in step 170 .

[0041] Alternate methods of data set selection may be used such as analyzing both the trend and positive or negative fundamental information. For example, a stock that has both an increasing trend, and a low price to earnings ratio may be a more desirable candidate than an overpriced stock whose trend is just as strong. Similarly overpriced stocks may become good candidates for selling short once they start trending down.

[0042] Generating the Trend Determination Parameters

[0043] Referring again to FIG. 1 , once a time series data set has been selected and loaded in the processor, the trend determination parameters are selected at step 200 . Inherent in this step is a processing of a portion of the time series to derive the parameters. The Initial Window Size (m 1 ) is the size of the first window that is the minimum number of data points needed to define a trend. The Deviation Limit (L s ) is the number of deviations away from the trend that the next day's closing price or additional data value must be to signal a new trend. The deviations are defined as a measure of the spread of a distribution. Common statistical measures of spread of a distribution are variance, standard deviation, inter-quartile range, and range between the minimum and maximum values. In this invention, L s refers to any and all measures of spread of a sample of values.

[0044] Each set of trend determination parameters in combination with the particular data fitting procedure, such as polynomial regression, produces a unique set of trends for a time series data set. At this step of the method, many different sets of trend determination parameters preferably are used to produce corresponding sets of trends. These multiple sets of trends are then evaluated to determine which of the sets are better at matching the current data from the time series data set.

[0045] The trend determination parameters can be selected in several ways. In this embodiment, a subset of the time series, the first M 2 data points of the time series (where N i is the number of data points in the entire time series data set under evaluation) are selected for defining the trend determination parameters. However, the time series is not limited to this embodiment, and trend determination parameters can be derived from any time series or one or more simulations of time series. In this embodiment, the parameter selection is manual so as to allow the selection of more than one set of parameters to generate multiple optimum trends with different trend lengths for a given time series as will be discussed in FIG. 6 .

[0046] Referring now to FIG. 3 , which is a detailed flowchart of the procedure for deriving the trend determination parameters. A set of trend determination parameters is generated in step 200 by looping in increments between minimum and maximum values for each of the trend determination parameters. In this embodiment, two trend determination parameters are used—the Initial Window Size (m 1 ) which is evaluated between a starting value M1MIN and an ending value M1MAX in an increment M1INC; and Deviation Limit (L s ) which is evaluated between a starting value LSMIN and an ending value LSMAX in an increment LSINC. Typical values for these variables are:

[0047] M1MIN=3

[0048] M1MAX=70

[0049] M1INC=1

[0050] LSMIN=1

[0051] LSMAX=20

[0052] LSINC=0.5

[0053] The trend determination minimum, maximum, and increment parameters are determined through experience. If either of the selected trend determination parameter values is equal to M1MAX or LSMAX for a selected trend set, then this would indicate the need to increase the LSMAX or M1MAX values. The M1INC and LSINC are selected with a tradeoff between accuracy and time. M1INC cannot be smaller than 1. The smaller the values for the increments, M1INC and LSINC, the longer it takes to process all of the trends. However, with smaller increments, there is an increased likelihood of obtaining trend parameters that produce more accurate trends. The lower bound Initial Window Size, M1MIN, is limited by the order of the polynomial that one is using for the trend. For a linear trend (a line) one needs at least two points to fit a line. For second-order polynomials, one needs three points to fit a curve to the data points.

[0054] In step 200 , these values are generated in a nested loop resulting in approximately 2,500 sets of trend parameters. Referring again to FIG. 1 , it is usually desirable to process these sets in step 400 as the values are generated. For each parameter set, the following values are calculated and exported:

[0055] the number of trends in the subset of the time series (N Trends );

[0056] the RMS Error between the input data values and trend values;

[0057] the average length of the trends;

[0058] the average trend length/m 1 , where m 1 is the minimum number of data points needed to define a trend;

[0059] the average return (%) of the trends;

[0060] the cumulative return (%) of the trends;

[0061] the fraction of correct predictions, where the initial trend was increasing and the ending price was higher than the initial price, or the initial trend was decreasing and the ending price was lower than the initial price at the beginning of the trend;

[0062] the fraction of incorrect predictions, where the initial trend was increasing and the last price was lower than the initial price, or the initial trend was decreasing and the last price was higher than the initial price;

[0063] the RMS Error/(Average length of the trends/m 1 ); and

[0064] and the RMS error *L s

[0065] the efficiency of the trends (%), where efficiency is defined as the average return of the trends (%)/average length of the trends;

[0066] compounded return of the trends (%)

[0067] Each of these values is stored in the computer with its corresponding set of trend determination parameters (m 1 and L s ).

[0068] Selecting a Set of Useful Trend Determination Parameters

[0069] Referring again to FIG. 1 , at step 300 the values for each of the sets of trend determination parameters are evaluated in order to select one or more useful set of trend determination parameters for a particular time series data set. This step is based on the unexpected observation that trends, based on a given set of determination parameters, that fit one portion of the time series well also tend consistently to fit subsequent portions of the time series as well.

[0070] In a semi-automated method of this embodiment, the RMS error is crossplotted against the average trend length and a subset of the more effective parameter sets are identified from that plot. Referring now to FIG. 6 , which is a plot of the product of the RMS error and the deviation limit, L s , versus the average trend length, the lower line 705 represents a fit of a curve through the trend determination parameter sets that have long trends and low error. The points along or near this curve represent the optimum combination of low error and longer trends for the time series data set. The points that are closest to that line, particularly those points corresponding to longer average trends such as points 710 , 720 , and 730 , are considered to be the most desirable for subsequent analysis of the time series data. In this embodiment, several values that have the maximum “Average Trend Length” for a minimum “RMS error * L s ” are selected. More than one set of trend parameters is selected so that multiple trends can be generated. Generally two to three sets are selected for subsequent analysis, though other users may have different uses for the tool and may select more or less depending upon their purposes. Each trend picks up different features, and the trend produced by one set of trend parameters may be more useful during one period of time versus the trend produced by another set of trend parameters.

[0071] In other embodiments, other types of error measures such as other λ p norms, where p is a real number, may be used. For example, the λ 1 norm is very commonly used for robust estimation in problems that have large outliers (Tarantola, Albert, Inverse Problem Theory: Methods for Data Fitting and Model Parameter Estimation Elsevier, N.Y., 1998.). There are numerous other measures of error that can be employed based on probability distributions and are not limited to λ p norms. These include those based on a Lorentzian distribution, Andrew's sinc, and Tukey's biweight (Press, William H., Brian P. Flannery, Saul A. Teukolsky, and William T. Vetterling, Numberical Recipes in C: The Art of Scientific Computing , Cambridge University Press, 1989.). In some embodiments, this semi-automated step of visual examination of the results can be replaced by an automation of the process by establishing one or more objective functions. In the case of this type of automation, there are numerous, well-known optimization techniques that may be employed to find good parameter sets without the exhaustive generation of parameter sets described in the section above.

[0072] Processing the Time Series with Trend Determination Parameter Sets

[0073] Referring again to FIG. 1 , when one or more trend determination parameter sets are selected, they are applied to process the time series and to generate the trends at step 400 . The result of this step is a set of trends for each trend determination parameter set as each new data point is considered for the time series.

[0074] FIG. 4A is a detailed flowchart of the processing of a time series at step 400 for determining whether or not a new data point represents a continuation of a trend. For each selected trend determination parameter set (m 1 , L s ), the latest trend is updated with each new sequential value of data for the time series data set. In this embodiment, a trend is described by a best-fit polynomial curve through all of the data within the trend and some number of data values from the previous trend. As a consequence, the current trend is dynamic and will be updated as each value of new data arrives. Once the trend changes, the previous trends are no longer dynamic.

[0075] A new trend is defined to have begun when one of the following occurs:

[0076] The derivative of the trend changes from positive to negative or vice versa; or

[0077] The number of deviations that the difference between the last closing price or sequential data element and the predicted trend value meets or exceeds L s , the deviation limit, and the deviation is in the opposite direction to that of the trend. If the difference meets or exceeds L s , but the deviation is in the same direction as that of the trend, then the trend is maintained. The reason for this is to maintain longer trends. There is less confidence in shorter trends. In some applications, such as financial management, the determination that new time series data is consistent with a longer upward or downward trend is more important than whether the magnitude of that trend has changed. In other applications, it is more important that the data be fitted better by a new trend, so the trend wouldn't be maintained.

[0078] Referring to FIGS. 4A and 4B , the processing is accomplished through the following steps:

[0079] In step 410 , load the time series, y i,j , j=1, N 1 , where N 1 is the number of elements in time series i.

[0080] Initialize the trend determination parameters in step 420 . The trend determination parameters are m 1 , the first window size; L s , the deviation limit; and m 2 , the second window size. The first window size is the minimum number of data points needed to define a trend. In this embodiment, the deviation limit is the number of deviations away from the trend that the next day's closing price or additional data value must be to signal a new trend. The deviations are defined as a measure of the spread of a distribution. Common statistical measures of spread of a distribution are variance, standard deviation, inter-quartile range, and range between the minimum and maximum values. In this patent application, L s refers to any measure of spread of a sample of values. In this embodiment, the second window size is equal to m 1 for the first iteration, and is equal to n+m 1 for subsequent iterations where n is the length of a trend. This is the number of data values at the end of the trend's time series that are used to calculate a test measure of spread.

[0081] Set j, the time series index, to m 1 +1 in step 430 .

[0082] Set n, the number of points in the current trend to 0 in step 440 .

[0083] For each trend, check to see if the current value, y 1,j , is in the trend in steps 450 - 530 .

[0084] For the First Trend

[0085] In step 450 , select_m 1 values from the beginning of the segment of interest in the time series.

[0086] In step 460 , calculate a best-fit curve f j (x), through the m 2 data points. (x 1,k ,y 1,k ), x 1,k =[k−(j−m 2 )+1], k=(j−m 2 ), j−1. The subscript j in f j (x) refers to the function estimate at index j, when evaluating whether y 1,j is in the trend or not. In the preferred implementation, least squares regression is used to determine a best-fit polynomial through the data points. However, the curve in this patent application is not restricted to a polynomial function nor to a polynomial function of any particular order. The curve can be another mathematical function, such as an exponential or logarithmic function. It could also be the estimate derived from a neural network or Kalman filter. Least squares regression (λ 2 norm) is the preferred method used to calculate the curve, f j (x), but this is not restricted to a λ 2 norm. The invention is patent application includes other methods that can be used to determine the fit of a curve to a set of points. This includes other λ p norms, where p is a real number.

[0087] In step 470 , evaluate the derivative 1 f j ( x ) x | x i , j - i embedded image

[0088] at the point x i,j−1 =m 2 and obtain an estimated value of the curve, f j (x i,j ) at index j. Note that the derivative is also calculated at index j, where x i,j =m 2 +1.

[0089] In step 480 , calculate the correlation coefficient (R) between the pairs of values, (y i,k ,f j (x i,k )), k=(j−m 2 ), j−1. The correlation coefficient is not critical to the process, but it is useful diagnostic information that is output for further analysis.

[0090] Calculate the residuals, d k , between the time series values, y 1,j , and the trend values, f j (x 1,j ) in step 490 . Although it is unnecessary in most cases, it is sometimes desirable to normalize the residuals, such as by dividing by the trend values. The purpose of this normalization is to ensure homoscedasticity of the deviations. If the series is trending up or down within a single trend, then the non-normalized deviations at the beginning of the trend will have a different variance than the non-normalized deviations at the end of the trend. Alternatively, other methods of normalization may be employed, such as dividing by a moving average of the trend. 2 d k = [ ( y i , k - f j ( x i , k ) ) f j ( x i , k ) ] , k = ( j - m 2 ) , j - 1 ( 1 ) embedded image

[0091] Calculate the standard deviation, s j−1 , of the residuals, d k in step 500 . The standard deviation is used in this embodiment; however, it is only one of many measures of the spread of a distribution. The invention includes other measures of spread, such as the variance, range, inter-quartile range, root mean square, differences between any quantiles of a distribution, or a measure of spread from a neural network.

[0092] Calculate the deviation between the predicted trend value and the actual value, y i,j at x i,j in step 510 . The invention includes either normalizing by dividing by the trend value, f j (x i,j ), or not normalizing. Other methods of normalization may be employed, such as dividing by a moving average of the trend. 3 d j = [ ( y i , j - f j ( x i , j ) ) f j ( x i , j ) ] ( 2 ) embedded image

[0093] Normalize the deviation, d j in step 520 . 4 d j = d j s j - 1 ( 3 ) embedded image

[0094] Test to determine whether the trend has changed at step 530 . In this embodiment, the trend changes if the sign of the first derivative, d j , has changed from the previous iteration to the current iteration (equation 4): 5 If { sign [ f j ( x ) x x i , j - 1 ] sign [ f j - 1 ( x ) x x i , j - 2 ] } , then true ( 4 ) embedded image

[0095] The trend also changes if the normalized deviation, d′ j , exceeds L s in the opposite direction to that which the trend is going. In an alternate embodiment, the trend may be determined to have changed if only the absolute value of the normalized deviation exceeds the deviation limit. 6 If { [ abs ( d j ) > L s ] AND { [ ( f j ( x ) x x i , j > 0 ) AND ( d j < 0 ) ] OR [ ( f j ( x ) x x i , j < 0 ) AND ( d j > 0 ) ] } } , then true ( 5 ) embedded image

[0096] If the trend does not change at step 530 , then increment n to n+1 at step 550 .

[0097] If the trend does change at step 530 , then set n=0 at step 540 .

[0098] Increment j at step 560 .

[0099] At step 570 , if j<N i , then repeat steps 450 - 560 for the next data point in the data set. If the last point of the time series is still within the first trend, then go to step 600 and calculate trend attributes.

[0100] For Subsequent Trends

[0101] Select m 2 values at step 450 . m 1 of the values are from the end of the previous trend, and n values are from the current trend. Calculate the best-fit curve, f j (x), through the m 2 data points at step 460 .

[0102] In step 470 , evaluate the derivative 7 f j ( x ) x | x i , j - i embedded image

[0103] at the point x i,j−1 =m 2 and obtain an estimated value of the curve, f j (x i,j ) at index j. The derivative may also be calculated at index j, where x i,j =m 2 +1.

[0104] In step 480 , calculate the correlation coefficient (R) between the pairs of values, └y i,k , f j (x i,k )┘, k=(j−m 2 ), j−1.

[0105] Calculate the residuals, d k , between the time series values, y i,j , and the trend values, f j (x i,j ) in step 490 . Optionally, the residuals may be normalized as described above.

[0106] Calculate the standard deviation, s j−1 , of the residuals, d k in step 500 .

[0107] Calculate the deviation between the predicted trend value at step 510 , as described previously.

[0108] Normalize the deviation at step 520 , as described previously. Test to determine whether the trend has changed. 530 , as described previously. If the trend changes then set n=0 at step 540 . If the trend doesn't change, then increment n at step 550 . Increment j at step 560 .

[0109] At step 570 , if j<N i , then repeat steps 450 - 560 for the next data point in the data set. If the last point of the time series has been reached (j≧N i ), then go to step 600 and calculate trend attributes.

[0110] The procedure preferably outputs the following arrays for each trend parameter set. There are N i elements in each array. They can either be analyzed by themselves or output to a post-processing procedure to calculate statistics on the trends as shown in FIG. 5 .

[0111] Date or index array

[0112] Data array (y i,j ), j=1, N i .

[0113] Data value change=ln(y i,j /y i,j−1 ), j=1,N i

[0114] Trend codes array

[0115] d′, the array of normalized deviations from the trend.

[0116] Array of minimum closing prices allowed based on trend

[0117] Array of maximum closing prices allowed based on trend

[0118] Array of the first derivatives of the dynamic trend

[0119] Array of the first derivatives of the normalized dynamic trend. The data values at the beginning of the trends are normalized to one, so that the initial trend data value is one for all trends. The derivative of the trend fit to the normalized data values can be compared to the derivatives of the other trends for filtering purposes. Alternate methods of normalization may be used as described previously. This can include: a) dividing the time series values in the trend by its mean or median; b) ranking the values in the trend and using the ranks instead of the time series values themselves in the regression; or c) calculate the Fourier transform of the time series values in the trend, zero the zero-th frequency contribution, and back-transform the series back to the time domain.

[0120] Array of the first derivatives of the final trend.

[0121] Array of correlation coefficients (R) of the final trend line through the data values for each index i.

[0122] The array of final trend line values once a trend has been finalized.

[0123] An array of the differences between the data values and the trend values.

[0124] FIG. 6 represents trends fit to a time series. The data that were used to select the trend parameters are the closing prices of Dell Computer Corporation from Jan. 1, 1994 through Jan. 1, 1999. The parameters were then applied to the closing prices from Jan. 1, 1994 through Jan. 23, 2001.

[0125] Determining Attributes of Each Trend

[0126] Referring again to FIG. 1 , after determining whether a new point represents the continuation of a current trend, a number of attributes of each of the trends are calculated or updated in step 600 . For each of the set of trend determination parameters, each trend is characterized.

[0127] Referring now to FIG. 5 , which is a post-processing chart for the trends of a time series, the trends are counted in step 610 , and statistics for each of the trends are calculated in steps 610 - 710 . The statistics include:

[0128] Determining the beginning date or index for each trend at step 620 ;

[0129] Determining the ending date or index for each trend at step 630 ;

[0130] Determining the beginning data value in each trend at step 640 ;

[0131] Determining the ending data value in each trend at step 650 ;

[0132] Determining the trend length at step 660 ;

[0133] Determining the average trend correlation at step 670 ;

[0134] Setting a flag at step 680 to indicate the direction of the trend, where up=+1, flat=0, and down=−1;

[0135] Determining the fraction of changes in data values that were increasing relative to the previous data value for each trend at step 690 ;

[0136] Determining the fraction of changes in data values that were decreasing relative to the previous data value for each trend at step 700 ; and

[0137] Determining the average slopes or first derivatives of each trend at step 710 .

[0138] In this embodiment, a series of arrays is output, each containing N Trends elements, where N Trends is the number of trends derived from the time series.

[0139] Implications of the End of a Trend

[0140] One of the uses of this invention is to provide an unbiased method for assessing whether the fluctuations in the prices of a financial instrument are normal fluctuations around a trend, or whether they are indicative of a change in the trend itself. In the first case, negative deviations from the trend provide buying opportunities if the trend is positive. In the second case, where the tool would provide an indication that the trend itself is changing; a change in the trend would provides an opportunity to reassess the potential direction of prices for a financial instrument. Other tools, such as the fundamental analysis of a stock's potential could be assessed to determine whether a position in a stock should be changed. For example, assume that a stock is in an uptrend. A downward change in the trend would provide a signal that the trend has changed and that the position needs to be re-evaluated. In another example, if the stock has a positive fundamental position, but the stock is in a downtrend, this tool would be used to assess when the downtrend has ended and signal an opportunity to purchase the stock at an even cheaper price.

DETAILED DESCRIPTION OF ALTERNATE EMBODIMENT

Non-Constant Interval Between the Samples in a Vector

[0141] This alternate embodiment relates to steps 200 through 400 . It is an alternative method for processing time series datasets with vectors of values that have non-constant spacing between the values. Instead of a time series being represented by y i,j , j=1, N i , a vector is now represented by (x i,j , y i,j ), j=1, N i where x i,j represents some measure of the location or time for each sampled data value y i,j .

[0142] For example, (x i,j , y i,j ), j=1, N i can represent the times and prices for individual trades that arrive at a non-constant interval of time.

[0143] Selecting a Vector Data Set

[0144] In this embodiment, as in the first embodiment, a plurality of vector data sets is analyzed in step 100 to identify one or more data sets for further analysis. The difference is that the values in the vector are no longer at a constant spacing. Therefore, the last M 1 data elements are no longer applicable, because the last M 1 data elements would represent different amounts of time, distance, or other variable that is used to represent the location x i,j of each of the data values y i,j . Therefore, instead of using a constant number of last points, it is desirable to use a constant measure of x i,j called ΔX, and a minimum number of points that are necessary to fit the initial curves, M Min . The number of points that are in the time span of ΔX and are greater than M Min will be referred to as M i . A curve will be fit through the data elements (x i,j ,y i,j )=(x i,N i −M 1+j ,Y i,N i −M 1 +j ), j=1, M i using multiple regression.

[0145] As in the first embodiment, the normalized derivatives and correlation coefficients are recorded. Upon such analysis of each of the data sets, a data set is selected for further analysis. When identifying financial instruments to trade, a vector that has a large increase or decrease in normalized derivative with a correspondingly large absolute value of the correlation coefficient would be a likely candidate for subsequent processing. Vector data sets that have a small slope would generally be avoided.

[0146] Referring now to FIG. 2 , which is a more detailed flowchart of the data set selection steps, the initial search is performed through the following steps for each time series data set i:

[0147] In step 110 , the each vector data set, (x i,j ,y″ i,j ), j=1, N i , where N i is the number of elements in vector, is loaded into the processor. Note that a mathematical transform of a vector is also a vector. (i.e. (x i,j ,y″ i,j )=(x i,j ,ln(y i,j )), j=1,N i is also considered to be a vector).

[0148] In step 120 , an initial window size ΔX, is read by the processor, and the last M i data elements, where M i ≧M Min , are selected from the vector data set. (x i,j ,y i,j )=(x i,N i −M 1 +j ,y i,N i −M 1 +j ), j=1, M i .

[0149] In step 130 , the series of the last M i data elements is normalized by dividing each data element by y i,1 , so that the first data value is 1.0. The normalized vector is designated as y′, where y′ i,1 =1. The normalization is performed in order to permit sorting of the data sets on a consistent basis, such as the slope of a line fit through the last M i data elements. Alternate methods of normalization may be used such as: a) dividing the vector by its mean or median or b) ranking the values in the vector and using the ranks instead of the vector values themselves in the regression.

[0150] In step 140 , a line, y′ i,j =a′ i,j +b′ i , is fit through the M i data points elements (x i,j ,y′ i,j ) j=1, M i , using linear regression. The slope of the line, a′ i , is stored on the processor so that it may be used as a time series data set selection criterion. Alternate methods of data fitting may be used such as higher order polynomial regression or nonlinear regression. In this case, the average of the first derivatives would be stored on the processor as a′ i .

[0151] In step 150 , if there are remaining vector data sets, steps 110 - 140 are repeated.

[0152] After each data set has been analyzed in steps 110 - 140 , the results are reviewed in step 160 as in the first embodiment.

[0153] Generating the Trend Determination Parameters

[0154] Referring again to FIG. 1 , once a time series data set has been selected and loaded in the processor, the trend determination parameters are selected at step 200 . Inherent in this step is a processing of a portion of the time series to derive the parameters. The parameters include_the Initial Window Size (m 1 ) and Deviation Limit (L s ) as discussed in the first embodiment, and an additional parameter, Initial Window Length (ΔX 1 ), which is the size of the first window. This parameter is the minimum length of data needed to define a trend. It must have more than m 1 number of elements. In this embodiment, m 1 acts only as the minimum number of elements that must be in ΔX 1 . If this method is being applied to tick data for example, a value of m 1 =30 over a time interval, ΔX 1 =30 minutes would represent reasonable values.

[0155] Each set of trend determination parameters in combination with the particular data fitting procedure, such as polynomial regression, produces a unique set of trends for a vector data set. At this step of the method, many different sets of trend determination parameters are used to produce corresponding sets of trends. These multiple sets of trends are then evaluated to determine which of the sets are better at matching the current data from the vector data set.

[0156] The trend determination parameters can be selected in several ways. In this embodiment, a subset of the vector, the first M 2 data points, representing some length ΔX 2 of the vector, where N i is the number of data elements in the entire vector data set under evaluation, are selected for defining the trend determination parameters. However, the vector is not limited to the preferred implementation. The parameters can be derived from any vector including other financial vectors as well as one or more simulations of the vector. In this embodiment, the parameter selection is manual as in the first embodiment.

[0157] Referring now to FIG. 3 , which is a detailed flowchart of the procedure for deriving the trend determination parameters. A set of trend determination parameters is generated in step 200 by looping in increments between minimum and maximum values for each of the trend determination parameters. The process is the same as in the first embodiment, except that M1MIN, M1MAX, and M1INC refer to the Initial Window Length (ΔX 1 ).

[0158] Selecting a Set of Useful Trend Determination Parameters

[0159] Referring again to FIG. 1 , at step 300 the values for each of the sets of trend determination parameters are evaluated in order to select one or more useful sets of trend determination parameters for a particular vector data set. This process is the same as in the first embodiment.

[0160] Processing the Vector Data Set with Trend Determination Parameter Sets

[0161] Referring again to FIG. 1 , when one or more trend determination parameter sets are selected, they are applied to process the vector data set and to generate the trends at step 400 . The result of this step is a refreshed set of trends for each trend determination parameter set as each new data point is considered for the time series.

[0162] FIG. 4A is a detailed flowchart for determining whether a new data point represents a continuation of a trend or not. For each selected trend determination parameter set (ΔX 1 , L s ), the latest trend is updated with each new sequential value of data for the vector data set. As in the first embodiment, a trend is described by a best-fit polynomial curve through all of the data within the trend and some length of values from the previous trend. As a consequence, the current trend is dynamic and will be updated as each value of new data arrives. Once the trend changes, the previous trends are no longer dynamic.

[0163] A new trend is defined to have begun as described in the first embodiment.

[0164] Referring now to FIG. 4 A, which is a detailed flowchart of the processing of a time series at step 400 to determine the trends for a given trend determination parameter set (ΔX 1 , L s ). The processing is accomplished through the following steps:

[0165] In step 410 , load the vector, (x i,j ,y i,j ), j=1, N i , where N i is the number of elements in vector i.

[0166] Initialize the trend determination parameters in step 420 . The parameters are ΔX 1 , the Initial Window Length; L s , the deviation limit; and ΔX 2 , the second window size. In this preferred embodiment, ΔX 2 is equal to ΔX 1 for the first iteration and n+ΔX 1 for subsequent iterations, where n is the number of points in a trend. This is the length of data values at the end of the trend's vector data set that are used to calculate a test measure of spread.

[0167] Set j to Δm+1 in step 430 .

[0168] Set n, the number of points in the current trend to 0 in step 440 .

[0169] For each trend, check to see if the current value, (x i,j ,y i,j ) is in the trend in steps 450 - 570 .

[0170] For the First Trend

[0171] In step 450 , select_ΔX 2 length of values from the beginning of the segment of interest in the vector data set. Because the number of data points represented by ΔX 2 will probably be variable, represent the number of data points represented by ΔX 2 be Δm.

[0172] In step 460 , calculate a best-fit curve, f j (x), through the Δm data points. (x i,k , y i,k ), x i,k =[k−(j−Δm)+1], k=(j−Δm), j−1. The subscript j in f j (x) refers to the function estimate at index j, when evaluating whether (x i,j ,y i,j ) is in the trend or not. 8 d k = [ ( y i , k - f j ( x i , k ) ) f j ( x i , k ) ] , k = ( j - Δ m ) , j - 1 ( 6 ) embedded image

[0173] Calculate the standard deviation, s j−1 , of the residuals, d k in step 500 . This is similar to what is described in the first embodiment, except that there is a difference in the calculation of the statistics. The normal equation of the standard deviation is: 9 s j - 1 = k = 1 Δ m ( d k - d _ ) 2 Δ m ( 7 ) embedded image

[0174] where {overscore (d)} is the average of the d k values. However, this assumes a constant spacing between the sample values represented by d k . Because the values in the vector are not sampled on a constant spacing, the values must be weighted to account for this non-constant spacing. 10 s j - 1 = k = 1 Δ m w k ( d k - d _ ) 2 where d _ is the weighted average of the d k values . ( 8 ) d _ = k = 1 Δ m ( w k d k ) ( 9 ) w k = 1 2 ( x i , k - x i , k - 1 ) + 1 2 ( x i , k + 1 - x i , k ) ( x i , Δ m - x i , 1 ) , k = 2 , ( Δ m - 1 ) ( 10 ) w 1 = 1 2 ( x i , 2 - x i , 1 ) ( x i , Δ m - x i , 1 ) ( 11 ) w Δ m = 1 2 ( x i , Δ m - x i , Δ m - 1 ) ( x i , Δ m - x i , 1 ) and k = 1 Δ m w k = 1. ( 12 ) embedded image

[0175] The weighted population standard deviation is used in this embodiment; however, this is only one of many measures of the spread of a distribution. This patent includes, but is not limited to, other measures of spread, such as the sample standard deviation, the population or sample variance, range, inter-quartile range, differences between any quantiles of a distribution, or a measure of spread from a neural network.

[0176] Steps 510 through 570 are the same as in the first embodiment with the modifications to steps 450 through 500 as described previously.

[0177] For Subsequent Trends

[0178] Select Δm+1 values at step 450 . ΔX 1 length of the values are from the end of the previous trend, and n values are from the current trend.

[0179] Calculate the best-fit curve, f j (x), through the Δm data points at step 460 .

[0180] In step 470 , evaluate the derivative 11 f j ( x ) x | x i , j - i embedded image

[0181] at the point x i,j−1 , and obtain an estimated value of the curve, f j (x i,j ) at index j.

[0182] In step 480 , calculate the correlation coefficient (R) between the pairs of values, └y i,k ,f j (x i,k )┘, k=(j−Δm), j−1.

[0183] Calculate the residuals, d k , between the time series values, y i,j , and the trend values, f j (x i,j ) in step 490 . This is the same as in the first embodiment, except that m 2 has been replaced by Δm.

[0184] Calculate the standard deviation, s j−1 , of the residuals, d k in step 500 using equation 3. The weighted population standard deviation is used in this embodiment, however, this is only one of many measures of the spread of a distribution. The invention includes other measures of spread, such as the sample standard deviation, the population or sample variance, range, inter-quartile range, differences between any quantiles of a distribution, or a measure of spread from a neural network.

[0185] Steps 510 through 570 are the same as in the first embodiment with the modifications to steps 450 through 500 as described previously.

[0186] The procedure preferably outputs the same arrays for each trend parameter set as described in the first embodiment. The only difference is that instead of exporting the data array, (y i,j ), j=1, N i , the routine will export the data pairs arrays, (x i,j ,y i,j ), j−1, N i .

[0187] Determining Attributes of Each Trend

[0188] As in the first embodiment, a number of attributes of each of the trends are calculated or updated in step 600 .

[0189] Referring now to FIG. 5 , which is a post processing chart for the trends of a time series, steps 610 through 710 are the same as in the first embodiment, except for:

[0190] Determining the beginning time or location for each trend at step 620 ;

[0191] Determining the ending time or location for each trend at step 630 ;

[0192] Determining the average trend correlation at step 670 ; This will be a weighted average as described above in step 500 .

[0193] Determining the average slopes or first derivatives of each trend at step 710 . This will be a weighted average as described above in step 500 .

[0194] 9

DETAILED DESCRIPTION OF ALTERNATE EMBODIMENT

Time Series Data Elements with Multiple New Data Values

[0195] This embodiment refers to step 200 through 400 in FIG. 1 . It is alternative method to describe the ability to consider adding multiple values to the trend at once versus only adding a single value at a time.

[0196] The difference is that instead of considering data elements to be individual points: (x i,j ,y i,j ), j=1, N i , a data element is an aggregate of points within some neighborhood. For example, let (x′ i,j ,y′ i,j ), j=1, N a refer to aggregates of points, where N a is the number of aggregate points under