From 55740f3739faadb116c2c6a7d435e3fad84721a7 Mon Sep 17 00:00:00 2001 From: Fredrik Bagge Carlsson <cont-frb@ulund.org> Date: Wed, 9 Sep 2015 16:29:34 +0200 Subject: [PATCH] Updates to kalman --- src/kalman.jl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/kalman.jl b/src/kalman.jl index 8638984..e2bca2f 100644 --- a/src/kalman.jl +++ b/src/kalman.jl @@ -44,11 +44,10 @@ function forward_kalman(y,A,R1,R2, P0) end """A kalman parameter smoother""" -function kalman_smoother(y, R1, R2) +function kalman_smoother(y, A, R1, R2, P0) na = size(R1,1) N = length(y) - P0 = 100*R1; xkk,xk,Pkk,Pk = forward_kalman(y,A,R1,R2, P0) xkn = zeros(xkk) Pkn = zeros(P) @@ -61,8 +60,6 @@ function kalman_smoother(y, R1, R2) Pkn[:,:,i] = Pkk[:,:,i] + C*(Pkn[:,:,i+1] - Pk[:,:,i+1])*C' end - newplot(xkk'); title("x_{k|k}") - newplot(xkn'); title("x_{k|n}") - return xkn + return xkn, Pkn end -- GitLab