Skip to content

Commit 8644d9a

Browse files
committed
Avoid negative ? values for FBM
1 parent 0598c86 commit 8644d9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/kernels/fbm.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ positively correlated and for `h<1/2` the increments are negatively correlated.
1212
struct FBMKernel{T<:Real} <: BaseKernel
1313
h::Vector{T}
1414
function FBMKernel(; h::T=0.5) where {T<:Real}
15-
@assert h<=1.0 && h>=0.0 "FBMKernel: Given Hurst index h is invalid."
15+
@assert 0.0 <= h <= 1.0 "FBMKernel: Given Hurst index h is invalid."
1616
return new{T}([h])
1717
end
1818
end
1919

2020
Base.show(io::IO, κ::FBMKernel) = print(io, "Fractional Brownian Motion Kernel (h = $(first(k.h)))")
2121

22-
_fbm(modX, modY, modXY, h) = (modX^h + modY^h - modXY^h)/2
22+
_fbm(modX, modY, modXY, h) = (modX^h + modY^h - abs(modXY)^h)/2
2323

2424
function kernelmatrix::FBMKernel, X::AbstractMatrix; obsdim::Int = defaultobs)
2525
@assert obsdim [1,2] "obsdim should be 1 or 2 (see docs of kernelmatrix))"

0 commit comments

Comments
 (0)