Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
willtebbutt committed Sep 26, 2024
1 parent a3e3eb5 commit 69727d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/gp/data_representations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ and spatio-temporal problems typically have multiple elements of `y` associated
single element of `x`.
"""
function observations_to_time_form(
x::AbstractVector{<:Real},
y::AbstractVector{<:Union{Missing, Real}},
x::AbstractVector{<:Real}, y::AbstractVector{<:Union{Missing, Real}}
)
return y
end
Expand Down
14 changes: 7 additions & 7 deletions src/gp/lti_sde.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ function lgssm_components(
m = collect(mean_vector(m, t)) # `collect` is needed as there are still issues with Zygote and FillArrays.
As, as, Qs, (Hs, hs), x0 = lgssm_components(k, t, storage_type)
hs = add_proj_mean(hs, m)

return As, as, Qs, (Hs, hs), x0
end

Expand All @@ -136,7 +135,9 @@ time_exp(A, t) = exp(A * t)

# Generic constructors for base kernels.

function broadcast_components((F, q, H)::Tuple, x0::Gaussian, t::AbstractVector{<:Real}, ::StorageType{T}) where {T}
function broadcast_components(
(F, q, H)::Tuple, x0::Gaussian, t::AbstractVector{<:Real}, ::StorageType{T}
) where {T}
P = Symmetric(x0.P)
t = vcat([first(t) - 1], t)
As = map(Δt -> time_exp(F, T(Δt)), diff(t))
Expand All @@ -147,7 +148,9 @@ function broadcast_components((F, q, H)::Tuple, x0::Gaussian, t::AbstractVector{
As, as, Qs, Hs, hs
end

function broadcast_components((F, q, H)::Tuple, x0::Gaussian, t::Union{StepRangeLen, RegularSpacing}, ::StorageType{T}) where {T}
function broadcast_components(
(F, q, H)::Tuple, x0::Gaussian, t::Union{StepRangeLen, RegularSpacing}, ::StorageType{T}
) where {T}
P = Symmetric(x0.P)
A = time_exp(F, T(step(t)))
As = Fill(A, length(t))
Expand Down Expand Up @@ -316,10 +319,7 @@ function TemporalGPs.to_sde(::ConstantKernel, ::SArrayStorage{T}) where {T<:Real
end

function TemporalGPs.stationary_distribution(k::ConstantKernel, ::SArrayStorage{T}) where {T<:Real}
return TemporalGPs.Gaussian(
SVector{1, T}(0),
SMatrix{1, 1, T}( T(only(k.c)) ),
)
return TemporalGPs.Gaussian(SVector{1, T}(0), SMatrix{1, 1, T}(T(only(k.c))))
end

# Scaled
Expand Down

0 comments on commit 69727d4

Please sign in to comment.