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
624c5ecc
Commit
624c5ecc
authored
Sep 04, 2015
by
Fredrik Bagge Carlson
Browse files
Add more methods
parent
55ed98e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/armax.jl
View file @
624c5ecc
"""`ar(y, na; λ = 0, doplot=false)`"""
"""`ar(y, na; λ = 0, doplot=false
, bias=false
)`"""
function
ar
(
y
,
na
;
λ
=
0
,
doplot
=
false
,
bias
=
false
)
y_train
,
A
=
getARRegressor
(
y
,
na
;
bias
=
bias
)
n_points
=
size
(
A
,
1
)
...
...
@@ -18,7 +18,9 @@ function ar(y, na; λ = 0, doplot=false, bias=false)
end
return
w
,
error
end
ar
(
iddata
,
na
;
λ
=
0
,
doplot
=
false
,
bias
=
false
)
=
ar
(
iddata
.
y
,
na
;
λ
=
0
,
doplot
=
doplot
,
bias
=
bias
)
"""arx(y, u, na, nb; λ = 0, doplot=false, bias=false)"""
function
arx
(
y
,
u
,
na
,
nb
;
λ
=
0
,
doplot
=
false
,
bias
=
false
)
y_train
,
A
=
getARXRegressor
(
y
,
u
,
na
,
nb
;
bias
=
bias
)
n_points
=
size
(
A
,
1
)
...
...
@@ -38,6 +40,8 @@ function arx(y, u, na, nb; λ = 0, doplot=false, bias=false)
end
return
w
,
error
end
arx
(
iddata
,
na
,
nb
;
λ
=
0
,
doplot
=
false
,
bias
=
false
)
=
arx
(
iddata
.
y
,
iddata
.
u
,
na
,
nb
;
λ
=
0
,
doplot
=
doplot
,
bias
=
bias
)
function
getARRegressor
(
y
,
na
;
bias
=
false
)
...
...
@@ -50,6 +54,7 @@ function getARRegressor(y,na;bias=false)
end
return
y
,
A
end
getARRegressor
(
iddata
,
na
,
bias
=
false
)
=
getARXRegressor
(
iddatay
,
na
,
bias
=
bias
)
function
getARXRegressor
(
y
,
u
,
na
,
nb
;
bias
=
false
)
assert
(
length
(
nb
)
==
size
(
u
,
2
))
...
...
@@ -70,6 +75,7 @@ function getARXRegressor(y,u, na, nb; bias=false)
end
return
y
,
A
end
getARXRegressor
(
iddata
,
na
,
nb
;
bias
=
false
)
=
getARXRegressor
(
iddatay
,
iddata
.
u
,
na
,
nb
,
bias
=
bias
)
"""Plots the RMSE and AIC for model orders up to `n`. Useful for model selection"""
...
...
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