STOR-i / GaussianProcesses.jl

A Julia package for Gaussian Processes
https://stor-i.github.io/GaussianProcesses.jl/latest/
Other
308 stars 53 forks source link

I think your constructor for SE is broken #109

Closed PaulBellette closed 5 years ago

PaulBellette commented 5 years ago

Hi guys,

I am just having a play with some old code I wrote for 0.6 julia using an old version of this wonderful package. I was using julia 1.1.0 (and a newer version of this package) and I tried to do this

my_kernel = SE([0.,0.],0.)

and got the error

ERROR: MethodError: no method matching SE(::Array{Float64,1}, ::Float64)

having a look at the code you have

https://github.com/STOR-i/GaussianProcesses.jl/blob/feee76fe34595d4a58965d26be5486d53abab296/src/kernels/se.jl#L15

which looks like you might want something like

SE(ll::Vector{T}, lσ::T) where {T<:Real} = SEArd(ll, lσ)

because a vec of floats isn't a subtype of a vec of reals. I probably should have just done a pull request, but am about head off and won't be near a computer for a while and thought maybe this error is in a few places. Sorry for not being a better person!

fairbrot commented 5 years ago

Thanks for your appreciation and this bug fix! I've now fixed this on the the master branch.

chris-nemeth commented 5 years ago

Thanks @PaulBellette, much appreciated.