Gaussian Process priors with Uncertain Inputs: Multiple-Step-Ahead Prediction

Similar documents
Glasgow eprints Service

Derivative observations in Gaussian Process models of dynamic systems

Multiple-step Time Series Forecasting with Sparse Gaussian Processes

Gaussian Process for Internal Model Control

Learning Gaussian Process Models from Uncertain Data

Gaussian process for nonstationary time series prediction

Probabilistic & Unsupervised Learning

q is a function of the inputs corresponding to the same cases p and q. In general, a stationary (depends only on the distance between points in the in

Analytic Long-Term Forecasting with Periodic Gaussian Processes

Lecture 1c: Gaussian Processes for Regression

Where now? Machine Learning and Bayesian Inference

Model Selection for Gaussian Processes

Anomaly Detection and Removal Using Non-Stationary Gaussian Processes

Nonparametric Bayesian Methods (Gaussian Processes)

Gaussian Processes in Reinforcement Learning

Gaussian Process Approximations of Stochastic Differential Equations

GAS-LIQUID SEPARATOR MODELLING AND SIMULATION WITH GAUSSIAN PROCESS MODELS

STA 414/2104, Spring 2014, Practice Problem Set #1

Gaussian Process Model Based Predictive Control

Reinforcement Learning with Reference Tracking Control in Continuous State Spaces

Introduction to Gaussian Processes

Gaussian Process Regression

Regression with Input-Dependent Noise: A Bayesian Treatment

Mobile Robot Localization

A Statistical Input Pruning Method for Artificial Neural Networks Used in Environmental Modelling

Machine Learning 4771

ADAPTIVE, CAUTIOUS, PREDICTIVE CONTROL WITH GAUSSIAN PROCESS PRIORS. Roderick Murray-Smith Daniel Sbarbaro Carl Edward Rasmussen Agathe Girard

STAT 518 Intro Student Presentation

Gaussian Process Vine Copulas for Multivariate Dependence

Lecture 3: Pattern Classification. Pattern classification

Bayesian Inference of Noise Levels in Regression

Lecture 5: GPs and Streaming regression

Gaussian Processes for Regression. Carl Edward Rasmussen. Department of Computer Science. Toronto, ONT, M5S 1A4, Canada.

Nonparameteric Regression:

Model-Based Reinforcement Learning with Continuous States and Actions

GWAS V: Gaussian processes

Gaussian Process Dynamical Models Jack M Wang, David J Fleet, Aaron Hertzmann, NIPS 2005

MODEL Predictive Control (MPC) is one of the most frequently

The Variational Gaussian Approximation Revisited

Slice Sampling with Adaptive Multivariate Steps: The Shrinking-Rank Method

COMP 551 Applied Machine Learning Lecture 20: Gaussian processes

Te Whare Wananga o te Upoko o te Ika a Maui. Computer Science

20: Gaussian Processes

CSci 8980: Advanced Topics in Graphical Models Gaussian Processes

Bayesian Quadrature: Model-based Approximate Integration. David Duvenaud University of Cambridge

Gaussian processes. Chuong B. Do (updated by Honglak Lee) November 22, 2008

Prediction of Data with help of the Gaussian Process Method

Approximate Inference Part 1 of 2

Probabilistic Graphical Models Lecture 20: Gaussian Processes

STA 4273H: Sta-s-cal Machine Learning

2 Statistical Estimation: Basic Concepts

Variational Principal Components

Modelling and Control of Nonlinear Systems using Gaussian Processes with Partial Model Information

Reliability Monitoring Using Log Gaussian Process Regression

A parametric approach to Bayesian optimization with pairwise comparisons

Gaussian Processes (10/16/13)

Using Gaussian Processes for Variance Reduction in Policy Gradient Algorithms *

6.867 Machine learning

Approximate Inference Part 1 of 2

Lecture 3: Latent Variables Models and Learning with the EM Algorithm. Sam Roweis. Tuesday July25, 2006 Machine Learning Summer School, Taiwan

Expectation Propagation in Dynamical Systems

PILCO: A Model-Based and Data-Efficient Approach to Policy Search

MTTTS16 Learning from Multiple Sources

Gaussian Process Regression Forecasting of Computer Network Conditions

Lecture Note 2: Estimation and Information Theory

output dimension input dimension Gaussian evidence Gaussian Gaussian evidence evidence from t +1 inputs and outputs at time t x t+2 x t-1 x t+1

Gaussian Process Regression: Active Data Selection and Test Point. Rejection. Sambu Seo Marko Wallat Thore Graepel Klaus Obermayer

ebay/google short course: Problem set 2

Computer Vision Group Prof. Daniel Cremers. 9. Gaussian Processes - Regression

Tutorial on Gaussian Processes and the Gaussian Process Latent Variable Model

Dual Estimation and the Unscented Transformation

ACCELERATED LEARNING OF GAUSSIAN PROCESS MODELS

Active and Semi-supervised Kernel Classification

Practical Bayesian Optimization of Machine Learning. Learning Algorithms

Least Absolute Shrinkage is Equivalent to Quadratic Penalization

Optimization of Gaussian Process Hyperparameters using Rprop

CSC 2541: Bayesian Methods for Machine Learning

Power EP. Thomas Minka Microsoft Research Ltd., Cambridge, UK MSR-TR , October 4, Abstract

Computer Vision Group Prof. Daniel Cremers. 4. Gaussian Processes - Regression

Dynamical systems identification using Gaussian processes models with incorporated local models

Lecture 9. Time series prediction

CSC2541 Lecture 2 Bayesian Occam s Razor and Gaussian Processes

Lecture: Gaussian Process Regression. STAT 6474 Instructor: Hongxiao Zhu

Nonparmeteric Bayes & Gaussian Processes. Baback Moghaddam Machine Learning Group

Finding minimum energy paths using Gaussian process regression

Modelling Transcriptional Regulation with Gaussian Processes

Machine Learning Basics III

EM-algorithm for Training of State-space Models with Application to Time Series Prediction

Type II variational methods in Bayesian estimation

CS 7140: Advanced Machine Learning

Bayesian optimization for automatic machine learning

MACHINE LEARNING ADVANCED MACHINE LEARNING

Density Estimation. Seungjin Choi

STA414/2104. Lecture 11: Gaussian Processes. Department of Statistics

Gaussian Processes. Le Song. Machine Learning II: Advanced Topics CSE 8803ML, Spring 2012

A variational radial basis function approximation for diffusion processes

Gaussian with mean ( µ ) and standard deviation ( σ)

Computer Intensive Methods in Mathematical Statistics

Transcription:

Gaussian Process priors with Uncertain Inputs: Multiple-Step-Ahead Prediction Agathe Girard Dept. of Computing Science University of Glasgow Glasgow, UK agathe@dcs.gla.ac.uk Carl Edward Rasmussen Gatsby Unit University College London London, UK edward@gatsby.ucl.ac.uk Roderick Murray-Smith Dept. of Computing Science University of Glasgow & Hamilton Institute National University of Ireland Maynooth, Ireland rod@dcs.gla.ac.uk Abstract We consider the problem of multi-step ahead prediction in time series analysis using the non-parametric Gaussian process model. k-step ahead forecasting of a discrete-time nonlinear dynamic system can be performed by doing repeated one-step ahead predictions. For a state-space model of the form y t = f(y t,...,y t L ), the prediction of y at time t + k is based on the estimates ŷ t+k,...,ŷ t+k L of the previous outputs. We show how, using an analytical Gaussian approimation, we can formally incorporate the uncertainty about intermediate regressor values, thus updating the uncertainty on the current prediction. In this framework, the problem is that of predicting responses at a random input and we compare the Gaussian approimation to the Monte-Carlo numerical approimation of the predictive distribution. The approach is illustrated on a simulated non-linear dynamic eample, as well as on a simple one-dimensional static eample. Technical Report TR--9, Department of Computing Science, University of Glasgow, October,.

Introduction One of the main objectives in time series analysis is forecasting and in many real life problems, one has to predict ahead in time, up to a certain time horizon (sometimes called lead time or prediction horizon). Furthermore, knowledge of the uncertainty of the prediction is important. Currently, the multiple-step ahead prediction task of a discrete-time non-linear dynamic system is achieved by either eplicitly training a direct model to predict k steps ahead, or by doing repeated one-step ahead predictions up to the desired horizon, which we call the iterative method. There are a number of reasons why the iterative method might be preferred to the direct one. Firstly, the direct method makes predictions for a fied horizon only, making it computationally demanding if one is interested in different horizons. Furthermore, the larger k, the more training data we need in order to achieve a good predictive performance, because of the larger number of missing data between t and t + k. On the other hand, the iterated method provides any k-step ahead forecast, up to the desired horizon, as well as the joint probability distribution of the intermediate points. In the Gaussian process modelling approach, one computes predictive distributions whose means serve as output estimates. (O Hagan, 978) was one of the first to introduce the Gaussian process (GP) for regression but it really started being a popular non-parametric modelling approach after the publication of (Neal, 995). In (Rasmussen, 996), it is shown that GPs can achieve a predictive performance comparable to (if not better than) other modelling approaches like neural networks or local learning methods. We will show that for a k-step ahead prediction which ignores the accumulating prediction variance, the model is not conservative enough, with unrealistically small uncertainty attached to the forecast. An alternative solution is presented for iterative k-step ahead prediction, with propagation of the prediction uncertainty. This report is organised as follows. First, we recall the main equations used in Gaussian Process modelling. Then, we derive the epressions of the predictive mean and variance when predicting at an uncertain input and show how we can use these results for the iterative multiple-step ahead forecasting of time-series. We illustrate the approach on static and dynamic eamples and we finish with some conclusions. Modelling with Gaussian Processes For a comprehensive introduction to Gaussian Process modelling, please refer to (Mackay, 997), (Williams and Rasmussen, 996), or the more recent review (Williams, ).. The GP prior model Formally, the random function or stochastic process f() is a Gaussian process with mean m() and covariance function C( p, q ), if its values at a finite number of points f( ),...,f( n ) are seen as the components of a random vector normally distributed. That is, for each n: f( ),...,f( n ) N(, Σ), ()

where Σ is an n n covariance matri whose entries give the covariances between each pair of points and which is a function of the corresponding inputs, Σ pq =Cov(f( p ),f( q )) = C( p, q )... Role of the covariance function The choice of the covariance function is of great importance and, as much as possible, should reflect one s prior knowledge or assumption about the underlying function (e.g. smoothness, continuity assumptions). Here, as a special case, we assume that the process is stationary: the mean is constant (chosen to be zero) and the covariance function only depends on the distance between the inputs. A common choice is [ C( p, q )=v ep D d= ( p d ] q d ) wd, () where D is the input dimension. Figure shows an eample (in -D) of the covariance matri corresponding to this function. v and w d are hyperparameters of the covariance function. K..5..5.5 5 Gaussian covariance matri 5 5 5 Figure : -D eample of a data covariance matri K =Σ+v I where Σ has been computed using the Gaussian covariance function given by () and v is the white noise variance. The matri plotted is, for [, ], but the learning was based on N =data points (black dots, here divided by a factor of so as to be at the same scale as the covariance). The corresponding hyperparameters are v =.96, w =.988, and v =.73 (found by Maimum Likelihood, see section.). This particular choice of Gaussian (squared eponential) covariance function corresponds to a prior assumption that the underlying function f is smooth and continuous (figure shows samples from a GP with such a covariance function). It accounts for a high correlation between the outputs of cases with nearby inputs. The parameter v gives the overall scale of correlations and the w parameters allow a different distance measure for each input dimension d (correlation length in direction d). For a given problem, these parameters are adjusted to the data at hand and, for irrelevant inputs, the corresponding w d will tend to zero. It can be noted that the covariance function in the GP framework is very similar to the kernel used in the Support Vector Machines community. In theory, the only restriction on the choice of covariance function is that it has to generate a non-negative definite covariance matri (more discussion about alternative choices of covariance functions can be found in (Mackay, 997)). Automatic Relevance Determination idea developed by MacKay and Neal (Neal, 995) 3

. Gaussian Process for regression We assume a statistical model y = f() +ɛ with an additive uncorrelated Gaussian white noise with variance v, ɛ N(,v ). Given a set of N data pairs D = {y i, i } N i= and a GP prior on f(), with zero-mean and Gaussian covariance function such as (), our aim is to get the predictive distribution of the function value f( ) at a new (given) input... Learning by Maimum Likelihood The likelihood of the data is simply y N(,K), (3) where y is the N vector of targets and K is the N N data covariance matri, such that K pq =Σ pq + v δ pq where δ pq is non-zero only when p = q. In a Maimum Likelihood framework, we then adjust the vector of hyperparameters Θ=[w...w D v v ] T so as to maimise the log-likelihood L(Θ) = log p(y) = log K yt K y N log(π), (4) which requires the calculation of the derivative of L(Θ) with respect to each hyperparameter Θ j, given by L(Θ) = [ ] Θ j Tr K K + Θ j yt K K K y, (5) Θ j where Tr denotes the trace..5.5.5 Samples from the GP(,Σ) prior (dashed lines) and posterior the data data points Figure : Realisations from a GP with -mean and training covariance matri K = Σ + v I (see figure ). Dashed lines: Samples from the a priori GP (not taking account of the data). Solid lines: Samples from the posterior, i.e. conditioned on the training points. Also shown (black), the true function f() = sin / with training data (true noise level of.). 8 6 4 4 6 8.. Prediction at For a given, the predictive distribution of f( ), or equivalently of y, is simply obtained by conditioning on the training data to obtain p(f( ), D). 4

The joint distribution of the variables being Gaussian, this conditional distribution is also Gaussian with mean and variance µ( )=k( ) T K y (6) σ ( )=k( ) k( ) T K k( ) (7) where k( )=[C(, ),...,C( N, )] T is the N vector of covariances between the new point and the training targets and k( )=C(, ). The predicted mean µ( ) serves as an estimate of the function output, ˆf( ), with uncertainty σ( ). It is also a point estimate for the corresponding noisy target ŷ, with variance σ ( )+v. Figure 3 shows the predictions at four new inputs. We see that the prediction at far away from the data, or near the edges, leads to a predicted point with a variance larger than that at nearby the training inputs. This is because k( ) decreases as the distance between and the training points increases (see figure 9), thus decreasing the k( ) T K k( ) term and therefore increasing the variance. Mean predictions at * = 8 3 7 with σ error bars..8.6.4.. Figure 3: Mean predictions at = 8, 3,, 7 with their σ error-bars, computed using equations (6) and (7) resp. For far away from the data, or near the edges, the corresponding uncertainty is large. Also plotted, the true function and the training points (black crosses)..4 8 6 4 4 6 8 It is worth noting that the predictive mean µ( ) can be seen as a weighted sum of the training data µ( )=s T y, with s T = k( ) T K (8) where s is called the smoothing or effective kernel. Alternatively, one can see it as a linear combination of the covariance between the new and the training points (Williams, ): µ( )=k( ) T α, with α = K y. (9) Either the smoothing kernels or the alpha-coefficients depend on the density of the points, through the inverse of the covariance matri. Figure 4 shows the smoothing kernels and alpha-coefficients corresponding to the case when there are only training points and when the number of training points is large (N = ). For a large number of training points, the value of the alpha-coefficients is higher than for a few points. On the contrary, the amplitude of the smoothing kernels is smaller. 5

..5 Smoothing kernels.5 8 6 4 4 6 8 4 8 6 4 4 6 8 Alpha coefficients 4 8 6 4 4 6 8 8 6 4 4 6 8 Figure 4: First two plots: Smoothing kernels s T = k( ) T K for a large (top) and a small (bottom) number of training points (N). The solid line and crosses correspond to = 8, for N = and N = resp., the dashed line and circles to = 3, the dotted line and asterisks to = and the dash-dot line and points to =7. The last two plots show the alpha-coefficients α = K y for N = and N =(the points are not joined when N = due to the sparse nature of the training set). 3 Prediction at a random input If we now wish to predict the distribution of the function value, p(f( )), at the random variable, with N(µ, Σ ), the predictive distribution is obtained by integrating over the input distribution p(f( ) µ, Σ, D)) = p(f( ), D))p( )d, () ] where p(f( ), D)) = [ σ( ) ep (f( ) µ( )) π with mean µ( ) and variance σ ( ) σ ( ) as given by equations (6) and (7) respectively. 3. Numerical approimation Given that the integral () is analytically intractable (p(f( ) ) is a complicated function of ), one possibility is to perform a numerical approimation of the integral by a simple Monte-Carlo approach: p(f( ) µ, Σ, D)) = p(f( ), D))p( )d T T p(f( ) t, D)), () t= where t are (independent) samples from p( ), which are, in this Gaussian case, readily obtained. Figure 5 illustrates the Monte-Carlo approimation for the D static case. We can also use this approach to assess the goodness of the Gaussian approimation, i.e. if the error-bars of the Gaussian approimation encompass all the samples up to step k, we can conclude that the approimation is valid up to that step. Figure 6 shows the histogram of the mean predictions corresponding to samples from p( ), for Σ =(left) and Σ =.5 (right). 6

.5.5.5 MC samples with σ error bars.5 8 6 4 4 6 8.5.5.5.5 8 6 4 4 6 8 when Σ *= when Σ *=.5 Figure 5: Monte-Carlo approimation when predicting at N(µ, Σ ), for µ = 8, 3,, 7, Σ = (top) and Σ =.5 (bottom). For samples t from the different p( ), we plot the predicted means with their σ error-bar (dotted lines). Also plotted, the sample-mean and sample-()standard deviation at the mean of the sampled t (thick solide lines). 6 4 Histogram of predicted outputs (Σ *=)..5.5..5 3.....3.4.5.6.7.8.9.3.....3.4.5.6.7.8.9.. 4 mean =.6 mean =.5 mean =.67 mean =.59.3.....3 5..5.5..5 3.....3.4.5.6.7.8.9 5 5.3.....3.4.5.6.7.8.9.. 4 mean =.53 Histogram of predicted outputs (Σ *=.5) mean =.73 mean =.96 mean =.47.3.....3 Figure 6: Histograms of predicted means corresponding to samples from N(µ, Σ ), for µ = 8, 3,, 7, (top to bottom), Σ =(left) and Σ =.5 (right). Also given, the value of the sample-mean. 7

3. Gaussian approimation The analytical Gaussian approimation consists in only computing the mean and variance of f( ) µ, Σ, D). They are obtained using respectively the law of iterated epectations and law of conditional variances: m( )=E [E f( )[f( ) ]] = E [µ( )] () v( )=E [var f( )(f( ) )] + var (E f( )[f( ) ]) = E [σ ( )] + var (µ( )) (3) where E indicates the epectation under. Now, µ( ) and σ ( ), as given by equations (6) and (7), are functions of the random argument and we need further approimations to be able to compute these moments. 3.3 Predictive mean m( ) We approimate µ( ) by its first order Taylor epansion around µ : µ( )=µ(µ )+ µ( ) T ( µ )+O( µ ) (4) =µ with µ(µ )=k(µ ) T K y and where µ =( µ ) T ( µ ). Then, according to equation (), we have [ ] E [µ( )] E µ(µ )+ µ( ) T ( µ ) = µ(µ ). (5) =µ Therefore, we see that, within a first order Taylor epansion, the mean prediction at a random does not provide any correction over the zero th order, we have m( )=k(µ ) T K y. (6) Of course, the goodness of the first order approimation depends on the curvature of µ( ), as well as on the variance of : in one dimension, it can easily be seen geometrically that if µ( ) has high curvature at µ, this approimation will not be valid, unless Σ is very small (see figure 7). The test inputs were chosen so as to illustrate different features: small function gradient and high density of training points at =7, small function gradient but near the edge (few training points) at = 8, high function gradient and high density of training points at =and at last high function gradient with few training points for = 3. 3.4 Predictive variance v( ) To compute the variance, we first need to calculate E [σ ( )]. For this, we need to approimate σ ( ) and a natural choice is its second order Taylor epansion around µ : σ ( ) = σ (µ )+ σ ( T ) ( µ ) =µ + ( µ ) T σ ( ) T ( µ )+O( µ 3 ) (7) 8 =µ

.5 Random inputs and corresponding targets.5.5 8 6 4 4 6 8.5.5.5 Figure 7: Function outputs (dots) and targets (crosses) corresponding to different inputs taken from N(µ, Σ ), for µ = 8, 3,, 7 and Σ =(top) and.5 (bottom). Also plotted, the gradients at the different µ. If Σ is large and the gradient is steep, targets from p( ) will be quite far from the target at µ. 8 6 4 4 6 8 with σ (µ )=k(µ ) k(µ ) T K k(µ ). Thus, we have [ E [σ ( )] σ (µ )+E ( µ ) T σ ( ) T ( µ ) =µ ], (8) and using the formula giving the epectation of a quadratic form under a Gaussian, we arrive at { E [σ ( )] σ (µ )+ Tr σ ( } ) T Σ. (9) Furthermore, using (4), we have var (µ( )) ( var µ(µ )+ µ( ) = µ( ) T µ( ) Σ =µ T =µ ( µ ) =µ =µ ). () This leads to v( )=σ (µ )+ Tr { σ ( ) T Σ =µ } + µ( ) T Σ =µ µ( ) =µ () which we can also write { v( )=σ (µ )+Tr Σ ( σ ( ) T + µ( ) =µ =µ µ( ) T =µ )} () ( µ) T Σ ( µ)n (m, S)d =(µ m) T Σ (µ m)+tr[σ S] 9

with µ( ) d σ ( ) d e = k( ) T d = k( ) d e K y (3) k( ) T d K k( ) e k( ) T d e K k( ) (4) for d, e =...D(input dimension) and partial derivatives evaluated at = µ. Compared to the predicted variance obtained in the non-random input case, we now have a correction term of the zero th order which involves the computation of the first and second derivatives of the covariance function (). Figure 8 illustrates the Gaussian approimation when predicting at a random. GP approimation: Mean predictions with σ error bars.5.5.5.5 8 6 4 4 6 8.5.5 Figure 8: Gaussian approimation when predicting at N(µ, Σ ), for µ = 8, 3,, 7, Σ =(top) and Σ =.5 (bottom). Plot of the predicted means with their σ error-bars..5.5 8 6 4 4 6 8 3.4. Computing the derivatives We need to compute the first and second derivatives of the covariance between the new points and the training points, with respect to changes in the components of those points. We have [ k i ( )=C( i, )=v ep ] D w d ( i d d ) where k i ( ) is the i th component of k( ). The first and second derivatives evaluated at = µ are then given by k i ( ) d k i ( ) d e d= w d ( =µ = i d µ d)k i (µ ) = w d [ δ de +( i d µ d)w e ( i e µ e)]k i (µ ). =µ Figure 9 shows k, dk/d and d k/d in the one dimensional case. It is straightforward that we have k( ) = k( ) d =since d k( )=C(, )=v. e (5) (6)

k( * ) dk( * )/d d k( * )/d..5..5 Covariance between test and training points and derivatives 8 6 4 4 6 8..5.5. 8 6 4 4 6 8.5.5 8 6 4 4 6 8 Figure 9: Covariance between test ( ) and training points (top) with first (middle) and second (bottom) derivatives. The functions are plotted for training points and also marked at the training points previously used. The solid lines and crosses correspond to = 8, dashed lines and circles to = 3, dotted lines and asterisks to =and finally dash-dot lines and points to =7. Close to the training points, the term k( )/ is close to zero, implying a very small contribution to the variance from the term µ( )/. Replacing in (3) we obtain µ( ) =[w d ( d µ d).k(µ )] T K y, d =µ (7) for the derivative of the mean, and in (4), we get for the second derivative of the variance σ ( ) d = e =µ w d w e {[( d µ d).k(µ )] T K [( e µ e).k(µ )] +[( d µ d).( e µ e).k(µ )] T K k(µ )} (8) +w d k(µ ) T K k(µ )δ de (9) where d is the N vector of input data in the d th dimension and a.b denotes the componentwise product of vectors a and b. Note that w d k(µ ) T K k(µ )δ de =w d (k(µ ) σ (µ ))δ de withk(µ )=v. (3) 4 Application to the iterative k-step ahead prediction of time series We wish to apply these results to the multiple-step ahead prediction task of time series. Currently, this can be achieved by either training the model to learn how to predict k steps ahead (direct method) or by making repeated one-step ahead predictions (iterative method). In what follows, we are concerned with the iterative approach and suggest to propagate the uncertainty as we predict ahead in time. 4. Naive iterative k-step ahead prediction Consider the time series y t,...,y t and the state-space model { t i =[y t i,...,y t i L ] T y t i = f( t i )+ɛ t i (3)

where the state at time t i is composed of previous outputs, up to a given lag 3 L and the (white) noise has variance v. The iterative k-step ahead prediction method works as follows: it predicts only one time step ahead, using the estimate of the output of the current prediction, as well as previous outputs (up to the lag L), as the input to the prediction of the net time step, until the prediction k steps ahead is made. Using the model (3) and assuming the data is known up to, say, time step t, the prediction of y at t + k is computed via t+ =[y t,y t,...,y t+ L ] T f( t+ ) N(µ( t+ ),σ ( t+ )) ŷ t+ = µ( t+ ) t+ =[ŷ t+,y t,...,y t+ L ] T f( t+ ) N(µ( t+ ),σ ( t+ )) ŷ t+ = µ( t+ ). t+k =[ŷ t+k, ŷ t+k,...,ŷ t+k L ] T f( t+k ) N(µ( t+k ),σ ( t+k )) ŷ t+k = µ( t+k ) where the point estimates µ( t+k i ) are computed using equation (6). This setup does not account for the uncertainty induced by each successive prediction (variance σ ( t+k i )+v associated to each ŷ, given by (7)). 4. Propagating the uncertainty Using the results derived in the previous section, we propose to formally incorporate the uncertainty information about the future regressor. That is, as we predict ahead in time, we now view the lagged outputs as random variables. In this framework, if, as before, data are known up to time t and we wish to predict k steps ahead, we now have at t +, t+ N y t... y t+ L,............... predict y t+ N(m( t+ ),v( t+ )+v ), using (6) and (), with = t+ at t +, t+ N m( t+ )... y t+ L, predict y t+ N(m( t+ ),v( t+ )+v ) v( t+ )+v............... 3 In this report, we are not concerned with the identification of the lag and assume it has a known, fied value..

at t + k, t+k N m( t+k )... m( t+k L ), v( t+k )+v... cov(y t+k,y t+k L )......... cov(y t+k L,y t+k )... v( t+k L + v ) predict y t+k N(m( t+k ),v( t+k )+v ). Input distribution At time t+k, we have the random input vector t+k =[y t+k,...,y t+k L ] T with mean formed by the predicted means of the lagged outputs y t+k τ, τ =,...,L,given by (6). The L L input covariance matri has the different predicted variances on its diagonal: Σ ii = v( t+k i ), for i =...L, computed with (). t+k The cross-covariance terms are obtained as follows: at time step t + k, we predict y t+k and then, for the net time step, we need to compute the covariance between y t+k and [y t+k,...,y t+k+ L ]. That is, in general, we want to compute cov(y t+k, t+k ): cov(y t+k, t+k )=E[y t+k t+k ] E[y t+k ]E[ t+k ] (3) with E[y t+k ] given by (6) and E[ t+k ]=µ t+k. Wehave E[y t+k t+k ] = y t+k t+k p(y t+k t+k )p( t+k )dy t+k d t+k (33) [ ] = t+k µ(µ t+k)+ µ(t+k T ) t+k ( t+k µ t+k) p( t+k )d(34) t+k t+k =µ t+k which gives E[y t+k t+k ]=µ(µ t+k)µ t+k + µ(t+k ) T Σ t+k. t+k =µ t+k So that the cross-covariance terms are given by cov(y t+k, t+k )= µ(t+k ) t+k 5 Illustrative eamples T t+k =µ t+k Σ t+k. (35) The first eample is intended to provide a basis for comparing our Gaussian approimation to the Monte-Carlo sampling from the true distribution (numerical approimation of the integral ()) when the uncertainty is propagated as we predict ahead in time. The second one, inspired from real-life applications, enables us to analyse the difference between the iterative k-step ahead prediction when propagating the uncertainty and when using only the output estimates. The predictive performance of the different methods is assessed computing the average absolute error (AE), the average squared error (SE) and average minus log predictive density 4 (mlp D). 4 To evaluate these losses in the case of Monte-Carlo sampling, we use the sample mean and sample variance. 3

5. A D non-linear dynamic system We present an eample of a non-linear, second order, dynamic system Ω, composed of a blend of two affine models, Ω : ẋ = f () +f (), where f i () = φ()(a [ i + d i ] ), φ() = ep( c /σi ) and c i = A 5 i d i, with A = A =, 3 [ ] d =, d = d, σ =, σ =. This system has two stable equilibrium points and a stable limit cycle. Because the data was acquired by starting the simulation at a random initial position, and simulating for a fied period, we find a number of interesting features which are typical of many real world eamples when modelling from observed data. The identification data consist of 6 simulations ( points per simulation) with different starting points and the two test trajectories result from two different simulations. Assuming a model of the type t+ = f( t ), where is two-dimensional, we create the input and target matrices corresponding to each trajectory. We then model each dimension with a separate Gaussian process: i t+ = f i ( t ), for i =,. Figure shows the predictions when predicting from k =to k =steps ahead, when starting the simulation at si different points. Figure shows the true trajectory along with the mean predictions with their σ uncertainties (crosses) when propagating the uncertainty with the Gaussian approimation and 3 samples from the true predictive distribution. 5 Test trajectory : From to steps ahead at different starting points 4 Test trajectory : From to steps ahead at different starting points 4 95 3.5 3 (k=) 3 (k=) (k=).5 3 3 4.5 95 3 4 4.5 (k=) 5.5.5.5.5.5.5.5.5.5.5 Figure : Iterative method in action: simulation from to steps ahead for different starting points of the test trajectories. Mean predictions with σ error bars (circles), along with 3 samples from the true distribution, when propagating the uncertainty, for the two test trajectories. Also shows (left) the training data (dots). These figures clearly show that the Gaussian approimation is valid, with error bars encompassing the samples from the true distribution. This is confirmed quantitatively by the losses (see table ). 4

5 Test trajectory : step ahead predictions 4 Test trajectory : step ahead pedictions 4 3.5 3 samples from the true distribution 3 mean prediction with σ error bars.5 true trajectory.5 3 4.5 5.5.5.5.5.5.5.5.5.5 Figure : -step ahead prediction for the two test trajectories (the first point here corresponds to in figure, etc). Same legend as figure. Table : Losses for the Gaussian approimation (GP) and the sampling from the true distribution (MC) on the two test trajectories. The losses are given for each of the two dimensions. AE SE SE SE mlpd mlpd dim. dim. dim. dim. dim. dim. Traj. GP.37.7.6.6.4 6.47 (Fig., left) MC.37.7.6.6 3.59 3.474 Traj. GP.3.3.8. 4.337. 4 4.559 3.656 (Fig., right) MC.3.3.7. 4.358. 4 3.745 3.763 5

5. Prediction of a ph process simulation We apply the method on a ph neutralisation process benchmark ([]). The training and test data consists of ph values (outputs y of the process) and a control input signal (u). With a model of the form y t = f(y t 8,...,y t,u t 8,...,u t ), we have a training input matri of size 8 6, with the corresponding vector of targets and a different set of 595 test data (all data had their mean removed). After maimization of the likelihood, the ARD tool indicates that the lagged outputs contributing the most are y t,y t and y t 3 whose hyperparameters are one order of magnitude larger than the those corresponding to other outputs. In the same manner, more weight is given to u t 5. Figure shows the simulation from to steps ahead starting at two different points and figure 3 the plots the -step ahead predicted points, at the beginning and at the end of the validation set. On both figures, we plot the true data and the mean predictions with their σ uncertainties obtained when propagating the uncertainty (circles) or not (crosses). For the -step ahead predictions, we have the following losses. The average absolute error and squared error are.355 and.49 respectively, whether one propagates the uncertainty or not. On the other hand, the average minus log predictive density is much better when propagating the uncertainty (.657 against 763.!). 8 From to steps ahead 4 From to steps ahead 6 3.5 4 true data 3 k=.5 k= k=.5 4 6 8.5 k= 4 5 6 7 8 9 3 3 3 33.5.595.596.597.598.599.59.59.59.593.594 4 Figure : From to steps ahead: two windows of predicted means with their σ uncertainties with (circles) and without (crosses) propagation of the uncertainty at different times within the validation set. As we predict ahead and propagate the uncertainty, the uncertainty does not necessarily increase monotically with k, but is also affected by changes in the control signal, see figure. On the other hand, we see that when the uncertainty is not propagated, the model is too confident with very small error bars. In this eample, the important role of the control signal has to be noted, partly eplaining the big changes in uncertainties observed on the -step ahead predictions plot (figure 3). 6

5 step ahead predictions of y up to y step ahead predictions of y 586 up to y 594 8 6 ph value 5 ph value 4 5 3 4 5 6 7 8 9 time 4.586.587.588.589.59.59.59.593.594.595 time 4 Figure 3: -step ahead mean predictions with their σ error bars, when propagating the uncertainty (circles) and when using the previous estimates only (crosses). These predictions are taken at the beginning and at the end of the test set. 6 Conclusions We have presented an approimation which allows us to use knowledge of the variance on inputs to Gaussian process models to achieve more realistic prediction variance. This is useful in its own right in the case of noisy model inputs. Iterating this approach allows us to use it as a method for efficient propagation of uncertainty in multi-step ahead time-series predictions. In eperiments on simulated dynamic systems, comparing our Gaussian approimation to Monte Carlo simulations, we found that the propagation method is comparable to Monte Carlo simulations, and that both approaches achieved more realistic error bars than a naive approach which ignores the uncertainty on current state. This method can help understanding the underlying dynamics of a system, as well as being useful, for instance, in a model predictive control framework where knowledge of the accuracy of the model predictions over the whole prediction horizon is required (see (Murray-Smith and Sbarbaro-Hofer, ) for a model predictive control law based on Gaussian processes taking account of the prediction uncertainty). Work is currently in progress towards an eact solution within the Gaussian approimation, that is, without the Taylor epansions of the mean and variance but using their original epressions and computing the integrals analytically. Acknowledgements Many thanks to Professor Mike Titterington for his useful comments and corrections. The authors gratefully acknowledge the support of the Multi-Agent Control Research Training Network - EC TMR grant HPRN-CT-999-7, and support from EPSRC grant Modern 7

statistical approaches to off-equilibrium modelling for nonlinear system control GR/M76379/. References Henson, M. A. and Seborg, D. E. (994). Adaptive nonlinear control of a ph neutralisation process. In IEEE Trans Control System Technology, volume, pages 69 83. Mackay, D. J. C. (997). Gaussian Processes: A replacement for supervised Neural Networks? Technical report, Cavendish Laboratory, Cambridge University. Lecture notes for a tutorial at NIPS 997. Murray-Smith, R. and Sbarbaro-Hofer, D. (). Nonlinear adaptive control using nonparametric Gaussian Process prior models. In 5th IFAC World Congress on Automatic Control, Barcelona. Neal, R. M. (995). Bayesian Learning for Neural Networks. PhD thesis, Dept. of Computer Science, University of Toronto. O Hagan, A. (978). Curve fitting and optimal design for prediction. Journal of the Royal Statistical Society B, 4: 4. Rasmussen, C. E. (996). Evaluation of Gaussian Processes and other methods for nonlinear regresion. PhD thesis, Dept. of Computer Science, University of Toronto. Williams, C. K. I. (). Gaussian Processes. To appear in The handbook of Brain Theory and Neural Networks, Second edition, MIT Press. Williams, C. K. I. and Rasmussen, C. E. (996). Gaussian Processes for Regression. In Advances in Neural Information Processing Systems 8, pages 54 5. MIT Press. 8