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
adf65142
Commit
adf65142
authored
Sep 05, 2015
by
Fredrik Bagge Carlson
Browse files
ar and arx seem to work well now, tests have been updated.
parent
9bdb256e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/SystemIdentification.jl
View file @
adf65142
...
...
@@ -37,6 +37,13 @@ type AR <: LinearModel
a
::
Polynom
na
::
Int
end
function
Base.show
(
m
::
AR
)
print
(
"A(z) = 1"
)
for
i
=
1
:
length
(
m
.
a
)
print
(
m
.
a
[
i
],
" + z^-
$
i"
)
end
print
(
"
\n
"
)
end
"""
`a::Vector{Float64}`: The polynomial coeffs A(z) (not including the first 1)
\n
...
...
src/armax.jl
View file @
adf65142
...
...
@@ -27,7 +27,6 @@ function arx(y::Vector{Float64}, u::VecOrMat{Float64}, na, nb; λ = 0, doplot=fa
prediction
=
A
*
w
error
=
y_train
-
prediction
si
=
na
+
1
b
=
Polynom
[
w
[
si
:
si
+
nb
[
1
]
-
1
]]
si
+=
nb
[
1
]
...
...
test/tests.jl
View file @
adf65142
...
...
@@ -83,6 +83,7 @@ function run_tests()
model
,
result
=
arx
(
collect
(
1
:
5.0
),
collect
(
1
:
5.0
),
1
,
1
,
λ
=
1
)
@tassert
result
.
method
==
:
LS_reg
@tassert
result
.
λ
==
1
model
,
result
=
arx
(
collect
(
1
:
5.0
),[
collect
(
2
:
6.0
)
ones
(
5
)],
2
,[
2
,
1
])
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