Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive (online) GP example #128

Open
JoachimSchaeffer opened this issue Feb 21, 2024 · 5 comments
Open

Recursive (online) GP example #128

JoachimSchaeffer opened this issue Feb 21, 2024 · 5 comments

Comments

@JoachimSchaeffer
Copy link

Hi everyone,

Thanks for creating and sharing this great package!

I'm just getting started looking into the package and was wondering how to update a TemporalGP for new data that becomes available.

To be more precise, I have time series data, with x in R3 and y in R1 for every time step, unevenly sampled in time and containing gaps. I'd like to make a GP forecast for a few days and then update the GP every couple of days once this new data becomes available.

Could you share an example of such a case?
(I am happy to support it if it's something that currently is not there but could be done with reasonable effort).
How would you go about solving this using TemporalGPs?

@willtebbutt
Copy link
Member

Hi @JoachimSchaeffer -- thanks for opening this issue.

We don't at present have a good way to incrementally update the posterior as new data arrives. I know this is a bit odd, but it's because the package is designed around the AbstractGPs API, and is expected to work in batch mode.

I'd be open to suggestions for how to tackle this problem. I agree that it ought to be straightforward, but we'd need a good API.

@JoachimSchaeffer
Copy link
Author

JoachimSchaeffer commented Feb 21, 2024

@willtebbutt, thanks for your quick response.

Adding the relevant AbstractGP reference:
https://juliagaussianprocesses.github.io/AbstractGPs.jl/dev/concrete_features/#Sequential-Conditioning

AbstractGPs with exact GPs handle this under the hood by updating the covariance matrix, which works by just calling posterior again
p_fx = posterior(f(x[1:3], 0.1), y[1:3])
p_p_fx = posterior(p_fx(x[4:10], 0.1), y[4:10])

For approximate/variational posterior, the API is slightly different:
p_fx1 = posterior(VFE(f(Z)), f(x[1:7], 0.1), y[1:7])
u_p_fx1 = update_posterior(p_fx1, f(x[8:10], 0.1), y[8:10])

I don't have a strong preference regarding API, but I feel like update_posterior is more verbose and would help comprehension.

@willtebbutt
Copy link
Member

Ohhh that's a fair point -- yeah, we should just implement that API (I had completely forgotten we had implemented that haha).

Is this something that you're interested in tackling yourself?

@JoachimSchaeffer
Copy link
Author

Unfortunately, I'm just starting with using and learning Julia and don't feel ready yet to tackle it myself.
But I could have a look at the PR, test it and hopefully contribute another example as soon as my results are published (:

@willtebbutt
Copy link
Member

Cool. I'm also up to my eyes in work at the minute, so don't really have time to look at it currently. Maybe someone else will come along and have a go at it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants