Commit adf65142 authored by Fredrik Bagge Carlson's avatar Fredrik Bagge Carlson
Browse files

ar and arx seem to work well now, tests have been updated.

parent 9bdb256e
......@@ -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
......
......@@ -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]
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment