Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Fredrik Bagge Carlson
SystemIdentification
Commits
55740f37
Commit
55740f37
authored
Sep 09, 2015
by
Fredrik Bagge Carlson
Browse files
Updates to kalman
parent
32b22926
Changes
1
Show whitespace changes
Inline
Side-by-side
src/kalman.jl
View file @
55740f37
...
@@ -44,11 +44,10 @@ function forward_kalman(y,A,R1,R2, P0)
...
@@ -44,11 +44,10 @@ function forward_kalman(y,A,R1,R2, P0)
end
end
"""A kalman parameter smoother"""
"""A kalman parameter smoother"""
function
kalman_smoother
(
y
,
R1
,
R2
)
function
kalman_smoother
(
y
,
A
,
R1
,
R2
,
P0
)
na
=
size
(
R1
,
1
)
na
=
size
(
R1
,
1
)
N
=
length
(
y
)
N
=
length
(
y
)
P0
=
100
*
R1
;
xkk
,
xk
,
Pkk
,
Pk
=
forward_kalman
(
y
,
A
,
R1
,
R2
,
P0
)
xkk
,
xk
,
Pkk
,
Pk
=
forward_kalman
(
y
,
A
,
R1
,
R2
,
P0
)
xkn
=
zeros
(
xkk
)
xkn
=
zeros
(
xkk
)
Pkn
=
zeros
(
P
)
Pkn
=
zeros
(
P
)
...
@@ -61,8 +60,6 @@ function kalman_smoother(y, R1, R2)
...
@@ -61,8 +60,6 @@ function kalman_smoother(y, R1, R2)
Pkn
[
:
,
:
,
i
]
=
Pkk
[
:
,
:
,
i
]
+
C
*
(
Pkn
[
:
,
:
,
i
+
1
]
-
Pk
[
:
,
:
,
i
+
1
])
*
C
'
Pkn
[
:
,
:
,
i
]
=
Pkk
[
:
,
:
,
i
]
+
C
*
(
Pkn
[
:
,
:
,
i
+
1
]
-
Pk
[
:
,
:
,
i
+
1
])
*
C
'
end
end
newplot
(
xkk
'
);
title
(
"x_{k|k}"
)
return
xkn
,
Pkn
newplot
(
xkn
'
);
title
(
"x_{k|n}"
)
return
xkn
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment