Forecasting by blending algorithms to optimize near term and long term predictions
Described is time-weighted blending of the results of time series algorithms in a manner that changes their relative weights based on the prediction time. The prediction values from each algorithm are mathematically blended into a forecast result corresponding to the desired time of prediction. In this manner, an ARTXP algorithm that provides accurate near term predictions is given more weight than an ARIMA for near term predictions, and less relative weight for long term predictions. An example exponential function to compute the relative weights is described; the function corresponds to a curve having a control variable for the slope and the start of the curve, and constant coefficients, with the weights based (in part) on the prediction time. A user-provided parameter may also affect the relative weights used in the blending result.
Latest Microsoft Patents:
- Developing an automatic speech recognition system using normalization
- System and method for reducing power consumption
- Facilitating interaction among meeting participants to verify meeting attendance
- Techniques for determining threat intelligence for network infrastructure analysis
- Multi-encoder end-to-end automatic speech recognition (ASR) for joint modeling of multiple input devices
In general, a time series algorithm attempts to predict a future result based on past data. Microsoft Corporation provided a time series algorithm in SQL Server based on an algorithm referred to as ARTXP (Auto regressive tree with cross prediction) for forecasting.
The ARTXP algorithm is highly optimized for near term predictions, and thus very good at forecasting them. However the algorithm's accuracy degraded for long term predictions. It was occasionally unstable for long term predictions which made it sometimes unusable beyond the first few time stamps for which a forecast was requested.
In a later version, namely SQL Server 2008, forecasting was implemented via the well-known ARIMA (Auto regressive integrated moving average) algorithm for time series forecasting. ARIMA is known to have stable long term forecasting characteristics.
SUMMARYThis Summary is provided to introduce a selection of representative concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used in any way that would limit the scope of the claimed subject matter.
Briefly, various aspects of the subject matter described herein are directed towards a technology by which a time series forecast is determined by blending the results of two (or more) time series algorithms in a manner that changes their relative weights based on the prediction time. Upon receiving input corresponding to a desired time of prediction (e.g., a time step), the time series algorithms each produces a prediction value. The prediction values are mathematically blended into a forecast result corresponding to that desired time of prediction.
For example, a first (e.g., ARTXP) algorithm provides accurate near term predictions, whereby blending the prediction values into the forecast result gives more weight to the first algorithm relative to the second (e.g., ARIMA) algorithm when the desired time of prediction is near term. Conversely, when the desired time of prediction is long term, blending the prediction values gives more weight to the second algorithm relative to the second algorithm.
In one aspect, the blending of the prediction values uses an exponential function to compute the relative weights. The function corresponds to a curve having a control variable for the slope and the start of the curve, and constant coefficients, with the weights based (in part) on the prediction time. A user provided parameter may also affect the weights used in the blending result.
Other advantages may become apparent from the following detailed description when taken in conjunction with the drawings.
The present invention is illustrated by way of example and not limited in the accompanying figures in which like reference numerals indicate similar elements and in which:
Various aspects of the technology described herein are generally directed towards blending the results of two (or more) time series algorithms in a manner that provides more optimal near term and long term predictions. In one aspect, an exponential degrading technique is used to blend the ARTXP and ARIMA algorithms for more optimal forecasting.
More particularly, instead of relying on ARTXP, the technology described herein employs a second algorithm, ARIMA which provides more stable long term predictions, and implements a degrading blending method for the outputs of the two algorithms, to favor ARTXP for near term and ARIMA for long term predictions. Any resulting forecasts are more optimal and stable, in that those for near term predictions are more weighted in favor of ARTXP, while those for long term since are weighted in favor of ARIMA.
While the examples described herein are directed towards blending two algorithms, namely ARTXP for near term forecasting, and ARIMA for long term forecasting, based on the desired forecast step/time, it is understood that these are only examples. For example, other time series algorithms may be used, and more than two may be blended (e.g., one favoring short term, one for medium term and one for long term predictions). Further, while an exponential weighing function is used for blending, other functions may be used, including with different shapes, starting points and so forth. Still further, while the weight of the short term decreases with time and the long term increases with time, it is understood that time is only one way to change weighting, and other factors such as variance, sample number and so forth that are not necessarily time data may be used to degrade one algorithm's result going forward.
As such, the present invention is not limited to any particular embodiments, aspects, concepts, structures, functionalities or examples described herein. Rather, any of the embodiments, aspects, concepts, structures, functionalities or examples described herein are non-limiting, and the present invention may be used various ways that provide benefits and advantages in computing and forecasting in general.
As generally represented in
ARTXP uses a decision tree to split the input training set data 104 into nodes and then computes an auto regressive formula on each leaf node for the prediction. It has been observed that ARTXP is very accurate for predicting when given initial (near term) time steps, but the accuracy degraded and was occasionally unstable for long term predictions.
Training for ARIMA is well known and is not described herein, except to note that the same training data 104 is used to generate both sets of patterns. Each algorithm may then use its respective pattern, maintained in a respective data store 111 or 112; note that the dashed line indicates that the pattern datasets may be maintained in one physical and/or logical store.
To summarize the training phase, the training data 104 is passed to the algorithms 101 and 102, which process the data in parallel. After the training is completed, the training patterns obtained from the algorithms are stored for later usage.
In one example implementation in which ARTXP and ARIMA are the algorithms, to obtain the advantages of ARTXP for near term predictions and improve the stability for the long term predictions using ARIMA, the blending method combined the output of the algorithms in a manner that weighs each algorithm's contribution based on the time of the prediction, that is, near term predictions favor ARTXP and long term predictions favor ARIMA. One mechanism for such degrading blending is an exponential curve with a control variable for the slope and the start of the curve, and constant coefficients (chosen experimentally) for more optimal performance.
Another consideration in developing the blending mechanism 224 is to allow the user some control over the blending, e.g., via a user variable (parameter 229). For example, one variable is in the range from zero to one [0, 1] for controlling the starting point for blending and the rate of degradation of the weights. When the variable is set to zero, the output is ARTXP only; when it is one, the output is ARIMA only. Anything in between is a mixed output, yet still favoring ARTXP in the short term and ARIMA for long term.
One example function for blending is set forth below:
W(T)=(1−p)*e−pC(T-1)
where
-
- W: is the weight Function
- T: is the prediction time step (1, 2, 3, 4 . . . )
- p: is the user variable in the range [0,1], default value being 0.5
- c: is an empirical constant whose value has been experimentally determined for optimal forecasting.
The blending for ARTXP and ARIMA for any time step T is a weighted average of the output where the weights are assigned as:
ARTXP(T)=W(T)
ARIMA(T)=1−W(T)
By way of example,
By way of summary,
Step 502 represents receiving the parameter 229 (or parameters) that a user may provide, e.g., the “p” user variable in the above equation. Step 504 represents receiving the time step T for which a prediction is being requested.
Step 506 represents passing the time step as input to each algorithm, which each output a forecast, and also providing the time step value to the blending mechanism for use in its blending calculation. Step 510 outputs the blended result.
In some forecasting scenarios, multiple forecasts for different times are desired, e.g., the predicted sales for each of the next four months. Step 512 represents processing additional input, e.g., so that the user need not individually feed each month's time step in as input.
It should be noted that a time series algorithm computes future predictions based on existing data, along with any predicted data that is needed to get to the desired time. For example, if monthly historical data is available through July, and the request is for an October forecast, the time series algorithm computes predicted August and September data in order to compute the October data. As can be readily appreciated, with two algorithms the example August and September data may be computed independently to obtain separate October data, which is then blended into a final result. As an alternative, however, the August data may be computed and blended, then that blended result used to compute the two September data results, which in turn may be blended into a combined September result that is then used to obtain the two October results, which are then blended into the final result.
Other blending algorithms are feasible. For example, instead of an exponential function, a linear function may be used. Instead of a gradual function, the function may be more discrete, e.g., solely use one algorithm (or some large percentage thereof) up to time X, and use the other algorithm after time X. If percentages are used, e.g., eighty/twenty before time X, they need not be same ratio after time X, e.g., ten/ninety may be used after time X, for example. Further, there may be more than one weight/percentage switching time, e.g., times X1, X2, X3 and so forth may each switch the algorithms' relative contributions, such as performed via a table lookup or the like. In this manner, for example, observed variances as to when ARTXP becomes more and more unstable, each resulting in less and less of ARTXP's execution, may be used to implement a blending mechanism.
Exemplary Operating Environment
The invention is operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known computing systems, environments, and/or configurations that may be suitable for use with the invention include, but are not limited to: personal computers, server computers, hand-held or laptop devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, embedded systems, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The invention may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and so forth, which perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in local and/or remote computer storage media including memory storage devices.
With reference to
The computer 610 typically includes a variety of computer-readable media. Computer-readable media can be any available media that can be accessed by the computer 610 and includes both volatile and nonvolatile media, and removable and non-removable media. By way of example, and not limitation, computer-readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by the computer 610. Communication media typically embodies computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, RF, infrared and other wireless media. Combinations of the any of the above may also be included within the scope of computer-readable media.
The system memory 630 includes computer storage media in the form of volatile and/or nonvolatile memory such as read only memory (ROM) 631 and random access memory (RAM) 632. A basic input/output system 633 (BIOS), containing the basic routines that help to transfer information between elements within computer 610, such as during start-up, is typically stored in ROM 631. RAM 632 typically contains data and/or program modules that are immediately accessible to and/or presently being operated on by processing unit 620. By way of example, and not limitation,
The computer 610 may also include other removable/non-removable, volatile/nonvolatile computer storage media. By way of example only,
The drives and their associated computer storage media, described above and illustrated in
The computer 610 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 680. The remote computer 680 may be a personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to the computer 610, although only a memory storage device 681 has been illustrated in
When used in a LAN networking environment, the computer 610 is connected to the LAN 671 through a network interface or adapter 670. When used in a WAN networking environment, the computer 610 typically includes a modem 672 or other means for establishing communications over the WAN 673, such as the Internet. The modem 672, which may be internal or external, may be connected to the system bus 621 via the user input interface 650 or other appropriate mechanism. A wireless networking component 674 such as comprising an interface and antenna may be coupled through a suitable device such as an access point or peer computer to a WAN or LAN. In a networked environment, program modules depicted relative to the computer 610, or portions thereof, may be stored in the remote memory storage device. By way of example, and not limitation,
An auxiliary subsystem 699 (e.g., for auxiliary display of content) may be connected via the user interface 650 to allow data such as program content, system status and event notifications to be provided to the user, even if the main portions of the computer system are in a low power state. The auxiliary subsystem 699 may be connected to the modem 672 and/or network interface 670 to allow communication between these systems while the main processing unit 620 is in a low power state.
CONCLUSIONWhile the invention is susceptible to various modifications and alternative constructions, certain illustrated embodiments thereof are shown in the drawings and have been described above in detail. It should be understood, however, that there is no intention to limit the invention to the specific forms disclosed, but on the contrary, the intention is to cover all modifications, alternative constructions, and equivalents falling within the spirit and scope of the invention.
Claims
1. In a computing environment, a method comprising:
- receiving input corresponding to a desired time of prediction;
- providing the input to each of a plurality of time series algorithms;
- receiving a prediction value from each of the time series algorithms; and
- blending the prediction values into a forecast result corresponding to that desired time of prediction, based at least in part on the input corresponding to a desired time of prediction, wherein blending the prediction values into the forecast result comprises computing an exponential function based at least in part on a value corresponding to the desired time of prediction, the exponential function corresponding to a curve having a control variable set for a slope and a start of the curve, and one or more constant coefficients.
2. The method of claim 1 wherein the plurality of time series algorithms comprises a first algorithm and a second algorithm, wherein the first algorithm provides accurate near term predictions, and wherein blending the prediction values into the forecast result comprises weighing the prediction value of the first algorithm to have more weight relative to the second algorithm when the desired time of prediction is near term.
3. The method of claim 1 wherein the plurality of time series algorithms comprises a first algorithm and a second algorithm, wherein the first algorithm provides unstable long term predictions, and wherein blending the prediction values into the forecast result comprises weighing the prediction value of the second algorithm to have more weight relative to the first algorithm when the desired time of prediction is long term.
4. The method of claim 1 wherein the exponential function is: W(T)=(1−p)*e−pC(T−1) where W represents the weight function, T represents a prediction time step corresponding to the desired time of prediction, p represents a user variable, and c represents a constant.
5. The method of claim 4 wherein the plurality of time series algorithms comprises an autoregressive tree cross-prediction (ARTXP) algorithm and an autoregressive integrated moving average (ARIMA) algorithm, and wherein blending the prediction values comprises assigning weights factors based on the result of computing the exponential function as: weight of ARTXP(T)=W(T), and weight of ARIMA(T)=1−W(T).
6. The method of claim 1 further comprising, receiving a user parameter, and wherein blending the prediction values into a forecast result comprises applying the user parameter to affect a relative weight value computed for each algorithm.
7. The method of claim 1 further comprising, training each algorithm of the plurality.
8. In a computing environment, a system comprising:
- at least one processor;
- a memory, communicatively coupled to the at least one processor and containing processor executable instructions, comprising:
- a first time series algorithm;
- a second time series algorithm;
- a blending mechanism coupled to receive output from each algorithm, the blending mechanism including an exponential function for computing the relative weights, and each algorithm and the blending mechanism configured to receive input corresponding to a prediction time, the first and second algorithms configured to provide first and second prediction results corresponding to the prediction time, and the blending mechanism configured to use the prediction time to blend the prediction values into a forecast result.
9. The system of claim 8 wherein the blending mechanism uses the prediction time to determine relative weights for the first and second algorithms that are based upon the prediction time.
10. The system of claim wherein the first algorithm comprises an autoregressive tree cross-prediction (ARTXP) algorithm.
11. The system of claim 8 wherein the first algorithm comprises an autoregressive integrated moving average (ARIMA) algorithm.
12. The system of claim 8 wherein the first algorithm provides accurate near term predictions, and wherein the blending mechanism weighs the prediction value of the first algorithm to have more weight relative to the second algorithm when the prediction time corresponds to a near term time.
13. The system of claim 8 wherein the first algorithm provides unstable long term predictions, and wherein the blending mechanism weighs the prediction value of the second algorithm to have more weight relative to the first algorithm when the prediction time corresponds to a long term time.
14. One or more computer storage devices having computer-executable instructions stored thereon, which when executed in response to execution, cause a computer to perform steps, comprising: receiving a time step; providing the time step to an autoregressive tree cross-prediction (ARTXP) time series algorithm, to an autoregressive integrated moving average (ARIMA) time series algorithm and to a blending mechanism; receiving a first prediction value from the ARTXP time series algorithm, receiving a second prediction value from the ARIMA time series algorithm; blending the first prediction value with the second prediction value based on the time step received at the blending mechanism into a forecast result, wherein the blending comprises computing an exponential function result based in part on the time step, and using the exponential function result to determine a relative weight for each prediction value; and outputting the forecast result in association with the time step.
15. The one or more computer storage devices of claim 14 wherein the exponential function corresponds to a curve having a control variable set for a slope and a start of the curve, and constant coefficients.
16. The one or more computer storage devices of claim 14 wherein computing the exponential function comprises using a user-provided parameter as a function variable.
6125105 | September 26, 2000 | Edwards et al. |
6567006 | May 20, 2003 | Lander et al. |
6611726 | August 26, 2003 | Crosswhite |
7072863 | July 4, 2006 | Phillips et al. |
7747641 | June 29, 2010 | Kim et al. |
20030210680 | November 13, 2003 | Rao et al. |
20040260664 | December 23, 2004 | Thiesson et al. |
20060010101 | January 12, 2006 | Suzuki et al. |
20060129395 | June 15, 2006 | Thiesson et al. |
20060217939 | September 28, 2006 | Nakata et al. |
20070016427 | January 18, 2007 | Thumpudi et al. |
20070135957 | June 14, 2007 | Ogawa et al. |
20070150077 | June 28, 2007 | Bocharov et al. |
20070208492 | September 6, 2007 | Downs et al. |
20080103847 | May 1, 2008 | Sayal et al. |
- “Microsoft Time Series Algorithm Technical Reference (Analysis Services—Data Mining)”, Microsoft Technet, 2008, Microsoft Corporation, pp. 6.
- Meek, et al., “Autoregressive Tree Models for Time-Series Analysis”, SIAM International Conference on Data Mining, 2002, pp. 16.
- Lawton, “New Approach to Method Selection Based on Combining Methods”, retrieved at <<http://www.cems.uwe.ac.uk/˜rblawton/rl-isf2005talk.pdf>>, University of the West of England, pp. 5, no date.
- Lukawiecki, “Using Data Mining in Your IT Systems”, 2007, Project Botticelli Ltd & Microsoft Corporation, pp. 69.
Type: Grant
Filed: Jun 27, 2008
Date of Patent: Sep 4, 2012
Patent Publication Number: 20090327206
Assignee: Microsoft Corporation (Redmond, WA)
Inventors: C. James MacLennan (Redmond, WA), Shuvro Mitra (Sammamish, WA)
Primary Examiner: Kakali Chaki
Assistant Examiner: Peter Coughlan
Attorney: Gonzalez Saggio & Harlan LLP
Application Number: 12/147,501
International Classification: G06F 17/00 (20060101); G06N 7/00 (20060101); G06N 7/08 (20060101);