Abstract:
Embodiments of the present invention include forecasting methods and systems and methods and systems for responding to forecasts. In one embodiment of the present invention, financial market trends are automatically forecast, allowing for automatic generation of specific market-transaction recommendations. An automated trading program embodiment of the present invention includes a short-term price forecaster and a controller that makes transaction recommendations.

Description:
CROSS-REFERENCE TO RELATED APPLICATION  
       [0001]     This application claims the benefit of Provisional Application No. 60/630,822, filed Nov. 23, 2004. 
     
    
     COMPUTER PROGRAM LISTING APPENDIX  
       [0002]     Two identical CDs identified as “Disk 1 of 2” and “Disk 2 of 2,” containing program source code implementing an embodiment of the present invention, are included as a computer program listing Appendix B. The program text can be viewed on a personal computer running a Microsoft Windows operating system, using Microsoft Notepad or other utilities used for viewing ASCII files.  
       TECHNICAL FIELD  
       [0003]     The present invention is related to forecasting, and, in particular, for forecasting financial market trends.  
       SUMMARY OF THE INVENTION  
       [0004]     Embodiments of the present invention include forecasting methods and systems and methods and systems for responding to forecasts. In one embodiment of the present invention, financial market trends are automatically forecast, allowing for automatic generation of specific market-transaction recommendations. An automated trading program embodiment of the present invention includes a short-term price forecaster and a controller that makes transaction recommendations. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0005]      FIG. 1  shows an architectural overview of the Automated Trading Plateform according to one embodiment of the present invention.  
         [0006]      FIG. 2  shows a dynamic Price Trajectory according to one embodiment of the present invention.  
         [0007]      FIG. 3  shows forecast engine internals according to one embodiment of the present invention.  
         [0008]      FIG. 4  shows composition of a short-term price according to one embodiment of the present invention.  
         [0009]      FIG. 5  shows an architecture for a continuous forecast engine according to one embodiment of the present invention.  
         [0010]      FIG. 6  shows parallel operation of a parameter adaptation engine and a continuous forecast engine according to one embodiment of the present invention.  
         [0011]      FIG. 7  illustrates sliding-window forecasting according to one embodiment of the present invention. 
     
    
     DETAILED DESCRIPTION OF THE INVENTION  
       [0000]     Introduction  
         [0012]     The Automated Trading Platform that represents one embodiment of the present invention implements a programmable financial forecasting and investing system designed to achieve pre-specified objectives for profit and risk by trading equities in a given portfolio. The platform is implemented through an architecture. A block diagram depicting the main components of this architecture and their connectivities is shown in  FIG. 1 .  
         [0013]     The architecture of the trading platform is composed of two components, a Short-Term Price Forecaster  102  and a Controller  104 , as illustrated in  FIG. 1 . The Short-Term Price Forecaster generates a time series of predicted security prices and their associated risk. Once security prices and risk are created the Controller develops recommendations for trading actions. These recommendations are reviewed and may be overridden by the user in forming buy and sell orders for the financial asset market. An implementation of one embodiment of the present invention is presented in this document.  
         [0014]     Most problems involving the generation of actions in the financial environment are characterized by non-stationary uncertainty, non-negligible risk, and noisy, incomplete information. Embodiments of the present invention are based on the observation that financial decisions and forecasting processes are dynamical systems which can only be characterized, with acceptable level of accuracy, by fusing and synchronizing multiple models. Fusing and synchronizing models in this context means combining the extraction capabilities of specialized algorithms to produce an output with a lower level of uncertainty and better performance compared to results one would obtain by using individual models.  
         [0015]     The basis of embodiments of the present invention is to model uncertainty using differential geometry. The concept starts with a stochastic differential equation and solves a piecewise diffusion equation with impulses. Unlike the Black-Scholes formula, we are not limited to the linear Gaussian case. Our internal model is based on a general predictor-corrector algorithm derived from the appropriate Chapman Kolmogorov propagation model 6.  
         [0000]     Model Overview  
         [0016]     Our system is based on a model for the dynamics of the portfolio, which is a piecewise diffusion process (PDP) [6]. We consider the price and risk of n stocks. We let the stochastic process x(t) be an n×1 vector for the price trajectory and u(t) be an m×1 vector for volume trajectory. In general, the dimensions of x(t) and u(t) are not the same. For instance, x(t) might be an 2n×1 vector for price and price rate trajectory and u(t) might be an n×1 vector for volume trajectory. However, one implementation treats m=n. We refer to x(t) as a price trajectory, and u(t) as a volume trajectory.  
         [0017]     In one embodiment of the present invention, the Automated Trading Platform forecasts the price trajectory in the Short-Term Price Forecaster, and controls the volume trajectory in the Controller, based on the stochastic model in (1). The form of this model is bilinear in price x(t) and volume u(t), which reflects their interdependence and lack of causality. This stochastic model is the foundation of the Short-Term Price Forecaster and the Controller. In the Controller, we let the volume trajectory be impulses at times τ k  and characterize the stochastic process x(t) with the following PDP  
         ⅆ     x   ⁡     (   t   )         =         (       A   0     +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j     ⁡     (   t   )             )     ⁢     x   ⁡     (   t   )       ⁢     ⅆ   t       +       Cf   ⁡     (   t   )       ⁢     ⅆ   t       +       ϕ   ⁡     (   t   )       ⁢     ⅆ   t       +       ⅆ   ω     ⁢           ⁢     (   t   )             
         for   ⁢           ⁢     τ   k   +       ≤   t   ≤     τ     k   +   1     -         
     and     
         x   ⁡     (     τ   k   +     )       =       x   ⁡     (     τ   k   -     )       +       (       ∑     i   =   1     m     ⁢       A   i     ⁢       u   i     ⁡     (     τ   k     )           )     ⁢     x   ⁡     (     τ   k   -     )         +     Bu   ⁡     (     τ   k     )             
 
 for an interval tε[t 0 ,t 1 ], with impulses at times τ k . The i th  element of u(t) associated with stock i is denoted u i (t). We assume that the impulse times τ k  are known, but in the future we may allow the impulse times to be Markov times. In our model 1, the volume u(τ k ) is an impulse control, and the price is not well-defined at τ k , so we use the notation x(τ k   − ) and x(τ k   + ) to jump over the impulse time. A sample realization of a one-dimensional process x(t) with three impulses of volume is illustrated in  FIG. 2 . 
 
         [0018]     The financial model given in (1) provides the ability to forecast and recommend trading decisions at the speed needed for an automated trading platform. The bilinear model with impulses in (1) mathematically accounts for jumps in the price x(t). The price jumps (as illustrated in  FIG. 2 ) are not necessarily due to drastic changes in the market, but may be due to shifts in the frequencies, or spectral content, of the signals. The piecewise diffusion model in (1) does not assume that the market is a diffusion model, but rigorously models the discontinuities as impulses.  
         [0019]     Empirical examination of market data supports the PDP model. Performing a Fast Fourier Transform (FFT) of the signal generates the underlying frequencies. The spectral analysis reveals discrete frequencies which support the PDP model with a diffusive component as well as a deterministic component. If the market were a pure diffusion process, the spectral analysis would generate a continuous spectrum of frequencies. This frequency analysis explains why the market does not behave as a Gaussian model—because it has discontinuities.  
         [0020]     The difference between a PDP model as opposed to a Black-Scholes diffusion model is magnified when considering a real-time system with a sampling interval of 0.1 milliseconds. Consider the current system which is using 30 seconds between data updates. In the current system, a bid or ask order by one of the specialists of approximately one million shares will impact the market, and in 30 seconds, the price of the stock will reflect this large order. However a smaller order of one hundred shares in 30 seconds will have a negligible effect on the market. Now consider the future system with 0.1 milliseconds between data updates. In the future system, a bid or ask order of one hundred shares will impact the market (because the system is 10,000 times faster, so 10ˆ6/10ˆ4 would have a similar impact). The model that represents an embodiment of the present invention can appropriately account for these impulses, whereas a Black-Scholes model will artificially create volatility because of the incorrect assumption of a diffusion process.  
         [0021]     Another consequence of the PDP model is the opportunity to take advantage of frequencies associated with a stock price. If we can predict the dominant frequency, then we not only recommend what to trade, but more importantly when to trade. For example, the model may recommend holding one stock for twice as long as another stock based on their frequency analyses. This implies that we should first predict the dominant frequency and then forecast the phase to utilize our model at another level.  
         [0022]     The stochastic process ω(t), which drives the price variation x(t), represents uncertainty in our model, and is assumed to be a Semi-Martingale (6). This stochastic process ω(t) represents the inherent uncertainty due to the market environment and the accuracy of the model. We let φ(t) be an n×1 vector, representing the average value of the perturbation introduced by the market. The stochastic process ω(t) has zero mean, is of bounded quadratic variation, and has an n×n covariance matrix function Q(t). We assume that ω(t) is uncorrelated with x(t), i.e. E[x(t)ω(τ)]=0 for τ&lt;t.  
         [0023]     The piece-wise constant parameters of the model are A 0 , A i , i=1, . . . ,m, D j , j=1, . . . ,p, B, and C. The n×n matrix A 0  defines a sales rate (also known as elasticity parameter in Leontief&#39;s model). The A 0  matrix is also called the relaxation matrix. The diagonal terms of A 0  establish the price trend of each stock, and the off-diagonal terms establish the relative advantage of one stock over another. The A i  matrices are the effect of volume on price rate, and are n×n matrices which are multiplied by the i th  element of u(t), for I=1, . . . ,m. The A i  matrices are called structure matrix coefficients because their product A i u i (t) modifies the price model. The rank of each matrix A i  is one, and to simplify, we assume that the ii th  entry is the only nonzero entry. The term A i u i (t) captures the effect of the price rate due to demand, if u i (t) is positive for stock i, then the price acceleration increases, and vice versa.  
         [0024]     The D j  matrices, for j=1, . . . ,p, are diagonal n×n matrices that characterize the effect of the market on rate price. For each aggregate market signal f j (t), the product D j f j (t) represents the dynamics of the coordinate system of the market. This allows us to work in a principal coordinate system. The matrix B is an n×m diagonal matrix called the demand coefficient matrix, and C is an n×p coefficient matrix that measures the effect of the aggregate market on price rate. We use {circumflex over (p)}(t) to denote the collection of parameters (A 0 , A i , i=1, . . . ,m, D j , j=1, . . . ,p, B, and C) of the model, with their current values at time t, as described in Section 3.5.  
         [0025]     The characteristics of the market environment (for example, S&amp;P500, Dow Jones, etc.) are included in f(t), a p×1 vector, and f j (t) is the j th  element of f(t).  
         [0026]     We manage the uncertainty due to parameter values and the uncertainty due to the market environment separately by employing two engines that interact (see Meditch [5], 1968 for a discussion on forced separation). In the Short-Term Price Forecaster, the Parameter Adaptation Engine addresses the uncertainty in the parameters, and the Continuous Forecast Engine captures the remaining uncertainty. We use the concept of a sliding window to continuously adapt and coordinate changes to price, volume, and parameters over short periods of time. The length of the sliding window is chosen so that the parameters are constant with respect to the model (1).  
         [0027]     Real-time market and financial asset data are fed into the Short-Term Price Forecaster. The Short-Term Price Forecaster includes ask price x ask , bid price x bid , sell price x sell , and volume u data , for each stock, as well as market characteristics f data . We use {Z(t k )} to denote the data observations that are collected at time instances t k  that are not necessarily equally spaced. This data is filtered in the Asynchronous Filter Bank, and used to calculate continuous input series Z(t), which consists of the individual input series.  
         [0000]     Short-Term Price Forecaster  
         [0000]     Introduction  
         [0028]     The Short-Term Price Forecaster is a real-time application for generating short-term forecast signals of price, risk, volume, and volatility for a user-selected portfolio. The input data is of two types: market data and asset data. The market data consists of user-selected indices (for example, DJIA, NASDAQ). In addition, the Short-Term Price Forecaster is supplied with asset data for each of the assets in the user&#39;s selected portfolio. The Short-Term Price Forecaster operates in sliding window mode and executes the repair strategy.  
         [0029]     The concept of the repair strategy that is described here can adapt over short time periods when the price changes. The model is based on a propagator of the first moment conditioned on the filtration defined by the market data, and the second conditional moment that measures the volatility of the market. The model continuously repairs itself, as the system learns more accurate values of the model parameters. This repair strategy is crucial for periods of high volatility. The repair strategy begins by training the model with historical data to estimate the parameters. The dynamical model and the estimated parameters can then be used to solve for the price and risk trajectories. The time window advances and the data is updated. Then the parameters are estimated for the new time window. With each advance of the time window, the repair strategy continuously solves for the price and risk trajectories while updating the parameters in real-time.  
         [0030]     The core of the Short-Term Price Forecaster is the Forecast Engine, which consists of three basic components: the Continuous Forecast Engine that estimates price and risk, the Parameter Adaptation Engine that estimates model parameters, and the Asynchronous Filter Bank that filters observations and produces continuous input streams. The uncertainty in the model is due to two reasons: uncertainty due to market environment and accuracy of the model, and uncertainty due to the parameter values. By using a separation principle, we can account for the two types of uncertainties separately in two coupled models. These coupled models can be executed in parallel with information exchange. The Parameter Adaptation Engine addresses the uncertainty due to parameter values and the Continuous Forecast Engine addresses the uncertainty due to market environment and accuracy. The sliding window concept with real-time data provides synchronization of the models, achieving our goal of predicting price and risk with a known level of uncertainty.  
         [0031]     The overall system architecture of the Forecast Engine is shown in  FIG. 3 . The architecture consists of seven components: Continuous Forecast Engine (CFE), Parameter Adaptation Engine (PAE), Asynchronous Filter Bank (AFB), Learning Engine, Shared Memory System, Window Clock and Synchronization.  
         [0032]     The Continuous Forecast Engine generates the nominal price {tilde over (x)} N (t) and risk {tilde over (Θ)} N (t) trajectories using a repair strategy while the Parameter Adaptation Engine updates the parameters {circumflex over (p)}(t) of the model. These parameters are stored in the Shared Memory System where, along with the computed input series and real-time data, they are available for the Continuous Forecast Engine to access at any moment. The Asynchronous Filter Bank filters the real-time data {Z(t k )} and produces the continuous input series Z(t) needed in the CFE. The Learning Engine is an algorithm that allows us to detect when the model in the Forecast Engine is drastically out of phase with respect to the current data and therefore a restart of the associated model is warranted. In this manner the Learning Engine acts as a meta-controller to the other modules in the Forecast Engine, detecting the need to regenerate the model paramaters and initiating the mechanism that does so. The Window Clock keeps track of the current time and the sliding window, and Synchronization handles all of the interactions between the Window Clock and the other components of the architecture.  
         [0033]     We describe the functionality of the Continuous Forecast Engine in Section 3.4, the functionality of the Parameter Adaptation Engine in Section 3.5, the functionality of the Asynchronous Filter Bank in Section 3.3, the Learning Engine in Section 3.6, and the Lowpass Filter in Section 3.7.  
         [0000]     Distributed Architecture  
         [0034]     The computational algorithm of the Short-Term Price Forecaster is organized in a four-level hierarchical structure (see  FIG. 4 ). In the lowest level, a proprietary Asynchronous Filter Bank transforms the asynchronous market and asset data into synchronous signals. The signal is next fed to a group of algorithms called Forecast Engines. Each one of these engines processes a subset of the portfolio and market data to generate a forecast. The composition of these subsets is determined by the user and by correlation information of the assets in the portfolio. For example, one such grouping can be a group of transportation-related assets in the NYSE.  
         [0035]     The next level is composed of a set of Forecast Units that detect and correct incompatibilities in the forecasts from the Forecast Engines. This data fusion operation performed by the Forecast Units improves the overall quality of the forecast. At the highest level is aggregator software that implements a voting schema that allows the Forecaster to detect and discard erroneous forecasts in the subgroups of the portfolio. The voting schema significantly improves the reliability of the forecasts.  
         [0000]     3.3 Asynchronous Filter Bank  
         [0036]     The Asynchronous Filter Bank inputs are equity and market data. The data consists of the following items: ask price, bid price, sale price and volume for each equity and aggregated market data. Nominally, the data items should be available at uniform sample times. However, this is not the case in the real-time setting. One or more data items may be missing at a sample time. Alternatively, for a given data item, we may obtain more than one value at a sample time. The Asynchronous Filter Bank has been designed to handle these anomalies in the input data.  
         [0037]     The filter operates on known statistics about the error rate in the data. The input data is transformed into a uniform time sequence of estimates of the original data with known statistics.  
         [0038]     We use {Z(t k )} to denote the data observations that are collected at time instance t k . The output from the Asynchronous Filter Bank are uniformly spaced sequences, x ask (t), x bid (t), x sell (t), u data (t), and f data (t). This data is used in the Continuous Forecast and Parameter Adaptation Engines. There are 4n+p streams of data. Each one of them is handled by a component of the Asynchronous Filter Bank.  
         [0039]     The methodology of the Asynchronous Filter Bank is described in Hybrid Asynchronous Filter, by Kohn, Brayman and Cholewinski (Clearsight document). The Asynchronous Filter Bank propagates the estimate. A Lyaponov filter is used to produce x ask (t), x bid (t), x sell (t), and f data (t). If no data is available, the latest filtered data (corrected by the latest observations) is used to get boundary conditions for the next propagation and to tune the parameters of the Asynchronous Filter Bank. The volume u data (t) is produced by accumulating the volume data over the uniformly spaced time intervals. If no volume data is available in a time interval, then u data (t) is set to zero for that interval.  
         [0000]     3.4 Continuous Forecast Engine  
         [0040]     The primary role of the Continuous Forecast Engine is to generate the nominal price and risk trajectories using a repair strategy over a sliding time window. The architecture of the Continuous Forecast Engine takes advantage of the sliding window concept. It takes a nominal trajectory, extends it and computes a repair action, and then creates a new nominal trajectory. The Continuous Forecast Engine architecture, shown in  FIG. 5 , consists of three components, the Repair Generator, the Coefficient Generator &amp; Synchronization (CG&amp;S) module, and the Nominal Update Generator. The Nominal Update Generator computes nominal price and risk trajectories over an extended time window using the current estimate for the model parameters. The Repair Generator uses current model parameters and nominal trajectories to provide optimal repair price and risk trajectories over the advanced time window. The CG&amp;S module computes nominal price and risk trajectories in the same time window using the trajectories provided by the Nominal Update Generator and the Repair Generator. The CG&amp;S module also processes the new data as it becomes available, computes coefficients needed in the Repair Generator, and synchronizes with the Window Clock to coordinate the sliding window.  
         [0041]     The Continuous Forecast Engine involves a sequence of steps over a time window, which are coordinated with the operations of the Parameter Adaptation Engine. The terminology of this sequencing in the Continuous Forecast Engine and the Parameter Adaptation Engine is illustrated in  FIG. 6 .  
         [0042]     The CFE starts at the current time t f , with an initial forecast window [t f   + , (t f +ΔT) − ] where t f   +  denotes the left side of the interval, and ΔT is the interval length. We use ΔT to denote the time horizon for forecasts; in the current example, ΔT is six seconds. We also consider the repair window, [(t f −ΔT) + ,t f   − ], with a nominal trajectory for price and risk. The time interval between data points is Δ data ; in this example, Δ data  is one second. When the steps of the CFE are repeated, then the sliding window is updated from [t f   + ,(t f +ΔT) − ] to [(t f +Δ data ) + ,(t f +Δ data +ΔT) − ]. Then we slide the window, or “kiss” the data h times during the time window. We let h be such that T=hΔT. Our approximate price is good up to the h order. We use T to denote the time between updates of the parameters, {circumflex over (p)}(t). In the current example, T is 30 seconds. The following steps in CFE describe the repair strategy over a sliding window. A summary of the steps with the equations are given in Section 3.4.7.  
         [0043]     Step  0 . Initialize window clock t, current time t f , time increment ΔT, the time increment for the data Δ data , and h such that ΔT=hΔ data . Also, initialize a few matrices. Assume that nominal trajectories, parameters, and other previously computed input series are available.  
         [0044]     Step  1 . The CG&amp;S reads the parameters {circumflex over (p)}(t) at t=t f  from the Parameter Adaptation Engine, and determines if the parameters have changed from the previous iteration. It sets the time window for the Repair Generator, i.e., [(t f −ΔT) + ,t f   − ]. The CG&amp;S module also reads the filtered data (x ask (t), x bid (t), x sell (t), u data (t), and f data (t)) at the necessary times from the Asynchronous Filter Bank. Then the CG&amp;S module computes input series and coefficients (e.g. ũ N (t), f N (t), φ N (t), etc.) needed for the Repair Generator and the Nominal Update Generator.  
         [0045]     Step  2 . The Repair Generator solves the repair optimization model for the repair state y(t), the incremental risk Ω(t), and the repair action v(t) in the time window [(t f −ΔT) + ,t f   − ]. Update the new nominal trajectories in the repair window [(t f −ΔT) + ,t f   − ] by adding the repair trajectories to the old nominal trajectories.  
         [0046]     Step  3 . The CG&amp;S module uses the repaired trajectories to provide initial conditions at t f   +  for price {tilde over (x)} N (t) and risk evolution Θˆ{N}(t).  
         [0047]     Step  4 . The Nominal Update Generator solves for the nominal price {tilde over (x)} N (t) and risk Θˆ{N}(t) trajectories in the forecast time window [t f   + ,(t f +ΔT) − ]. Output {tilde over (x)} i   N (t f +ΔT) and √{square root over ({tilde over (Θ)} ii   N (t f +ΔT))} for i=1, . . . , n, and save trajectories for PAE.  
         [0048]     Step  5 . Update the sliding window and related trajectories: 
 
 t   f   +t   f +Δ data  
 
 and go to Step  1 . 
 
 3.4.1 Time Window Updates 
 
         [0049]     The price evolution and risk models for incremental and nominal modes are integrated into a scheme referred to as a sliding window. This strategy assumes that the decisions at the current time depend on finite interval (of duration Δ data ) histories of the evolution updates, and these intervals “slide” at a constant rate collecting present data (e.g. demand, uncertainty) and discarding the segments of the evolution in the past with respect to the current time.  FIG. 7  illustrates the sliding window and the sequence of steps in the Continuous Forecast Engine.  
         [0050]     The Window Clock maintains the forecast time window as [t f   + ,(t f +ΔT) − ] and the repair window as [(t f −ΔT) + ,t f   − ], where t f  is current time. With the initial condition being the last point of the updated evolution trajectories, the Nominal Update Generator computes an optimal extension of the nominal trajectories for the forecast interval [t f   + ,(t f +ΔT) − ]. The Coefficient Generator and Synchronization module, and the Repair Generator (in Steps  3  and  4 ) update the coefficients and compute the repair evolution trajectories over the forecast interval as a function of the parameters computed using the nominal evolution trajectory. The criterion for this optimization is a functional that encodes the desired behavior of the application, e.g. max profit. The forecasted price and risk at time t f +ΔT may be output. Then the Window Clock advances the interval to [(t f +Δ data ) + ,(t f +Δ data +ΔT) − ], and updates the nominal trajectories.  
         [0000]     3.4.2 Nominal Update Generator Model  
         [0051]     The Nominal Update Generator Model computes the nominal price {tilde over (x)} N (t) and risk {tilde over (Θ)} N (t) trajectories in the forecast time window [t f   + ,(t f +ΔT) − ]. The equations governing this computation are given in the following model.  
         [0052]     Let {tilde over (x)}(t)εR n , tε[t f   + ,(t f +ΔT) − ], be an estimate of the price x(t) at time t. While {tilde over (x)}(t) is not defined at impulse time t f , {tilde over (x)}(t) is defined for the whole interval [t f   + ,(t f +ΔT) − ] so we can integrate (2) to get {tilde over (x)}(t) in that interval. It can be shown (see Appendix 4.2) that {tilde over (x)}(t) satisfies the following differential equation,  
         ⅆ       x   ~     ⁡     (   t   )         =         (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢       u   i     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j     ⁡     (   t   )             )     ⁢       x   ~     ⁡     (   t   )       ⁢     ⅆ   t       +       (       Bu   ⁡     (   t   )       +     Cf   ⁡     (   t   )       +     ϕ   ⁡     (   t   )         )     ⁢     ⅆ   t       +       K   ⁡     (   t   )       ⁢     (         x   obs     ⁡     (   t   )       -       x   ~     ⁡     (   t   )         )     ⁢   δ   ⁢           ⁢     (     t   -     t   f       )     ⁢     ⅆ   t             
 
 where 
 
 K ( t )={tilde over (Θ)}( t ) R   −1  
 
 and δ(t−t f ) is the delta distribution satisfying  
           ∫     -   ∞       +   ∞       ⁢       f   ⁡     (   t   )       ⁢           ⁢   δ   ⁢           ⁢     (     t   -   τ     )     ⁢           ⁢     ⅆ   t         =     f   ⁡     (   τ   )           
 
 for any continuous function f(t). The third term on the third line of equation (2) is a correction term due to the observation of price at time t f . We use x sell (t) as our x obs (t). The K(t) expression is referred to as the gain, where R is an n×n symmetric positive definite matrix representing the noise covariance matrix. The risk {tilde over (Θ)}(t) is discussed next. 
 
         [0053]     The central second moment conditioned in the continuous input series z(t) based on the input data of x(t), {tilde over (Θ)}(t)εR n×n , tε[t f   + ,(t f +ΔT) − ], measures the risk and it can be shown (see Appendix ??) that it satisfies the following differential equation  
         ⅆ       Θ   ~     ⁡     (   t   )         =         (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢       u   i     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j     ⁡     (   t   )             )     ⁢       Θ   ~     ⁡     (   t   )       ⁢     ⅆ   t       +         Θ   ~     ⁡     (   t   )       ⁢       (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢       u   i     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j     ⁡     (   t   )             )     T     ⁢     ⅆ   t       +       (       Q   ⁡     (   t   )       -         Θ   ~     ⁡     (   t   )       ⁢     R     -   1       ⁢       Θ   ~     ⁡     (   t   )           )     ⁢       ⅆ   t     .             
 
 Equation (3) propagates the parameters of the uncertainty ellipsoid {tilde over (Θ)}(t) that models the risk as a function of exogenous uncertainty at time t. In equation (3), Q(t) defines the uncertainty ellipsoid and R is the same symmetric positive definite matrix involved in (2). 
 
 The Nominal Update Generator uses x and {tilde over (Θ)} models (2) and (3) to create our nominal prediction over the forecast window. We use the superscript N to denote the nominal trajectories {tilde over (x)} N (t) and {tilde over (Θ)} N (t) for tε[t f   + ,(t f +ΔT) − ]. We use the Parameter Adaptation Engine to estimate the parameters A 0 , A i , i=1, . . . ,m, D j , j=1, . . . ,p, B, and C. The nominal values f N (t), φ N (t), and Q N (t) are computed from the data in the CG&amp;S module (see Section 3.4.6). The initial conditions needed to compute {tilde over (x)} N (t) and {tilde over (Θ)} N (t) are provided from the Repair Generator and the repaired trajectories {tilde over (x)} NN (t) and {tilde over (Θ)} NN (t) for the repair window [(t f −ΔT) − ,t f   + ]. We next describe how to identify the initial conditions. Then we specify the details for creating the nominal trajectories. 
 
         [0054]     The initial condition of {tilde over (x)}(t) at time t f   +  needs to be corrected by our observed data at that time, x sell (t f ). We assume this correction is an impulse. For the nominal prediction at forecasting time t f   + , assume u(t)=ũ N (t f ) for tε[t f   + ,(t f +ΔT) − ] (i.e., u(t) is a constant in the forecast time interval). We denote the initial conditions {tilde over (x)} IC  and {tilde over (Θ)} IC  as the values of {tilde over (x)} N (t f   + ) and {tilde over (Θ)} N (t f   + ) respectively. The initial conditions for {tilde over (x)} IC  include a correction term corresponding to the third line in equation (2) that includes the observed value x sell (t f ). The initial conditions are updated as follows 
 
 {tilde over (x)}   IC   ={tilde over (x)}   NN ( t   f   − )+{tilde over (Θ)} NN ( t   f   − ) R   −1 ( x   sell ( t   f )− {tilde over (x)}   NN ( t   f   − )) 
 
 where {tilde over (x)} NN (t f   − ) and õ NN (t f   − ) are given by repair, and 
 
{tilde over (Θ)} IC ={tilde over (Θ)} NN ( t   f   − ) 
 
 The correction term −{tilde over (Θ)}R −1 {tilde over (Θ)} in (3) continuously updates {tilde over (Θ)} so that the initial conditions {tilde over (Θ)} IC  equal the repaired value {tilde over (Θ)} NN (t f   − ). 
 
         [0055]     Now we forecast price and risk. We forecast price by integrating equation (2) where we use ũ N (t f ), f N (t f ), and φ N (t) as constant values over the forecast window. The correction term in (2) has already been accounted for in the initial conditions (4) and is not needed in the integration. Thus we integrate the following differential equation to obtain the nominal price trajectory,  
           ⅆ         x   ~     N     ⁡     (   t   )           ⅆ   t       =         (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢         u   ~     i   N     ⁡     (     t   f     )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j   N     ⁡     (     t   f     )             )     ⁢         x   ~     N     ⁡     (   t   )         +     B   ⁢         u   ~     N     ⁡     (     t   f     )         +       Cf   N     ⁡     (     t   f     )       +       ϕ   N     ⁡     (     t   f     )             
 
 with initial conditions given in (4), and over t between t f   +  and (t f +ΔT) − . 
 
         [0056]     The risk trajectory is forecasted by integrating (3) with constant values for ũ N (t f ), f N (t f ), and Q N (t f ), yielding the following differential equation,  
           ⅆ         Θ   ~     N     ⁡     (   t   )           ⅆ   t       =         (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢         u   ~     i   N     ⁡     (     t   f     )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j   N     ⁡     (     t   f     )             )     ⁢         Θ   ~     N     ⁡     (   t   )         +           Θ   ~     N     ⁡     (   t   )       ⁢       (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢         u   ~     i   N     ⁡     (     t   f     )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j   N     ⁡     (     t   f     )             )     T       -           Θ   ~     N     ⁡     (     t   f     )       ⁢     R     -   1       ⁢         Θ   ~     N     ⁡     (     t   f     )         +       Q   N     ⁡     (     t   f     )             
 
 with initial conditions given in (5), and over t between t between t f   +  and (t f +ΔT) − . 
 
         [0057]     The initial conditions (4) and (5) are computed in Step  3  of the CFE, and the nominal trajectories are updated in Step  4  of the CFE.  
         [0000]     3.4.3 Repair Generator Model  
         [0058]     The repair model uses a singular perturbation to obtain an incremental variation of the price and risk evolution trajectories with respect to computed nominal trajectories: 
 
 {tilde over (x)}   NN ( t )= {tilde over (x)}   N ( t )+ε y ( t ) 
 
{tilde over (Θ)} NN ( t )={tilde over (Θ)} N ( t )+εΩ( t ) 
 
 ũ   NN ( t )= ũ   N ( t )+ε v ( t ) 
 
 for tε[(t f −ΔT) + ,t f   − ] where the NN superscript denotes the new nominal trajectory, and ε is the perturbation parameter determined by the window characteristic, ε=Δ data /ΔT=1/h. From the Ekeland principle [11], for a window of width ΔT and increment Δ data  with no forgetting function, we know that  
       ɛ   =         Δ   data       Δ   ⁢           ⁢   T       .         
 
 In (8)-(10), y(t) is the price repair, Ω(t) is the incremental risk, and v(t) is the repair action. 
 
         [0059]     We also use a singular perturbation for 
 
 f   NN ( t )= f   N ( t )+ε g ( t ) 
 
φ NN ( t )=φ N ( t )+εξ( t ) 
 
 Q   NN ( t )= Q   N ( t )+ε W ( t ). 
 
 where g(t) is the incremental force by the environment, ξ(t) is the uncertainty in the market, and W(t) is the incremental external uncertainty. 
 
         [0060]     In the CG&amp;S module, g(t) is approximated by taking the difference of real-time data at time t and at time t−Δ data . We set f NN (t)=f N (t)=f data (t) and f N (t−Δ data )=f data (t−Δ data ), yielding  
           g   N     ⁡     (   t   )       =             f   N     ⁡     (   t   )       -       f   N     ⁡     (     t   -     Δ   data       )         ɛ     .         
 
 Similarly, ξ(t) is estimated using φ NN (t)=φ N (t) at time t and φ N (t−Δ data ) at time t−Δ data , yielding  
           ξ   N     ⁡     (   t   )       =             ϕ   N     ⁡     (   t   )       -       ϕ   N     ⁡     (     t   -     Δ   data       )         ɛ     .         
 
 And the same for W(t),  
           W   N     ⁡     (   t   )       =             Q   N     ⁡     (   t   )       -       Q   N     ⁡     (     t   -     Δ   data       )         ɛ     .         
 
 The data for f N (t) comes directly from the filtered data, 
 
 f   N ( t )= f   data ( t ). 
 
 We estimate φ N (t), the average value of the perturbation introduced by the market, by using the available data, x sell , u data , and f data  in equation (6), yielding  
                 ϕ   N     ⁡     (   t   )       =       ⁢       (         x   sell     ⁡     (   t   )       -       x   sell     ⁡     (     t   -     Δ   data       )         )     -                     ⁢         (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢       u   i   data     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j   N     ⁡     (   t   )             )     ⁢       x   sell     ⁡     (   t   )         -                     ⁢         Bu   data     ⁡     (   t   )       -         Cf   data     ⁡     (   t   )       .                 
 
         [0061]     The estimate for the covariance matrix Q ij   N (t), the last term in equation (7), is also estimated using available data, x ask , x bid , and coefficients α, ε Q , and α Q , yielding  
                 Q   ij   N     ⁡     (   t   )       =       ⁢       ɛ   Q   2     +       max     σ   ∈     [       t   -     Δ   ⁢           ⁢   T       ,   t     ]         ⁢     {       1   2     ⁢     (         α     ⁢              x   i   ask     ⁡     (   σ   )       -       x   i   bid     ⁡     (   σ   )                +                                   ⁢     α   Q     )     ⁢     (         α     ⁢              x   j   ask     ⁢     (   σ   )       -       x   j   bid     ⁡     (   σ   )                +     α   Q       )       }             
         for   ⁢           ⁢   i     ,     j   =   1     ,   …   ⁢           ,     n   .         
 
         [0062]     To derive the differential equation for the price repair y(t), starting from (8), we have,  
           ⅆ     (         x   ~     NN     ⁡     (   t   )       )         ⅆ   t       =       ⅆ     (           x   ~     N     ⁡     (   t   )       +     ɛ   ⁢           ⁢     y   ⁡     (   t   )           )         ⅆ   t           
 
 which we can expand using equation (2), and then dropping the terms of order ε 2 , we get  
                 ⅆ     y   ⁡     (   t   )           ⅆ   t       =       ⁢           A   ~     ⁡     (   t   )       ⁢     y   ⁡     (   t   )         +       (         ∑     i   =   1     m     ⁢       A   i     ⁢       v   i     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       g   j   N     ⁡     (   t   )             )     ⁢       x   ~     N     ⁢     (   t   )       +                     ⁢       Bv   ⁡     (   t   )       +       Cg   N     ⁡     (   t   )       +       ξ   N     ⁡     (   t   )                   
     where     
           A   ~     ⁡     (   t   )       =       (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢         u   ~     i   N     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j   N     ⁡     (   t   )             )     .         
 
 Because the control variable is v(t), we rewrite (14) to highlight its linear form,  
                 ⅆ     y   ⁡     (   t   )           ⅆ   t       =       ⁢           A   ~     ⁡     (   t   )       ⁢     y   ⁡     (   t   )         +       ∑     i   =   1     m     ⁢       (       A   i     ⁢         x   ~     N     ⁡     (   t   )         )     ⁢       v   i     ⁡     (   t   )           +     Bv   ⁡     (   t   )       +                     ⁢         ∑     j   =   1     p     ⁢       D   j     ⁢         x   ~     N     ⁡     (   t   )       ⁢       g   j   N     ⁡     (   t   )           +       Cg   N     ⁡     (   t   )       +         ξ   N     ⁡     (   t   )       .                 
 
 For notational and computational convenience, in addition to defining Ã(t), we also define {tilde over (B)}(t) to be an n×m matrix 
 
 {tilde over (B)} ( t )=( Ã   x ( t )+ B ) 
 
 where Ã x (t) is an n×m matrix with the ith column of Ã x (t), for i=1, . . . ,m, given by 
 
 Ã   i   x ( t )= A   i   {tilde over (x)}   N ( t ). 
 
 And {tilde over (C)}(t) is an n×1 vector given by  
           C   ~     ⁡     (   t   )       =         ∑     j   =   1     p     ⁢         g   j   N     ⁡     (   t   )       ⁢     D   j     ⁢         x   ~     N     ⁡     (   t   )           +       Cg   N     ⁡     (   t   )       +         ξ   N     ⁡     (   t   )       .           
 
 The coefficients Ã(t), {tilde over (B)}(t), and {tilde over (C)}(t) are computed in Step  1  of the Continuous Forecast Engine by the CG&amp;S module, where g N (t) and ξ N (t) are estimated from the data. Now we can rewrite the dynamics equation in (15) as  
           ⅆ     y   ⁡     (   t   )           ⅆ   t       =           A   ~     ⁡     (   t   )       ⁢     y   ⁡     (   t   )         +         B   ~     ⁡     (   t   )       ⁢     v   ⁡     (   t   )         +         C   ~     ⁡     (   t   )       .           
 
 Similarly, from (9), we can expand  
             ⅆ     (         Θ   ~     NN     ⁡     (   t   )       )         ⅆ   t       =       ⅆ     (           Θ   ~     N     ⁡     (   t   )       +     ɛ   ⁢           ⁢     Ω   ⁡     (   t   )           )         ⅆ   t         ,       
 
 and using Equation (3) it can be shown that  
                   ⅆ   Ω     ⁢           ⁢     (   t   )         ⅆ   t       =       ⁢         (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢         u   ~     i   N     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j   N     ⁡     (   t   )             )     ⁢   Ω   ⁢           ⁢     (   t   )       +                     ⁢         Ω   ⁡     (   t   )       ⁢       (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢         u   ~     i   N     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j   N     ⁡     (   t   )             )     T       -                     ⁢             Θ   ~     N     ⁡     (   t   )       ⁢     R     -   1       ⁢     Ω   ⁡     (   t   )         -       Ω   ⁡     (   t   )       ⁢     R     -   1       ⁢         Θ   ~     N     ⁡     (   t   )         +                     ⁢         ∑     i   =   1     m     ⁢       A   i   T     ⁢       v   i     ⁡     (   t   )       ⁢         Θ   ~     N     ⁡     (   t   )           +       ∑     i   =   1     m     ⁢       A   i     ⁢       v   i     ⁡     (   t   )       ⁢         Θ   ~     N     ⁡     (   t   )           +                     ⁢         ∑     j   =   1     p     ⁢           Θ   ~     N     ⁡     (   t   )       ⁢     D   j   T     ⁢       g   j   N     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢         Θ   ~     N     ⁡     (   t   )       ⁢       g   j   N     ⁡     (   t   )           +         W   N     ⁡     (   t   )       .                 
 
 For notational and computational convenience, we define 
 
 {tilde over (V)}   i ( t )={tilde over (Θ)} N ( t ) A   i   T  for i=1, . . . ,m 
 
 and  
           D   ~     ⁡     (   t   )       =         ∑     j   =   1     p     ⁢           Θ   ~     N     ⁡     (   t   )       ⁢     D   j   T     ⁢       g   j   N     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢         Θ   ~     N     ⁡     (   t   )       ⁢       g   j   N     ⁡     (   t   )           +       W   N     ⁡     (   t   )             
 
 which are computed in Step  1  of the Continuous Forecast Engine. Using the notation for Ã(t), {tilde over (V)} i (t), we can rewrite (17) as  
                 ⅆ     Ω   ⁡     (   t   )           ⅆ   t       =       ⁢           A   ~     ⁡     (   t   )       ⁢     Ω   ⁡     (   t   )         +       Ω   ⁡     (   t   )       ⁢       (       A   ~     ⁡     (   t   )       )     T       -                     ⁢             Θ   ~     N     ⁡     (   t   )       ⁢     R     -   1       ⁢     Ω   ⁡     (   t   )         -       Ω   ⁡     (   t   )       ⁢     R     -   1       ⁢         Θ   ~     N     ⁡     (   t   )         +                     ⁢         ∑     i   =   1     m     ⁢           V   ~     i     ⁡     (   t   )       ⁢       v   i     ⁡     (   t   )           +       ∑     i   =   1     m     ⁢         (         V   ~     i     ⁡     (   t   )       )     T     ⁢       v   i     ⁡     (   t   )           +       D   ~     ⁡     (   t   )                   
 
 Equations (15) and (17) constitute the model for the repair module. The control variable is v(t) which can be interpreted as a fictitious incremental volume caused by the uncertainty in the market and the accuracy of the model. Notice that the dynamics are functions of the control variable v(t), so we are controlling the uncertainty through v(t). The repair criterion in the following section completes the definition of the repair optimization model. 
 
 3.4.4 Repair Criteria 
 
         [0063]     The repair criterion uses a least squares criterion for the estimated repair trajectories. It represents the user-defined running criterion rate (e.g. profit-risk combination). 
 
 The criterion for the Repair Generator is a functional of the form  
             J   R     ⁡     (     v   ,   s     )       =       ∫       t   f     -     Δ   ⁢           ⁢   T         t   f       ⁢     δ   ⁢           ⁢   Π   ⁢           ⁢     (       y   ⁡     (   t   )       ,     Ω   ⁡     (   t   )       ,     v   ⁡     (   t   )       ,   t     )     ⁢           ⁢     ⅆ   t           ,       
 
 where  
               δ   ⁢           ⁢   Π   ⁢           ⁢     (       y   ⁡     (   t   )       ,     Ω   ⁡     (   t   )       ,     v   ⁡     (   t   )       ,   t     )       =       ⁢         (           x   ~     N     ⁡     (   t   )       +     ɛ   ⁢           ⁢     y   ⁡     (   t   )         -       x   sell     ⁡     (   t   )         )     T     ⁢     S   (           x   ~     N     ⁡     (   t   )       +                           ⁢       ɛ   ⁢           ⁢     y   ⁡     (   t   )         -       x   sell     ⁡     (   t   )         )     +     (     diag   (           Θ   ~     N     ⁡     (   t   )       +     ɛ   ⁢           ⁢     Ω   ⁡     (   t   )         -                               ⁢       Θ   data     ⁡     (   t   )       )     )     T     ⁢       R   Ω     (     diag   (           Θ   ~     N     ⁡     (   t   )       +     ɛ   ⁢           ⁢   Ω   ⁢           ⁢     (   t   )       -                             ⁢       Θ   data     ⁡     (   t   )       )     )     +       (           u   ~     N     ⁡     (   t   )       +     ɛ   ⁢           ⁢     v   ⁡     (   t   )         -       u   data     ⁡     (   t   )         )     T                     ⁢     M   ⁡     (           u   ~     N     ⁡     (   t   )       +     ɛ   ⁢           ⁢     v   ⁡     (   t   )         -       u   data     ⁡     (   t   )         )                 
 
 and ε=Δ data /ΔT=1/h, and S, R Ω , and M are symmetric positive definite matrices where S and M have small positive values while R Ω  has large positive values to penalize the variance heavily. The notation diag (A) of an n×n matrix A used here is  
         diag   ⁡     (   A   )       =     [           A   11               A   22             ⋮             A   nn           ]         
 
 and 
 
Θ ii   data ( t )=ε Q   2 +(√{square root over (α)}| x   i   bid ( t )− x   i   ask ( t )|+α Q ) 2  
 
 for each i=1, . . . , n. 
 
 3.4.5 Repair Optimization Problem 
 
         [0064]     The repair optimization problem for the Repair Generator for each window update interval [t 1 , t 2 ] is summarized here as  
         min   v     ⁢       ∫     t   1       t   2       ⁢     δ   ⁢           ⁢   Π   ⁢           ⁢     (       y   ⁡     (   t   )       ,     Ω   ⁡     (   t   )       ,     v   ⁡     (   t   )       ,   t     )     ⁢           ⁢     ⅆ   t             
       subject   ⁢           ⁢   to       
           ⅆ     y   ⁡     (   t   )           ⅆ   t       =           A   ~     ⁡     (   t   )       ⁢     y   ⁡     (   t   )         +         B   ~     ⁡     (   t   )       ⁢     v   ⁡     (   t   )         +       C   ~     ⁡     (   t   )             
       as   ⁢           ⁢   in   ⁢           ⁢     (     ref   ⁢     :     ⁢   repair   ⁢           ⁢   y   ⁢           ⁢   3     )         
                   ⅆ   Ω     ⁢           ⁢     (   t   )         ⅆ   t       =       ⁢           A   ~     ⁡     (   t   )       ⁢           ⁢   Ω   ⁢           ⁢     (   t   )       +     Ω   ⁢           ⁢     (   t   )     ⁢       (           ⁢       A   ~     ⁢     (   t   )       )     T       -                     ⁢             Θ   ~     N     ⁡     (   t   )       ⁢     R     -   1       ⁢   Ω   ⁢           ⁢     (   t   )       -     Ω   ⁢           ⁢     (   t   )     ⁢     R     -   1       ⁢         Θ   ~     N     ⁡     (   t   )         +                     ⁢         ∑     i   =   1     m     ⁢           V   ~     i     ⁡     (   t   )       ⁢       v   i     ⁡     (   t   )           +       ∑     i   =   1     m     ⁢         (         V   ~     i     ⁡     (   t   )       )     T     ⁢       v   i     ⁡     (   t   )           +       D   ~     ⁡     (   t   )                   
       as   ⁢           ⁢   in   ⁢           ⁢     (     ref   ⁢     :     ⁢   RepairOmega   ⁢           ⁢   2     )         
 
 where the repair criterion δπ(y(t), Ω(t), v(t), t) is given in (20). Initial conditions are given as y(t 1 )=0 and Ω(t 1 )=0. 
 
         [0065]     Repair provides y(t), Ω(t), and v(t) for tε[(t f −ΔT) + ,t f   − ].  
         [0000]     3.4.6 Coefficient Generator and Synchronization  
         [0066]     Coefficient Generator and Synchronization (CG&amp;S) is involved in steps  1 ,  3  and  5  of the Continuous Forecast Engine. In general, CG&amp;S reads the real-time data trajectories, and prepares the data and coefficients for use in the Repair Generator and in the Nominal Update Generator. CG&amp;S also updates the information and synchronizes the computations with the sliding window.  
         [0067]     In Step  1  of the CFE, the CG&amp;S module reads the following data at time t=t f : x ask (t), x bid (t), x sell (t), u data (t), f data (t). The data is used to compute Q N (t) for use in the Nominal Update Generator. Because the bid/ask prices give upper and lower bounds on market price (at time t), we can interpret them as the variance, standard deviation, or percentiles, on the average market price. The data is also used in the Repair Generator.  
         [0068]     The data above is evaluated using values at t=t f  and held constant throughout the incremental window [t f   + ,(t f +ΔT) − ].  
         [0069]     The CG&amp;S synchronizes with the Parameter Adaptation Engine to update parameters {circumflex over (p)}(t) at appropriate times, and holds these constant throughout the incremental window [t f   + ,(t f +ΔT) − ]. 
 
 In Step  3  of the CFE, the CG&amp;S module computes the coefficients needed for the Repair Generator to solve the repair optimization model in the sliding time window [(t f −ΔT+Δ data ) + ,(t f +Δ data ) − ]. The coefficients computed are:  
           A   ~     ⁡     (   t   )       =     (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢         u   ~     i   N     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j   N     ⁡     (   t   )             )         
               A   ~     i   x     ⁡     (   t   )       =         A   i     ⁢         x   ~     N     ⁡     (   t   )       ⁢           ⁢   for   ⁢           ⁢   i     =   1       ,   …   ⁢           ,   m       
           B   ~     ⁡     (   t   )       =     (           A   ~     x     ⁡     (   t   )       +   B     )         
             C   ~     ⁡     (   t   )       =           ∑     j   =   1     p     ⁢         g   j   N     ⁡     (   t   )       ⁢     D   j     ⁢         x   ~     N     ⁡     (   t   )           +       Cg   N     ⁡     (   t   )       +           ξ   N     ⁡     (   t   )       .     
     ⁢         Θ   ~     N     ⁡     (   t   )         ⁢     A   i   T     ⁢           ⁢   for   ⁢           ⁢   i       =   1       ,   …   ⁢           ,   m       
             A   i     ⁢         Θ   ~     N     ⁡     (   t   )       ⁢           ⁢   for   ⁢           ⁢   i     =   1     ,   …   ⁢           ,   m       
                 Θ   ~     N     ⁡     (   t   )       ⁢     D   j   T     ⁢           ⁢   for   ⁢           ⁢   j     =   1     ,   …   ⁢           ,   p       
             D   j     ⁢         Θ   ~     N     ⁡     (   t   )       ⁢           ⁢   for   ⁢           ⁢   j     =   1     ,   …   ⁢           ,   p       
 
 In Step  5  of the CFE, the CG&amp;S module updates the new nominal trajectories in the sliding time window [(t_{f}−ΔT+Δ_{data}) + ,(t_{f}+Δ_{data}) − ]
 
 {tilde over (x)}   N ( t )← {tilde over (x)}   N ( t )+ε y ( t ) 
 
{tilde over (Θ)} N ( t )← {tilde over (Θ)}   N ( t )+εΩ( t ) 
 
 ũ   N ( t )← ũ   N ( t )+ε v ( t ) 
 
 where the Repair Generator provides y(t), Ω(t), and v(t). 
 
 3.4.7 Summary of the Continuous Forecast Engine 
 
 Here we summarize the steps in the Continuous Forecast Engine. 
 
         [0070]     Step  0 . Initialize window clock t, current time t f , time interval for the forecast ΔT, the time increment for the filtered data Δ data , and h such that ΔT=hΔ data . Also, initialize S, R Ω , and M, where S and R Ω  are diagonal n×n matrices and M is a diagonal m×m matrix, and S and M have small positive values while R Ω  has large positive values. Let ε=Δ data /ΔT=1/h. Set α, ε_{Q}, and α_{Q}, for use in α, ε Q , and α Q .  
         [0071]     Assume that the nominal trajectories for price {tilde over (x)} N (t), risk evolution {tilde over (Θ)} N (t), and volume ũ N (t) as well as model parameters {circumflex over (p)}(t) and data (x ask (t), x bid (t), x sell (t), u data (t), f data (t), and Δ data ) are available over the interval [(t f −ΔT) + ,t f   − ]. Also assume that previously computed input series (e.g. f N (t), φ N (t), and Q N (t)) are also available over the interval [(t f −ΔT) + ,t f   − ].  
         [0072]     Step  1 . The CG&amp;S module reads the parameters {circumflex over (p)}(t) (A 0 , A i , i=1, . . . ,m, D j , j=1, . . . ,p, B, and C), at t=t f , from the Parameter Adaptation Engine, and determines if the parameters have changed from the previous iteration. It also computes input series and coefficients and sets the time window for the Repair Generator, i.e., [(t f −ΔT) + ,t f   − ]. Also, it inputs the data (x ask (t), x bid (t), x sell (t), u data (t), and f data (t)) at time t f  from the Asynchronous Filter Bank. 
 
 The following input series and coefficients are computed for t=t f :  
             u   ~     N     ⁡     (     t   f     )       =         u   ~     N     ⁡     (       t   f     -     Δ   data       )           
           f   N     ⁡     (   t   )       =       f   data     ⁡     (   t   )           
           A   ~     ⁡     (   t   )       =     (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢         u   ~     i   N     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j   N     ⁡     (   t   )             )         
                 ϕ   N     ⁡     (   t   )       =       ⁢       (         x             ⁢   sell       ⁢     (   t   )       -       x             ⁢   sell       ⁢     (     t   -     Δ             ⁢   data         )         )     -     (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢       u   i   data     ⁡     (   t   )           +                             ⁢       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j   N     ⁡     (   t   )           )     ⁢       x   sell     ⁡     (   t   )         -       Bu   data     ⁡     (   t   )       -       Cf   data     ⁡     (   t   )                 
                 Q   ij   N     ⁡     (   t   )       =       ⁢       ɛ   Q   2     +       max     σ   ∈     [       t   -     Δ   ⁢           ⁢   T       ,   t     ]         ⁢     {       1   2     ⁢     (           α   ⁢               ⁢              x   i   ask     ⁡     (   σ   )       -       x   i   bid     ⁡     (   σ   )                +                                   ⁢     α   Q     )     ⁢     (           α   ⁢               ⁢              x   j   ask     ⁡     (   σ   )       -       x   j   bid     ⁡     (   σ   )                +     α   Q       )       }             
               ⁢       for   ⁢           ⁢   i     ,     j   =   1     ,   …   ⁢           ,   n         
           g   N     ⁡     (   t   )       =           f   N     ⁡     (   t   )       -       f   N     ⁡     (     t   -     Δ   data       )         ɛ         
           ξ   N     ⁡     (   t   )       =           ϕ   N     ⁡     (   t   )       -       ϕ   N     ⁡     (     t   -     Δ   data       )         ɛ         
           W   N     ⁡     (   t   )       =           Q   N     ⁡     (   t   )       -       Q   N     ⁡     (     t   -     Δ   data       )         ɛ         
           γ   y     ⁡     (   t   )       =           x   ~     N     ⁡     (   t   )       -       x   sell     ⁡     (   t   )             
             Θ   ii   data     ⁡     (   t   )       =         ɛ   Q   2     +         (         α     ⁢              x   i   bid     ⁡     (   t   )       -       x   i   ask     ⁡     (   t   )                +     α   Q       )     2     ⁢           ⁢   for   ⁢           ⁢   i       =   1       ,   …   ⁢           ,   n       
           γ   Ω     ⁡     (   t   )       =       diag   ⁡     (         Θ   ~     N     ⁡     (   t   )       )       -     diag   ⁡     (       Θ   data     ⁡     (   t   )       )             
           γ   v     ⁡     (   t   )       =           u   ~     N     ⁡     (   t   )       -       u   data     ⁡     (   t   )             
           B   ~     ⁡     (   t   )       =       [       A   1     ⁢         x   ~     N     ⁡     (   t   )       ⁢        ⋯        ⁢     A   m     ⁢         x   ~     N     ⁡     (   t   )         ]     +   B         
           C   ~     ⁡     (   t   )       =         ∑     j   =   1     p     ⁢         g   j   N     ⁡     (   t   )       ⁢     D   j     ⁢         x   ~     N     ⁡     (   t   )           +       Cg   N     ⁡     (   t   )       +       ξ   N     ⁡     (   t   )             
               V   ~     i     ⁡     (   t   )       =             Θ   ~     N     ⁡     (   t   )       ⁢     A   i   T     ⁢           ⁢   for   ⁢           ⁢   i     =   1       ,   …   ⁢           ,   m       
           D   ~     ⁡     (   t   )       =         ∑     j   =   1     p     ⁢           Θ   ~     N     ⁡     (   t   )       ⁢     D   j   T     ⁢       g   j   N     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢         Θ   ~     N     ⁡     (   t   )       ⁢       g   j   N     ⁡     (   t   )           +       W   N     ⁡     (   t   )             
 
 Step  2 . The Repair Generator uses RSolver to solve the repair optimization model for the repair state y(t), the incremental risk Ω(t), and the repair action v(t) in the time window [t f −ΔT,t f ]. Specifically, solve  
         min   v     ⁢       ∫       t   f     -     Δ   ⁢           ⁢   T         t   f       ⁢     δ   ⁢           ⁢   Π   ⁢           ⁢     (       y   ⁡     (   t   )       ,     Ω   ⁡     (   t   )       ,     v   ⁡     (   t   )       ,   t     )     ⁢     )     ⁢           ⁢     ⅆ   t             
       subject   ⁢           ⁢   to       
           ⅆ     y   ⁡     (   t   )           ⅆ   t       =           A   ~     ⁡     (   t   )       ⁢     y   ⁡     (   t   )         +         B   ~     ⁡     (   t   )       ⁢     v   ⁡     (   t   )         +         C   ~     ⁡     (   t   )       ⁢     
     ⁢                 ⅆ   Ω     ⁢           ⁢     (   t   )         ⅆ   t       =       ⁢           A   ~     ⁡     (   t   )       ⁢           ⁢   Ω   ⁢           ⁢     (   t   )       +     Ω   ⁢           ⁢     (   t   )     ⁢       (           ⁢       A   ~     ⁢     (   t   )       )     T       -                     ⁢             Θ   ~     N     ⁡     (   t   )       ⁢     R     -   1       ⁢   Ω   ⁢           ⁢     (   t   )       -     Ω   ⁢           ⁢     (   t   )     ⁢     R     -   1       ⁢         Θ   ~     N     ⁡     (   t   )         +                     ⁢         ∑     i   =   1     m     ⁢           V   ~     i     ⁡     (   t   )       ⁢       v   i     ⁡     (   t   )           +       ∑     i   =   1     m     ⁢         (         V   ~     i     ⁡     (   t   )       )     T     ⁢       v   i     ⁡     (   t   )           +       D   ~     ⁡     (   t   )                 ⁢     
     ⁢   where   ⁢     
     ⁢             δ   ⁢           ⁢     Π   ⁡     (       y   ⁡     (   t   )       ,     Ω   ⁡     (   t   )       ,     v   ⁡     (   t   )       ,   t     )         =       ⁢           (         γ   y     ⁡     (   t   )       +     ɛ   ⁢           ⁢     y   ⁡     (   t   )           )     T     ⁢     S   ⁡     (         γ   y     ⁡     (   t   )       +     ɛy   ⁡     (   t   )         )         +                     ⁢         (         γ   Ω     ⁡     (   t   )       +     diag   ⁡     (     ɛ   ⁢           ⁢     Ω   ⁡     (   t   )         )         )     T     ⁢       R   Ω     (         γ   Ω     ⁡     (   t   )       +                           ⁢     diag   ⁡     (     ɛ   ⁢           ⁢   Ω   ⁢           ⁢     (   t   )       )       )     +       (         γ   v     ⁡     (   t   )       +     ɛ   ⁢           ⁢     v   ⁡     (   t   )           )     T                     ⁢     M   ⁡     (         γ   v     ⁡     (   t   )       +     ɛ   ⁢           ⁢     v   ⁡     (   t   )           )                       
 
 and ε=Δ data /ΔT=1/h, and initial conditions are 
 
 y ( t   f   −ΔT )=0 
 
Ω( t   f   −ΔT )=0. 
 
 The Repair Generator updates the new nominal trajectories for tε[(t f −ΔT) + ,t f   − ] by adding the repair trajectories to the previous nominals, 
 
 {tilde over (x)}   NN ( t )= {tilde over (x)}   N ( t )+ε y ( t ) 
 
{tilde over (Θ)} NN ( t )={tilde over (Θ)} N ( t )+εΩ( t ) 
 
 ũ   NN ( t )= ũ   N ( t )+ε v ( t ) 
 
 Step  3 . The CG&amp;S module uses the repaired trajectories to provide initial conditions for price {tilde over (x)} N (t) and risk evolution {tilde over (Θ)} N (t) at t=t j , 
 
 {tilde over (x)}   IC   ={tilde over (x)}   NN ( t   f   − )+{tilde over (Θ)} NN ( t   f   − ) R   −1 ( x   sell ( t   f )− {tilde over (x)}   NN ( t   f   − )) 
 
{tilde over (Θ)} IC ={tilde over (Θ)} NN ( t   f   − ). 
 
 It also calculates {tilde over (E)}(t f ) and Ã NN (t f ) using ũ NN (t f )), 
 
 {tilde over (E)} ( t   f )= Bũ   NN ( t   f )+ Cf   N ( t   f )+φ N ( t   f ) 
 
             A   ~     NN     ⁡     (     t   f     )       =       (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢         u   ~     i   NN     ⁡     (     t   f     )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j   N     ⁡     (     t   f     )             )     .         
 
 Note: Add update for Q N (t f ). 
 
 Step  4 . The Nominal Update Generator uses the initial conditions, {tilde over (x)} IC  and {tilde over (Θ)} IC , and coefficients Ã NN (t f ), {tilde over (E)}(t f ), and Q N (t f ), from the CG&amp;S module to solve for the nominal price {tilde over (x)} N (t) and risk {tilde over (Θ)} N (t) trajectories in the incremental time window tε[t f   + ,(t f +ΔT) − ]. Specifically, solve  
           ⅆ         x   ~     N     ⁡     (   t   )           ⅆ   t       =             A   ~     NN     ⁡     (     t   f     )       ⁢         x   ~     N     ⁡     (   t   )         +       E   ~     ⁡     (     t   f     )             
                 ⅆ         Θ   ~     N     ⁢     (   t   )           ⅆ   t       =       ⁢             Θ   ~     N     ⁡     (   t   )       ⁢       (         A   ~     NN     ⁡     (     t   f     )       )     T       +           A   ~     NN     ⁡     (     t   f     )       ⁢         Θ   ~     N     ⁡     (   t   )         -                     ⁢             Θ   ~     N     ⁡     (   t   )       ⁢     R     -   1       ⁢           ⁢         Θ   ~     N     ⁡     (   t   )         +       Q             ⁢   N       ⁡     (     t             ⁢   f       )                   
 
 with initial conditions {tilde over (x)} IC  and {tilde over (Θ)} IC , and the coefficients Ã NN (t f ), {tilde over (E)}(t f ), and Q N (t f ) are kept constant at time t f  throughout the time window. 
 
         [0073]     Output {tilde over (x)} N (t f +ΔT) and √{square root over ({tilde over (Θ)} ii   N (t f +ΔT))} for i=1, . . . ,n, and save {tilde over (x)} N (t), {tilde over (Θ)} N (t), d{tilde over (x)} N (t)/dt, and d{tilde over (Θ)} N (t)/dt every Δ data  throughout the time window in the database for use in the Parameter Adaptation Engine and the Controller.  
         [0000]     Step  5 . Update the sliding window 
 
 t   f   ←t   f +Δ data  
 
 and trajectories for tε[(t f −ΔT) + ,t f   − ]
 
 {tilde over (x)}   N ( t )← {tilde over (x)}   NN ( t ) 
 
{tilde over (Θ)} N ( t )←{tilde over (Θ)} NN ( t ) 
 
 and for tε[(t f −ΔT) + ,t f   − ], 
 
 ũ   N ( t )← ũ   NN ( t ) 
 
 and go to Step  1 . 
 
 3.5 Parameter Adaptation Engine 
 
 The inputs to the Parameter Adaptation Engine (PAE) are the trajectories generated by the Continuous Forecast Engine. These inputs are the trajectories X=({tilde over (x)} N (t), {tilde over (Θ)} N (t), ũ N (t), f N (t), Q N (t)). The Parameter Adaptation Engine generates periodically updates to estimates of the parameters Pars=(A 0 , A i , i=1, . . . ,m, D j , j=1, . . . ,p, B, C). The Parameter Adaptation Engine implements an unbiased minimum variance estimator designed by the Clearsight team. 
 
         [0074]     The main idea is to use the following version of Bayes&#39; rule  
         P   ⁢     (     ⁢   Pars   ⁢        X   )       =         P   (     X   ⁢        Pars   )     ⁢     P   ⁡     (   Pars   )             P   ⁡     (   X   )         .         
 
         [0075]     Pars is a stochastic process whose sample paths record conditional estimates of the parameters for the filtration generated by the process X. The Parameter Adaptation Engine generates the first and second moments of the stochastic process defined by (21).  
         [0076]     The process Pars is sampled at regular time intervals T. During each interval T the conditional expectation (the first moment) is kept constant in CFE. This is required to satisfy a stability requirement of the overall system (see Kushner [4]).  
         [0000]     3.5.1 Observation Model Definition for PAE  
         [0077]     In this subsection we derive the observation model for the process Pars. Recall that the conditional first moment of the price process {tilde over (x)}(t), given a sample of the parameters, is given by (2),  
           ⅆ       x   ~     ⁡     (   t   )           ⅆ   t       =         (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢       u   i     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j     ⁡     (   t   )             )     ⁢       x   ~     ⁡     (   t   )         +     Bu   ⁡     (   t   )       +     Cf   ⁡     (   t   )       +     ϕ   ⁡     (   t   )             
 
 for an interval tε[t 0 ,t 1 ]. 
 
         [0078]     The parameters to be estimated are: 
        A 0  is an n×n matrix,     A i , i=1, . . . ,n is an n×n matrix of rank one, and we assume that the only non-zero value is the ii th  entry, denoted A i     ii   ,     D j , j=1, . . . ,p is a diagonal n×n matrix,     B is a diagonal n×n matrix, with diagonal elements denoted     B ii  for i=1, . . . ,n, and     C is an n×p matrix.     Let η(t) be the observation process  
         η   ⁡     (   t   )       =         ⅆ       x   ~     ⁡     (   t   )           ⅆ   t       -       ϕ   ⁡     (   t   )       .           
       
 
         [0086]     Then from (22)  
           η   ⁡     (   t   )       =         (       A   0     +       ∑     i   =   1     m     ⁢       A   i     ⁢       u   i     ⁡     (   t   )           +       ∑     j   =   1     p     ⁢       D   j     ⁢       f   j     ⁡     (   t   )             )     ⁢       x   ~     ⁡     (   t   )         +     Bu   ⁢     (   t   )       +     Cf   ⁡     (   t   )       +       θ   ~     ⁡     (   t   )           ,       
 
 where {tilde over (θ)}(t) is a zero-mean stochastic process with covariance  
           R   ij     ⁡     (   t   )       =     {                     ⁢         Θ   ~     ii     ⁡     (   t   )           Δ   data               if   ⁢           ⁢   i     =   j             0       otherwise               
 
 that models the observation error. 
 
         [0087]     We write the observation model for the parameters (23) as 
 
η( t )= {tilde over (P)} ( t ) p ( t )+{tilde over (θ)}( t ), 
 
 where p(t) and {tilde over (P)}(t) are defined below. 
 
         [0088]     We define a column vector p(t) of dimension q×1, where q=n 2 +2np+2n as follows:  
         p   ⁡     (   t   )       =     [             p   0     ⁡     (   t   )                   p   A     ⁡     (   t   )                   p   D     ⁡     (   t   )                   p   B     ⁡     (   t   )                   p   C     ⁡     (   t   )             ]         
 
 where each block (p 0 (t), p A (t), p D (t), p B (t), p C (t)) of p(t) is described below. The first block p 0 (t) is an n 2 ×1 column vector consisting of A 0 ,  
           p   0     ⁡     (   t   )       =     [             A     0   11       ⁡     (   t   )                   A     0   12       ⁡     (   t   )               ⋮                 A     0     1   ⁢   n         ⁡     (   t   )       _                 A     0   21       ⁡     (   t   )                   A     0   22       ⁡     (   t   )               ⋮                 A     0     2   ⁢   n         ⁡     (   t   )       _             ⋮                 A     0     n   ⁢           ⁢   1         ⁡     (   t   )       _                 A     0     n   ⁢           ⁢   2         ⁡     (   t   )               ⋮               A     0   nn       ⁡     (   t   )             ]         
 
 the second block p A (t) is an n×1 is an n column vector consisting of the nonzero entries of A i , i=1, . . . ,n,  
           p   A     ⁡     (   t   )       =     [             A     1   11       ⁡     (   t   )                   A     2   22       ⁡     (   t   )               ⋮               A     n   nn       ⁡     (   t   )             ]         
 
 the third block p D (t) is an np×1 column vector consisting of nonzero (diagonal) entries of D j , j=1, . . . ,p,  
           p   D     ⁡     (   t   )       =     [             D     1   11       ⁡     (   t   )                   D     1   22       ⁡     (   t   )               ⋮                 D     1   ⁢   nn       ⁡     (   t   )       _                 D     2   11       ⁡     (   t   )                   D     2   22       ⁡     (   t   )               ⋮                 D     2   ⁢   nn       ⁡     (   t   )       _             ⋮                 D     p   11       ⁡     (   t   )       _                 D     p   22       ⁡     (   t   )               ⋮               D     p   nn       ⁡     (   t   )             ]         
 
 the fourth block p B (t) is an n×1 column vector consisting of the diagonal elements of B,  
           p   B     ⁡     (   t   )       =     [             B   11     ⁡     (   t   )                   B   22     ⁡     (   t   )               ⋮               B   nn     ⁡     (   t   )             ]         
 
 and the fifth block p C (t) is an np×1 column vector consisting of the elements of matrix C,  
           P   C     ⁡     (   t   )       =       [             C   11     ⁡     (   t   )                   C   12     ⁡     (   t   )               ⋮                 C     1   ⁢   p       ⁡     (   t   )       _                 C   21     ⁡     (   t   )                   C   22     ⁡     (   t   )               ⋮                 C     2   ⁢   p       ⁡     (   t   )       _             ⋮                 C     n   ⁢           ⁢   1       ⁡     (   t   )       _                 C     n   ⁢           ⁢   2       ⁡     (   t   )               ⋮               C   np     ⁡     (   t   )             ]     .         
 
         [0089]     We now provide the structure of {tilde over (P)}(t), a sparse n×q matrix. We write this matrix in terms of five blocks {tilde over (P)} 0 (t), {tilde over (P)} A (t), {tilde over (P)} D (t), {tilde over (P)} B (t), {tilde over (P)} C (t): 
 
 {tilde over (P)} ( t )=[ {tilde over (P)}   0 ( t )| {tilde over (P)}   A ( t )| {tilde over (P)}   D ( t )| {tilde over (P)}   B ( t )| {tilde over (P)}   C ( t )]. 
 
 The first block {tilde over (P)} 0 (t) is n×n 2 ,  
             P   ~     0     ⁡     (   t   )       =     [               x   ~     1     ⁡     (   t   )                 x   ~     2     ⁡     (   t   )           ⋯             x   ~     n     ⁡     (   t   )                                                                                                                                                                                 x   ~     1     ⁡     (   t   )                 x   ~     2     ⁡     (   t   )           ⋯             x   ~     n     ⁡     (   t   )                                                                                                                                                                           ⋰                                                                                                                                                                             x   ~     1     ⁡     (   t   )                 x   ~     2     ⁡     (   t   )           ⋯             x   ~     n     ⁡     (   t   )             ]         
 
 the second block {tilde over (P)} A (t) is n×n,  
             P   ~     A     ⁡     (   t   )       =     [                 x   ~     1     ⁡     (   t   )       ⁢       u   1     ⁡     (   t   )                                                                         x   ~     2     ⁡     (   t   )       ⁢       u   2     ⁡     (   t   )                                                                           ⁢   ⋰                                                                     x   ~     n     ⁡     (   t   )       ⁢       u   n     ⁡     (   t   )               ]         
 
 the third block {tilde over (P)} D (t) is n×np,  
             P   ~     D     ⁡     (   t   )       =     [                 x   ~     1     ⁡     (   t   )       ⁢       f   1     ⁡     (   t   )                                                         x   ~     1     ⁡     (   t   )       ⁢       f   2     ⁡     (   t   )                                                                     x   ~     1     ⁡     (   t   )       ⁢       f   p     ⁡     (   t   )                                                                         x   ~     2     ⁡     (   t   )       ⁢       f   1     ⁡     (   t   )                                                         x   ~     2     ⁡     (   t   )       ⁢       f   2     ⁡     (   t   )                                                                     x   ~     2     ⁡     (   t   )       ⁢       f   p     ⁡     (   t   )                                                                 ⋰                                           ⋰                   ⋯                               ⋰                                                                   x   ~     n     ⁡     (   t   )       ⁢       f   1     ⁡     (   t   )                                                         x   ~     n     ⁡     (   t   )       ⁢       f   2     ⁡     (   t   )                                                                     x   ~     n     ⁡     (   t   )       ⁢       f   p     ⁡     (   t   )               ]         
 
 the fourth block {tilde over (P)} B (t) is n×n,  
             P   ~     B     ⁡     (   t   )       =     [             u   1     ⁡     (   t   )                                                                   u   2     ⁡     (   t   )                                                               ⋰                                                               u   n     ⁡     (   t   )             ]         
 
 and the fifth block {tilde over (P)} C (t) is n×np,  
             P   ~     C     ⁡     (   t   )       =       [             f   1     ⁡     (   t   )               f   2     ⁡     (   t   )           ⋯           f   p     ⁡     (   t   )                                                                                                                                                                               f   1     ⁡     (   t   )               f   2     ⁡     (   t   )           ⋯           f   p     ⁡     (   t   )                                                                                                                                                                           ⋯                                                                                                                                                                           f   1     ⁡     (   t   )               f   2     ⁡     (   t   )           ⋯           f   p     ⁡     (   t   )             ]     .         
 
 3.5.2 Discrete Dynamics for PAE 
 
 The Parameter Adaptation Engine generates an estimate of the parameters p at sampled time intervals kΔ data , k=0, 1, 2, . . . . We assume the parameters are time invariant over time-window intervals, therefore the parameter dynamics is given by 
 
 p ( t   k+1 )= p ( t   k )+ v ( t   k ) 
 
 where v(t k ) is a zero mean Gaussian Brownian q process with covariance {tilde over (Q)}(t k ) that models a process noise. 
 
         [0090]     The positive definite matrix {tilde over (Q)}(t k ) is a q×q diagonal matrix with the diagonal elements given in equations (26) and (27). The covariance matrix {tilde over (Q)}(t k ) is computed by finding the trace of the covariance matrix of the stochastic process p(t)−{circumflex over (p)}(t): 
 
 Tr ( E [( p ( t )− {circumflex over (p)} ( t ))( p ( t )− {circumflex over (p)} ( t )) T ])= Tr ( E[p ( t ) p   T ( t )− p ( t ) {circumflex over (p)}   T ( t )− {circumflex over (p)} ( t ) p   T ( t )+ {circumflex over (p)} ( t ) {circumflex over (p)} ( t ) T ]). 
 
 To approximate the covariance, we update our estimate of {tilde over (Q)}(t k ) every length of the time window T, using the last two stored parameter estimates, {circumflex over (p)}(t−tmod(T)−T) and the previous {circumflex over (p)}(t−tmod(T)−2T) as follows,  
             Q   ~     ij     ⁡     (   0   )       =     {                   ⁢           (     α   p     )     2       Δ   data       ⁢     Tr   ⁡     (         p   ^     ⁡     (   0   )       ⁢         p   ^     T     ⁡     (   0   )         )                     ⁢       if   ⁢           ⁢   i     =   j                     ⁢   0               ⁢   otherwise           ⁢           ⁢   for   ⁢           ⁢   i     ,     j   =   1     ,   …   ⁢           ,   q           
 
 and when t mod(T)=0,  
             Q   ~     ij     ⁡     (   t   )       =     {                     ⁢                 ⁢       (           ⁢     α             ⁢   p       )     2                 ⁢     Δ             ⁢   data           ⁢                ∑   q       k   ⁢           =           ⁢   1       ⁢       (           ⁢                 ⁢     p   ^       k     ⁢     (     t   ⁢           -           ⁢   T     )       )     2       -     2   ⁢               ⁢     p   ^       k     ⁢     (     t   -   T     )     ⁢               ⁢     p   ^       k     ⁢     (     t   -     2   ⁢   T       )       +                         ⁢       (           ⁢         p   ^     k     ⁡     (     t   ⁢           -           ⁢   T     )       )     2                          ⁢       if   ⁢           ⁢   i     =   j               0             ⁢   otherwise                 
 
 for i, j=1, . . . ,q, and when t mod(T)≠0, let {tilde over (Q)} ij (t)={tilde over (Q)} ij (t−tmod(T)). We let α p =0.05 initially. Notice that while {tilde over (Q)}(t) is a q×q matrix, it is diagonal and all the diagonal elements have the same value, so it is only necessary to store a single value to represent {tilde over (Q)}(t). 
 
 3.5.3 Estimation Method for {tilde over (Q)}(t) in PAE 
 
 The stochastic equation for parameters is 
 
 dp ( t )=0+ dv ( t ) 
 
 where dv(t) is a zero mean Gaussian Brownian process with covariance {tilde over (Q)}(t)dt, and {tilde over (Q)}(t) is positive definite. 
 
         [0091]     In the forecast engine, we use discrete Kalman filter to update parameters p(t). Given the k th  estimation of parameters, {tilde over (p)} k  and its covariance Σ k|k  and given (k+1) th  observation {tilde over (R)} and given {tilde over (p)}, we update Σ to get 
 
Σ k+1|k+1 =(Σ k|k   +{tilde over (Q)} )−(Σ k|k   +{tilde over (Q)} ) {tilde over (p)}   T (Σ k|k   +{tilde over (Q)} ) {tilde over (p)}   T   +{tilde over (R)} ) −1   {tilde over (p)} (Σ k|k   +{tilde over (Q)} ) 
 
 where {tilde over (R)} and {tilde over (Q)} are diagonal. If k→∞, then Σ k →stable states, which are denoted by Σ ∞ . Therefore as k→∞, then Σ k|k →Σ ∞ , Σ k+1|k+1 →Σ ∞ , and {tilde over (Q)}→{tilde over (Q)} ∞ . Restating equation (28) using Σ ∞  and {tilde over (Q)} ∞  we get 
 
Σ ∞ =(Σ ∞   +{tilde over (Q)}   ∞ )−(Σ ∞   +{tilde over (Q)}   ∞ ) {tilde over (p)}   T ( {tilde over (p)} (Σ ∞   +{tilde over (Q)}   ∞ ) {tilde over (p)}   T   +{tilde over (R)} ) −1   {tilde over (p)} (Σ ∞   +{tilde over (Q)}   ∞ ) 
 
         [0092]     We assume that the parameters are independent in infinity (i.e. Σ ∞  is diagonal), and that the main contribution of {tilde over (p)} to Σ ∞  (i, i) is the i th  column of {tilde over (p)}, and that other columns can be ignored. Let  
         ∑   i   ∞     ⁢               
 
 denote Σ ∞ (i, i), {tilde over (Q)} i   ∞  denote {tilde over (Q)} ∞ (i, i), {tilde over (p)} i  denote the i th  column of {tilde over (p)}. Also assume that for the scaler r,  
           Q   ~     i   ∞     =     {         r                   ⁢     if   ⁢           ⁢     p             ⁢   i       ⁢           ⁢   is   ⁢           ⁢   the   ⁢           ⁢   parameter   ⁢           ⁢   related   ⁢           ⁢   to   ⁢           ⁢   u   ⁢           ⁢     (   t   )     ⁢           ⁢   or     ⁢                                 ⁢         ⁢     x   ⁢           ⁢     (   t   )     ⁢           ⁢   or   ⁢           ⁢     f   ⁡     (   t   )       ⁢           ⁢   terms                       r   2                 if   ⁢           ⁢     p             ⁢   i       ⁢           ⁢   is   ⁢           ⁢   the   ⁢           ⁢   parameter   ⁢           ⁢   associated   ⁢           ⁢   with                 x   ⁡     (   t   )       ⁢     v   ⁡     (   t   )       ⁢           ⁢   or   ⁢           ⁢     x   ⁡     (   t   )       ⁢     f   ⁡     (   t   )       ⁢           ⁢   terms                       
 
 Then we can restate equation (28) again as  
               ∑   i   ∞     ⁢     =       ⁢       (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )     -       (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )     ⁢           p   ~     i   T     ⁡     (             p   ~     i     ⁡     (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )       ⁢       p   ~     i   T       +     R   ~       )         -   1                             ⁢           p   ~     i     ⁡     (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )       .               
 
         [0093]     Let n denote the number of correlated stocks. The structure of {tilde over (p)} i  is n×1, and only one entry is non-zero, which we denote by j. Then  
                       p   ~     i   T     (             p   ~     i     (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )     ⁢       p   ~     i   T       +     R   ~       )       -   1       ⁢       p   ~     i       =       ⁢             p   ~     i     ⁡     (   j   )       ⁢     (     ⁢         p   ~     i     ⁡     (   j   )       ⁢     (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )     ⁢         p   ~     i     ⁡     (   j   )         +                         ⁢       R   ~     ⁡     (     j   ,   j     )       )       -   1       ⁢         p   ~     i     ⁡     (   j   )                   =       ⁢           [         p   ~     i     ⁡     (   j   )       ]     2     ⁢     (     ⁢         p   ~     i     ⁡     (   j   )       ⁢     (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )     ⁢         p   ~     i     ⁡     (   j   )         +                       ⁢       R   ~     ⁡     (     j   ,   j     )       )       -   1               
 
         [0094]     Let α i =({tilde over (p)} i (j)) 2 , where j is index of the only non-zero entry of {tilde over (p)} i , and noting that {tilde over (R)} is an n×n diagonal matrix, then  
               ∑   i   ∞     ⁢     =       ⁢       (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )     -       (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )     ⁢       α   i     (           α   i     ⁡     (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )       ⁢       p   ~     i   T       +                                 ⁢       R   ~     ⁡     (     j   ,   j     )       )       -   1       ⁢     (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )               
                   α   i     ⁡     (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )       ⁢       ∑   i   ∞     ⁢       +       R   ~     ⁡     (     j   ,   j     )         ⁢     ∑   i   ∞           =       ⁢           α   i     ⁡     (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )       2     +       (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )     ⁢       R   ~     ⁡     (     j   ,   j     )         -                     ⁢         α   i     ⁡     (       ∑   i   ∞     ⁢     +       Q   ~     i   ∞         )       2               
               α   i     ⁡     (     ∑   i   ∞     )       2     +       α   i     ⁢       Q   ~     i   ∞     ⁢       ∑   i   ∞     ⁢       -       Q   ~     i   ∞       ⁢       R   ~     ⁡     (     j   ,   j     )               =   0       
 
 which is solved for  
       ∑   i   ∞       
 
         ∑   i   ∞     ⁢     =             -     α   i       ⁢       Q   ~     i   ∞       ±           (       α   i     ⁢       Q   ~     i   ∞       )     2     +     4   ⁢       Q   ~     i   ∞     ⁢       R   ~     ⁡     (     j   ,   j     )                 2   ⁢           ⁢     α   i         .           
 
 Because Σ i   ∞ ≧0 we use only the “+” which gives us  
         ∑   i   ∞     ⁢     =             -     α   i       ⁢       Q   ~     i   ∞       +           (       α   i     ⁢       Q   ~     i   ∞       )     2     +     4   ⁢       Q   ~     i   ∞     ⁢       R   ~     ⁡     (     j   ,   j     )                 2   ⁢           ⁢     α   i         .           
 
 where j corresponds to the one and only non-zero entry of {tilde over (p)} i . 
 
         [0095]     In the algorithm, {tilde over (Q)} i   ∞  will be estimated by  
         ∑   i   ∞     ,       
 
 i.e.  
           Q   ~     i   ∞     =     [           ∑   1   ∞         0       ⋯       0           0         ∑   2   ∞         ⋯       0           ⋮       ⋮       ⋰       ⋮           0       0       ⋯         ∑   q   ∞           ]         
 
 where q is the number of parameters; α i  and {tilde over (Q)} i   ∞  are as we defined above; and R and {tilde over (p)} i  are given functions of time. 
 
 3.5.4 Aggregated Discrete Observation Model for PAE 
 
 To ensure sufficient statistics well-posediness, we need to construct an observation sample out of the observations generated during the interval ΔT. The number of needed observations in the observation sample is a function of the number of parameters to be identified, q. 
 
         [0096]     The discrete observation model is given by 
 
π( t   k )= {tilde over (P)} ( t   k ) p ( t   k )+{tilde over (θ)}( t   k ) 
 
 where {tilde over (θ)}(t k ) is a zero mean discrete Gaussian stochastic measurement noise with covariance {tilde over (R)}(t k ) and π(t k ) and {tilde over (P)}(t k ) are defined later. The covariance matrix {tilde over (R)}(t k ) is an  
         (     n   ⁢       Δ   ⁢           ⁢   T       Δ   data         )     ×     (     n   ⁢       Δ   ⁢           ⁢   T       Δ   data         )         
 
 diagonal matrix given by  
           R   ~     ⁡     (     t   k     )       =     [           R   ⁡     (     t   k     )                                                                 R   ⁡     (       t   k     -       Δ   ⁢             data       )                                                               ⋰                                                             R   ⁡     (       t   k     -     Δ   ⁢           ⁢   T     +       Δ   ⁢             data       )             ]         
 
 where  
           R   ij     ⁡     (     t   k     )       =     {                 Θ   ~     ii     ⁡     (     t   k     )         Δ   data               if   ⁢           ⁢   i     =   j             0       otherwise               
 
 for i, j=1, . . . ,n. 
 
         [0097]     Now we define π(t k ) and {tilde over (P)}(t k ). The column vector π(t k ) is  
           n   ⁡     (       Δ   ⁢           ⁢   T       Δ   data       )       ⨯   1     ,       
 
         Π   ⁡     (     t   k     )       =     [           η   ⁡     (     t   k     )                 η   ⁡     (       t   k     -     Δ   data       )                 η   ⁡     (       t   k     -     2   ⁢     Δ   data         )               ⋮             η   ⁡     (       t   k     -     Δ   ⁢           ⁢   T     +     Δ   data       )             ]         
 
 and each η(t) block is n×1 with  
         η   ⁡     (   t   )       =         ⅆ       x   ~     ⁡     (   t   )           ⅆ   t       -       ϕ   ⁡     (   t   )       .           
 
 The matrix  
               P   ~     ~     ⁡     (     t   k     )       ⁢             ⁢             ⁢   is   ⁢           ⁢       (     n   ⁢       Δ   ⁢           ⁢   T       Δ   data         )     ⨯   q       ,       
 
             P   ~     ~     ⁡     (     t   k     )       =     [             P   ~     ⁡     (     t   k     )                   P   ~     ⁡     (       t   k     -     Δ   data       )                   P   ~     ⁡     (       t   k     -     2   ⁢     Δ   data         )               ⋮               P   ~     ⁡     (       t   k     -     Δ   ⁢           ⁢   T     +     Δ   data       )             ]         
 
 and each {tilde over (P)}(t) block is n×q and given in (24). 
 
 3.5.5 Discrete Filter 
 
 We now describe our implementation of the discrete filter. Let {circumflex over (p)}(t k+1 |t k ) denote an estimate (conditional mean) of p(t) at time sample t k+1  given observations up to time t k , and let {circumflex over (p)}(t k+1 |t k+1 ) denote an estimate f p(t) at time sample t k+1  given an observation at time t k+1 . Let also Σ(t k+1 |t k ) denote the covariance matrix of p(t) at time sample t k+1 . 
 
         [0098]     Let K D (t k+1 ) be a  
       q   ⨯     (     n   ⁢         Δ   ⁢           ⁢   T     ⁢               Δ   data         )         
 
 matrix representing the discrete gain at time sample t k+1 . It is given by (see Jazwinski [3]),  
           K   D     ⁡     (     t     k   +   1       )       =     ∑       (       t     k   +   1       ⁢     ❘     ⁢     t   k       )     ⁢       (         P   ~     ~     ⁡     (     t     k   +   1       )       )     T     ⁢       (             P   ~     ~     ⁡     (     t     k   +   1       )       ⁢     ∑       (       t     k   +   1       ⁢     ❘     ⁢     t   k       )     ⁢       (         P   ~     ~     ⁡     (     t     k   +   1       )       )     T           +       R   ~     ⁡     (     t     k   +   1       )         )       -   1               
 
         [0099]     The propagation of the conditional mean {circumflex over (p)}(t k+1 |t k+1 ) and the covariance matrix Σ(t k+1 |t k+1 ) after an observation at time t k+1  is made is given by the following equations 
 
Σ( t   k+1   |t   k )=Σ( t   k   |t   k )+ {tilde over (Q)} ( t   k+1 ) 
 
Σ( t   k+1   |t   k+1 )=Σ( t   k+1   |t   k )− K   D ( t   k+1 ) {tilde over ({tilde over (P)})} ( t   k+1 )Σ( t   k+1   |t   k ) 
 
 {circumflex over (p)} ( t   k+1   |t   k )= I{circumflex over (p)} ( t   k   |t   k ) 
 
 {circumflex over (p)} ( t   k+1   |t   k+1 )= {circumflex over (p)} ( t   k+1   |t   k )+ K   D ( t   k+1 )(π( t   k+1 )− {tilde over ({tilde over (P)})} ( t   k+1 ) {circumflex over (p)} ( t   k+1   |t   k )). 
 
         [0100]     Equation (34) is called a prediction equation because it gives a way to propagate {circumflex over (p)}(t k |t k ) without an observation. Equation (35) is called a correction equations because it corrects {circumflex over (p)}(t k+1 |t k ) based on an observation made at time t k+1 . The term (π(t k+1 )−{tilde over ({tilde over (P)})}(t k+1 ){circumflex over (p)}(t k+1 |t k )), called an innovation process, gives a difference between an observation made at time t k+1 , π(t k+1 ), and a “predicted observation” {tilde over ({tilde over (P)})}(t k+1 ){circumflex over (p)}(t k+1 |t k ).  
         [0101]     To summarize, we can give the steps needed in the flowchart of PAE.  
         [0000]     Step  0 . Initialize {circumflex over (p)}(0|0) and Σ(0|0). Set current time to t k ←t 0 .  
         [0000]     Step  1 . Set current time to t k ←t k +ΔT. Get information needed from the shared memory system: {tilde over (x)} N (t), η(t), tε[t k −ΔT+Δ data ,t k ]; ũ NN (t k −Δ T ), f data (t k −ΔT).  
         [0000]     Step  2 . Construct π(t k ), {tilde over ({tilde over (P)})}(t k ), {tilde over (R)}(t k ), and {tilde over (Q)}(t k )  
         [0000]     Step  3  Calculate. 
 
Σ( t   k   |t   k   −ΔT )←Σ( t   k   −ΔT|t   k   −ΔT )+ {tilde over (Q)} ( t   k ) 
 
         ∑     (         t   k     ⁢     ❘     ⁢     t   k       -     Δ   ⁢           ⁢   T       )       ←       1   2     ⁢     (       ∑     (         t   k     ⁢     ❘     ⁢     t   k       -     Δ   ⁢           ⁢   T       )       +     ∑       (         t   k     ⁢     ❘     ⁢     t   k       -     Δ   ⁢           ⁢   T       )     T         )           
  K   D ( t   k )←Σ( t   k   |t   k   −ΔT )( {tilde over ({tilde over (P)})} ( t   k )) T ( {tilde over ({tilde over (P)})} ( t   k )Σ( t   k   |t   k   −ΔT )( {tilde over ({tilde over (P)})} ( t   k )) T   +{tilde over (R)} ( t   k )) −1  
 
 {circumflex over (p)} ( t   k   |t   k )← {circumflex over (p)} ( t   k   −ΔT|t   k   −ΔT )+ K   D ( t   k )(π( t   k )− {tilde over ({tilde over (P)})} ( t   k ) {circumflex over (p)} ( t   k   −ΔT|t   k   −ΔT )) 
 
Σ( t   k   |t   k )←( I−K   D ( t   k ) {tilde over ({tilde over (P)})} ( t   k ))Σ( t   k   |t   k   −ΔT ) 
 
Σ( t   k )←(Σ( t   k )+(Σ( t   k )) T )/2 
 
 Step  4 . Go to Step  1 . 
 
 3.5.6 Continuous Measurement Filter for PAE 
 
 This is cut-and-paste from the previous version of PAE, where we did not have enough data to estimate the parameters. 
 
         [0102]     To conclude, given continuous trajectories x(t), u(t), f(t), and φ(t), the continuous measurement process for p(t) is written as 
 
 d{tilde over (x)} ( t )−φ( t ) dt={tilde over (P)} ( t ) p ( t ) dt+d θ( t ) 
 
 where dθ(t) is a zero mean Gaussian stochastic measurement noise with covariance R(t)dt. The noise θ(t) is due to the noise in measuring price. The covariance matrix R(t) is estimated by the risk {tilde over (Θ)}(t) where  
           R   ij     ⁡     (   t   )       =     {                 Θ   ~     ii     ⁡     (   t   )         Δ   data               if   ⁢           ⁢   i     =   j             0       otherwise               
 
 for i, j=1, . . . ,n and Δ data  is the time step in the Continuous Forecast Engine (possibly one second). 
 
         [0103]     Assuming the parameters are constant over short intervals, we specify the dynamics of the parameter system by the following stochastic differential equation 
 
 dp ( t )=0+ dv ( t ) 
 
 where the 0 q×1  column vector indicates that {circumflex over (p)}(t) is constant over the interval of interest, and dv(t) is a zero mean Gaussian Brownian q process with covariance {tilde over (Q)}(t)dt, where {tilde over (Q)}(t) is positive definite. The noise v(t) is due to the noise in the parameters. 
 
 The covariance matrix {tilde over (Q)}(t) is estimated by taking the 
 
 Tr ( E [( p ( t )− {circumflex over (p)} ( t ))( p ( t )− {circumflex over (p)} ( t )) T ])= Tr ( E[p ( t ) p   T ( t )− p ( t ) {circumflex over (p)}   T ( t )− {circumflex over (p)} ( t ) p   T ( t )+ {circumflex over (p)} ( t ) {circumflex over (p)} ( t ) T ]). 
 
 To approximate the covariance, we update our estimate of {tilde over (Q)}(t) every length of the time window T, using the last two stored parameter estimates, {circumflex over (p)}(t−t mod(T)−T) and the previous {circumflex over (p)}(t−t mod(T)−2T) as follows,  
           Q   ~     ij     =     {                     (     α   p     )     2       Δ   data       ⁢     Tr   ⁡     (         p   ^     ⁡     (   0   )       ⁢         p   ^     T     ⁡     (   0   )         )                 if   ⁢           ⁢   i     =   j             0       otherwise         ⁢           ⁢   for   ⁢           ⁢   i     ,     j   =   1     ,   …   ⁢           ,   q           
 
 and when t mod(T)=0,  
             Q   ~     ij     ⁡     (   t   )       =     {                 (     α   p     )     2       Δ   data       ⁢              ∑     k   =   1     q     ⁢       (         p   ^     k     ⁡     (     t   -   T     )       )     2       -     2   ⁢         p   ^     k     ⁡     (     t   -   T     )       ⁢         p   ^     k     ⁡     (     t   -     2   ⁢   T       )         +       (         p   ^     k     ⁡     (     t   -     2   ⁢   T       )       )     2                      if   ⁢           ⁢   i     =   j             0       otherwise               
 
 for i, j=1, . . . ,q, and when t mod(T)≠0, let {tilde over (Q)} ij (t)={tilde over (Q)} ij (t−t mod(T)). We let α p =0.05 initially. Notice that while {tilde over (Q)}(t) is a q×q matrix, it is diagonal and all the diagonal elements are the same value, so it is only necessary to store a single value to represent {tilde over (Q)}(t). 
 
         [0104]     We now apply the continuous measurement filter as described in Hybrid Asynchronous Filter. We propagate the conditional mean {circumflex over (p)}(τ|t k ) and covariance matrix Σ(τ|t k ) according to the following equations,  
           ⅆ       p   ^     ⁡     (     τ   ⁢     ❘     ⁢     t   k       )           ⅆ   τ       =     0   +         K   c     ⁡     (     τ   ⁢     ❘     ⁢     t   k       )       ⁢     (         ⅆ       x   ^     ⁡     (   τ   )           ⅆ   τ       -     ϕ   ⁡     (   τ   )       -         P   ~     ⁡     (   τ   )       ⁢       p   ^     ⁡     (     τ   ⁢     ❘     ⁢     t   k       )           )             
 
 with initial conditions Σ(t k |t k ), and where K c (τ|t k ), a q×n matrix, is the continuous gain given by 
 
 K   c (τ| t   k )=Σ(τ| t   k )( {tilde over (P)} (τ)) T ( R (τ)) −1  
 
 and  
           ⅆ     Σ   ⁡     (     τ   ⁢     ❘     ⁢     t   k       )           ⅆ   τ       =         Q   ~     ⁡     (   τ   )       -       Σ   ⁡     (     τ   ⁢     ❘     ⁢     t   k       )       ⁢       (       P   ~     ⁡     (   τ   )       )     T     ⁢       (     R   ⁡     (   τ   )       )       -   1       ⁢       P   ~     ⁡     (   τ   )       ⁢     Σ   ⁡     (     τ   ⁢     ❘     ⁢     t   k       )               
 
 with initial condition Σ(t k |t k ). Note Σ(τ|t k ) is a q×q symmetric matrix. In the implementation of PAE, the observations d{tilde over (x)}(τ)/dr, φ(τ), {tilde over (P)}(τ), and R(τ) are updated every Δ data  and {tilde over (Q)}(τ) is updated every T. 
 
 For initialization purposes, an initial {circumflex over (p)}(0)={circumflex over (p)} 0  is estimated from historical data using a min least squares approach. 
 
 3.6 Learning Engine 
 
 The concept of the repair strategy is to first use historical data to estimate the parameters of the model. This is called the training mode. Once we have initial estimates for the parameters, we are in the simulated real-time mode. In this mode, we can use the dynamical model (??) with the estimated parameters to solve for the price and risk trajectories. The time window is advanced and the data is updated. Then the parameters are estimated again. As the time window slides, the repair strategy continuously solves for the price and risk trajectories while updating the parameters in real-time, see section 3.4. 
 
 3.7 Lowpass Filter 
 
 The Lowpass Filter is used to filter the predicted price {circumflex over (x)} predict (t) provided by the Forecast Engine to produce x out (t), the price provided to the user. It does this using a Laplace transform of the signals: {circumflex over (X)}     out (t) is the Laplace transform of {circumflex over (x)} out (t).  
           output   ⁢           ⁢   signal       input   ⁢           ⁢   signal       =             x   ^     ℒ   out     ⁡     (   t   )             x   ^     ℒ   predict     ⁡     (   t   )         =         2   ⁢   π       T   LF       ·     1     t   +       2   ⁢   π       T   LF                   
 
         [0105]     T LF  is given; a large value of T LF  filters high frequency signals.  
       =         t   ·         x   ^     out     ⁡     (   t   )         +           x   ^     out     ⁡     (   t   )       ·       2   ⁢   π       T   LF       ·       =         2   ⁢   π       T   LF       ⁢         x   ^     L   predict     ⁡     (   t   )               
 
 Using known properties of Laplace transforms, use inverse Laplace transform            −1 , where: 
 
           −1 ( t·x       out ( t )= {dot over (x)}   out ( t ) 
 
           −1 ( x       out ( t ))= x   out ( t ) 
 
           − ( {circumflex over (x)}       predict ( t ))= {circumflex over (x)}   predict ( t ) 
 
 we have:  
             x   .     out     ⁡     (   t   )       =         2   ⁢   π       T   LF       ⁢     (           x   ^     predict     ⁡     (   t   )       -       x   out     ⁡     (   t   )         )           
 
 For each stock, given {circumflex over (x)} predict (t c +ΔT) and x out (t c +ΔT−Δ c ), which is from the previous filtered forecast, we solve for x out (t c +ΔT). For tε[t c +ΔT−Δ c , t c +ΔT] let {circumflex over (x)} predict (t)=constant={circumflex over (x)} predict (t c +ΔT) We solve the following differential equations  
           ⅆ       x   out     ⁡     (   t   )           ⅆ   t       =         2   ⁢   π       T   LF       ⁢     (           x   ^     predict     ⁡     (       t   c     +     Δ   ⁢           ⁢   T       )       -       x   out     ⁡     (   t   )         )           
        with the initial condition x out (t c +ΔT−Δ c )        
 
         [0107]     If x is a scalar, and x(t)=αx(t)+b for tε[t 0 ,t 1 ], then  
         x   ⁡     (   t   )       =         ⅇ     a   ⁡     (     t   -     t   0       )         ⁢     x   ⁡     (   t   )         +       ∫     t   0     t     ⁢       ⅇ     a   ⁡     (     t   -     t   0       )         ⁢   b   ⁢           ⁢     ⅆ   t               
             x   .     out     ⁡     (   t   )       =         2   ⁢   π       T   LF       ⁢     (         x   out     ⁡     (   t   )       +         2   ⁢   π       T   LF       ⁢         x   ^     predict     ⁡     (       t   c     +     Δ   ⁢           ⁢   T       )                   
        with tε[t c +ΔT−Δ c , t c +ΔT]
 
 Let t 0 =t c +ΔT−Δ c , then  
                 x   out     ⁡     (   t   )       =         ⅇ       -       2   ⁢   π       T   LF         ⁢     (     t   -     t   0       )         ⁢       x   out     ⁡     (     t   0     )         +       ∫     t   0     t     ⁢       ⅇ       -       2   ⁢   π       T   LF         ⁢     (     t   -     t   0       )         ⁢       2   ⁢   π       T   LF       ⁢         x   ^     predict     ⁡     (       t   c     +     Δ   ⁢           ⁢   T       )       ⁢     ⅆ   t                       =         ⅇ       -       2   ⁢   π       T   LF         ⁢     (     t   -     t   0       )         ⁢       x   out     ⁡     (     t   0     )         -       (       ⅇ       -       2   ⁢   π       T   LF         ⁢     (     t   -     t   0       )         ⁢       2   ⁢   π       T   LF       ⁢         x   ^     predict     ⁡     (       t   c     +     Δ   ⁢           ⁢   T       )                t   0     t                   =         ⅇ       -       2   ⁢   π       T   LF         ⁢     (     t   -     t   0       )         ⁢       x   out     ⁡     (     t   0     )         -       [       ⅇ       -       2   ⁢   π       T   LF         ⁢     (     t   -     t   0       )         -   1     ]     ⁢         x   ^     predict     ⁡     (       t   c     +     Δ   ⁢           ⁢   T       )                       =         ⅇ       -       2   ⁢   π       T   LF         ⁢     Δ   data         ⁢       x   out     ⁡     (     t   0     )         -           x   ^     predict     ⁡     (       t   c     +     Δ   ⁢           ⁢   T       )       [       ⅇ       -       2   ⁢   π       T   LF         ⁢     Δ   data         -   1     ]                 
 
 3.8 Implementation 
 
 An overview of the modules in the repair system simulated real-time architecture is included below. In this section and in the flowcharts, we assume that computation is instantaneous, so the clock is not advanced during computation. 
 
 3.8.1 Asynchronous Filter Bank (AFB) 
    Reads asynchronous data from the tape, filters it, then sends filtered data at every Δ data  to the database.     Input: From the data tape when data is available at time t data ; 
 
x ask (t data ),x bid (t data ),x sell (t data ),u data (t data ),f data (t data ) 
    Output: To the database for t every Δ data ; 
 
x ask (t),x bid (t),x sell (t),u data (t),f data (t) 
 
 3.8.2 Parameter Adaptation Engine (PAE) 
    Computes the {circumflex over (p)}(t c ) parameters including {A 0 , A i , i=1, . . . ,n, D j , j=1, . . . ,p, B, C}.     Input: From the database for nominal trajectories at time l=t c −T; 
 
{tilde over (x)} N (l),{tilde over (Θ)} N (l),ũ N (l),f N (l), 
 
 and for time t c ;  
             ⅆ         x   ~     N     ⁡     (   t   )           ⅆ   t       ⁢     |     t   c         ,       ϕ   N     ⁡     (     t   c     )           
    Output: To the database when t c  mod T=0; {circumflex over (p)}(t c ), 
 
 or if {circumflex over (p)}(ξ) was updated for t c −Δ data &lt;ξ≦t c , and ξ mod T=0, then store {circumflex over (p)}(ξ) 
 
 3.8.3 Continuous Forecast Engine (CFE) 
 
 Computes nominal and repair trajectories. Consists of the following elements: Initialization CFE Routine, Coefficient Generator and Synchronization module, Repair Generator and Nominal Update Generator. 
 
 CFE: Initialization CFE Routine 
    Computes an initial estimate of p, and the following data: 
 
{tilde over (x)} IC (t c ),{tilde over (x)} N (t c ),{tilde over (Θ)} IC (t c ),{tilde over (Θ)} N (t c ),Q N (t c ),ũ NN (t c ),f N (t c ), φ N (t c ),g N (t c ),ξ N (t c ),W N (t c ) 
 
 CFE: Nominal Update Generator 
    Computes a forecast of the price and the risk value at t c +ΔT.     Input: 
 
{tilde over (x)} IC (t c ),{tilde over (Θ)} IC (t c ),Ã NN (t c ),{tilde over (E)} NN (t c ),Q N (t c ) 
    Output: To user {tilde over (x)} i   N (t c +ΔT), and √{square root over ({tilde over (Θ)} ii   N (t c +ΔT))} for each stock i=1, . . . ,n and sends to the database, {tilde over (x)} N (τ), ({tilde over (Θ)} N (τ), d{tilde over (x)} N /dt| τ  for t c ≦τ≦t c +ΔT 
 
 CFE: Coefficient Generator and Synchronization (CG&amp;S) 
 
 Computes the coefficients needed for the Repair Generator and the Nominal Update Generator, and also identifies whether the parameters have changed and sets t 1 ,  
         t   1     =     {               t   c     -   T   +     Δ   ⁢           ⁢   T   ⁢           ⁢   if   ⁢           ⁢     t   c         =     0   ⁢   mod   ⁢           ⁢   T                     t   c     ⁢           ⁢   if   ⁢           ⁢     t   c       ≠     0   ⁢   mod   ⁢           ⁢   T                   
 
 where 
    Input: 
 
{circumflex over (p)}(t c ),Q N (t c ),x sell (t c ), 
 
{tilde over (x)} N (t),{tilde over (Θ)} N (t),ũ N (t),f N (t),g N (t),φ N (t),ξ N (t),W N (t) for t=t 1 , t 1 +Δ data , . . . ,t c  
 
x ask (t),x bid (t), t=t   c   −ΔT+Δ   data ,t c −ΔT+2Δ data ,t c  
    Output: 
 
 Coefficients output to CFE for use in the Repair Generator and in the Nominal Update Generator include: 
 
Ã(t),{tilde over (B)}(t),{tilde over (C)}(t),{tilde over (D)}(t),{tilde over (V)}(t),γ y (t),γ Ω (t),γ v (t),for t=t 1 ,t 1 +Δ data , . . . ,t c +ΔT 
 
x sell (t c +ΔT),Q N (t c +ΔT) 
 
 Nominal trajectories stored in the database include: 
 
ũ N (t),f N (t), φ N (t),g N (t),ξ N (t),W N (t),x ask (t),x bid (t) for t=t c +Δ data ,t c +2Δ data , . . . ,t c +ΔT 
 
 CFE: Repair Generator 
 
 Uses the coefficients prepared by CG&amp;S to solve the repair problem (using RSolver or other solver) for the repair variables over [t 1 ,t c ], which is considered long repair if parameters have changed and t 1 =t c −T+ΔT, or short repair if parameters have not changed and t 1 =t c . Also computes observations η needed for PAE. 
    Input: 
 
Ã(t),{tilde over (B)}(t),{tilde over (C)}(t),{tilde over (D)}(t),{tilde over (E)}(t),{tilde over (V)}(t),γ y (t),γ Ω (t),γ v (t),{tilde over (x)} N (t),{tilde over (Θ)} N (t),ũ N (t) for t=t 1 ,t 1 +Δ data , . . . ,t c +ΔT 
 
{tilde over (x)} N (t),{tilde over (Θ)} N (t),ũ N (t),f N (t) for t=t c −ΔT+Δ data ,t c −ΔT+2Δ data , . . . ,t c  
    Output: 
 
 To CFE: {tilde over (x)} NN (t c ), {tilde over (Θ)} NN (t c ) 
 
 To Shared Memory System: 
 
R(t),η(t) for t=t c −ΔT+Δ data ,t c −ΔT+2Δ data , . . . ,t c , and ũ NN (t c ),f N (t c )