Skip to content

GP model #232

Closed Answered by albertpod
mvsoom asked this question in Q&A
Feb 24, 2024 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hi @mvsoom!

I am not sure you can use broadcasting in RxInfer.jl this way.
What do you mean by u .~ MvNormal()?

Can't we say something like this instead:

using RxInfer, AbstractGPs

gp = GP(with_lengthscale(Matern32Kernel(), 5.))
t = 1.:100.
@model function gp_model(t, gp, σ²::ConstVariable)
    y = datavar(Vector{Float64})
    
    gpt = gp(t) # Condition the GP and convert it to a MvNormal

    u ~ MvNormal= collect(mean(gpt)), Σ = cov(gpt))
    y ~ MvNormal=u, Σ=σ²*diageye(length(t)))
end

result = infer(
  model = gp_model(t, gp, 1.0),
  data  = (y = randn(length(t)), ),
  free_energy   = true,
  showprogress  = true
)

So now, we will use a single variable, u, as a prior for our …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mvsoom
Comment options

Answer selected by mvsoom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants