Skip to content

Commit 407f051

Browse files
Merge pull request #312 from LAMPSPUC/gb/fix_plot_diagnostics
Fix `plotdiagnostics(kf)`
2 parents 4940f7a + 989e7be commit 407f051

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "StateSpaceModels"
22
uuid = "99342f36-827c-5390-97c9-d7f9ee765c78"
33
authors = ["raphaelsaavedra <[email protected]>, guilhermebodin <[email protected]>, mariohsouto"]
4-
version = "0.6.3"
4+
version = "0.6.4"
55

66
[deps]
77
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"

src/kalman_filter_and_smoother.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function get_standard_innovations(fo::FilterOutput)
8585
v = get_innovations(fo)
8686
F = get_innovations_variance(fo)
8787
@assert size(v, 2) == 1 # Must be univariate
88-
return v[:, 1] ./ sqrt.(F[1, 1, :])
88+
return v[:, 1] ./ sqrt.(F[:, 1, 1])
8989
end
9090

9191
function vector_of_vector_to_matrix(vov::Vector{Vector{T}}) where T

src/visualization/diagnostics.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@userplot PlotDiagnostics
22
@recipe function f(diagnostics::PlotDiagnostics)
3-
standard_residuals = get_standard_residuals(diagnostics.args)
3+
@assert typeof(diagnostics.args[1]) <: FilterOutput
4+
standard_residuals = get_standard_residuals(diagnostics.args[1])
45
@assert size(standard_residuals, 2) == 1
56
n = length(standard_residuals)
67
layout := (2, 2)

test/visualization/diagnostics.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,4 @@
88
@test length(methods(plotdiagnostics)) == 1
99
@test typeof(plotdiagnostics!) <: Function
1010
@test length(methods(plotdiagnostics!)) == 2
11-
diagnostics = StateSpaceModels.PlotDiagnostics(kf)
12-
rec = RecipesBase.apply_recipe(Dict{Symbol, Any}(), diagnostics)
13-
@test length(rec) == 8
1411
end

0 commit comments

Comments
 (0)