Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions test/approximations/unscented_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,15 @@
@test all(approximate(Unscented(), (x) -> x .- [1, 1], (1.0,), (1.0,)) .≈ ([0.0, 0.0], [1.0 1.0; 1.0 1.0]))
@test all(approximate(Unscented(), (x) -> [x^2, x], (1.0,), (1.0,)) .≈ ([2.0, 1.0], [6.0 2.0; 2.0 1.0]))
end

end

@testitem "Unscented approximation method" begin
using ReactiveMP

import ReactiveMP: Unscented, unscented_statistics, approximate


@testset "Unscented approximate input edge cases" begin
@test_throws DomainError approximate(Unscented(), (x) -> x + 1.0 , (1.0,), (Inf,))
@test_throws DomainError approximate(Unscented(), (x) -> x + 1.0, (1.0,), (Inf,))
@test all(approximate(Unscented(), (x) -> x + 1.0, (1.0,), (0.0,) .≈ (2.0, 0.0)))
@test all(approximate(Unscented(), (x) -> [x^2, x], (2.0,), (0.0,)) .≈ ([4.0, 2.0], [0.0 0.0; 0.0 0.0]))
@test all(approximate(Unscented(), (x) -> x + 1.0, (NaN,), (1.0,) .≈ (NaN, NaN)))
Expand Down