# Time series forecasting using Gaussian Process regression

I used Gaussian Process Regression to predict a time series, what I have is sensor's readings that come every hour ( I have data for about 3 years) I chose the periodic kernel function mentioned here [1] which looks like this

$$K(x,x′)=\sigma^2 \exp(−2\sin^2(π|x−x′|/p)/\mathcal{l}^2)$$ The period p simply determines the distance between repetitions of the function.

In my data I can observe 2 kind of periods (every 8 hours, every 24 hours) so P in this case can be 8, 24 1.how can I estimate the other hyper parameters $\sigma$, $\mathcal{l}$? 2.how can I plug the two periods in this kernel function?

[1]The Kernel Cookbook:Advice on Covariance functions http://www.cs.toronto.edu/~duvenaud/cookbook/index.html

## 1 Answer

answering them in reverse order..

2) let K be the sum (or multiple but I think in your case sum) of the two kernel functions. That is one with each period.

1) you want to minimise the negative log-likelihood as explained in sections 5.4.1 of GPML (link here).

• Thank you for your answer I could not understand how exactly I can implement the log-likelihood thing with matlab :( Do u have any online tutorial to help me with it ! – m.alsioufi Feb 26 '17 at 2:27
• Check out the GPML code that comes with the book (both free :) ). Warning though sometimes it'll through an error if you have a really ill-conditioned covariance matrix! (sometimes confusing to people learning at first) – j__ Mar 10 '17 at 10:14