Skip to content

Commit ebfb4e7

Browse files
committed
fix precision estimate
1 parent 2cd1767 commit ebfb4e7

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎ext/ControlSystemIdentificationLSOptExt.jl‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ function _inner_pem(
177177
function Λ()
178178
resid = zeros(T * ny)
179179
J = ForwardDiff.jacobian(residuals!, resid, res.minimizer)
180-
(T - length(p_guess)) * Symmetric(J' * J)
180+
residuals!(resid, res.minimizer)
181+
(T - length(p_guess)) / dot(resid, resid) * Symmetric(J' * J)
181182
end
182183

183184
ukf = get_ukf(res.minimizer)

‎src/types.jl‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ hasinput(::OutputData) = false
172172
hasinput(::AbstractIdData) = true
173173
hasinput(::AbstractArray) = true
174174
hasinput(::ControlSystemsBase.LTISystem) = true
175+
hasinput(::ControlSystemsBase.LTISystem{T}) where T = true
175176
ControlSystemsBase.noutputs(d::AbstractIdData) = obslength(getfield(d, :y))
176177
ControlSystemsBase.ninputs(d::AbstractIdData) = hasinput(d) ? obslength(getfield(d, :u)) : 0
177178
ControlSystemsBase.nstates(d::AbstractIdData) = 0

0 commit comments

Comments
 (0)