-
Notifications
You must be signed in to change notification settings - Fork 36
Add Fractional Brownian motion kernel #48
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
Conversation
Yeah -- doesn't look doable with The best way to go about implementing this will be to implement |
Co-Authored-By: David Widmann <[email protected]>
Co-Authored-By: David Widmann <[email protected]>
Co-Authored-By: David Widmann <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor things. Not properly reviewed yet.
Co-Authored-By: willtebbutt <[email protected]>
Co-Authored-By: willtebbutt <[email protected]>
Co-Authored-By: willtebbutt <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I've left a few style-related comments that could do with addressing before merging though.
Co-Authored-By: willtebbutt <[email protected]>
@willtebbutt Can we merge this now? |
I guess it would be good to implement the inplace variants |
@theogf @devmotion kerneldiagmatrix(κ::Kernel, X::Matrix; obsdim::Int=2)
kerneldiagmatrix!(K::AbstractVector,κ::Kernel, X::Matrix; obsdim::Int=2) however we do not have implementations for kerneldiagmatrix(κ::Kernel, X::Matrix,Y::Matrix; obsdim::Int=2)
kerneldiagmatrix!(K::AbstractVector,κ::Kernel, X::Matrix,Y::Matrix; obsdim::Int=2) Any particular reason begin this? |
This is definitely something that I want, because it's crucial for Stheno.jl (see the docs for the rationale). I don't think this PR is the right place for it though -- I would stick with implementing the current interface, and we can re-visit later. edit:
The reason for these is computational efficiency. If you want to compute posterior marginal statistics or construct certain pseudo-point approximations, you only wind up needing the diagonal elements of certain covariance matrices. |
@willtebbutt So are we going to implement |
|
Yes, but only the single-input ones. |
@theogf @willtebbutt I was confused because it always seems to return an array of ones. As it probably should. But I guess this is not the right place. I will discuss this over slack. julia> kerneldiagmatrix(CosineKernel(), rand(3,3))
3-element Array{Float64,1}:
1.0
1.0
1.0
julia> kerneldiagmatrix(SqExponentialKernel(), rand(3,3))
3-element Array{Float64,1}:
1.0
1.0
1.0
julia> kerneldiagmatrix(ExponentialKernel(), rand(3,3))
3-element Array{Float64,1}:
1.0
1.0
1.0
|
Well it's because all these kernels are based on Euclidean distance and you will always get a distance of 0, hence all the ones! If you try with the LinearKernel, it won't be the case |
@theogf Thanks a lot for that! Now it makes sense :) |
@willtebbutt Please take a look. Implementing just |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Actually, sorry, I've just thought: do we actually need to implement |
@willtebbutt Yeah but that uses |
Issue #44
I am trying to implement Fractional Brownian motion covariance given by
with Hurst index
h
from (0,1).I don't think the current structure of
kappa
andmetric
can be used directly implement this. I am considering implementing a modifiedkappa
function to serve such cases. Any thoughts on this?