Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name = "ControlSystemIdentification"
uuid = "3abffc1c-5106-53b7-b354-a47bfc086282"
authors = ["baggepinnen <baggepinnen@gmail.com>"]
version = "2.11.8"
version = "2.11.9"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
ControlSystemsBase = "aaaaaaaa-a6ca-5380-bf3e-84a91bcd477e"
Expand Down Expand Up @@ -35,6 +36,7 @@ LeastSquaresOptim = "0fc2ff8b-aaa3-5acd-a817-1944a5e08891"
ControlSystemIdentificationLSOptExt = "LeastSquaresOptim"

[compat]
ADTypes = "1"
ChainRules = "1.58"
ComponentArrays = "0.14, 0.15"
ControlSystemsBase = "1.8"
Expand All @@ -50,7 +52,7 @@ LinearAlgebra = "1.6"
LowLevelParticleFilters = "2.0, 3.0"
MatrixEquations = "1.1, 2.0"
MonteCarloMeasurements = "1.0"
Optim = "<0.20, 0.20, 0.21, 0.22, 1.0"
Optim = "2"
Parameters = "<0.13"
QuadGK = "2.4"
Random = "1.6"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SeeToDee = "1c904df7-48cd-41e7-921b-d889ed9a470c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
DataInterpolations = "7"
DataInterpolations = "8"
Documenter = "1"
LowLevelParticleFilters = "3.3.5"
PrettyTables = "2"
Expand Down
3 changes: 2 additions & 1 deletion src/ControlSystemIdentification.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module ControlSystemIdentification

using ComponentArrays,
using ADTypes,
ComponentArrays,
ControlSystemsBase,
DelimitedFiles,
FFTW,
Expand Down
4 changes: 2 additions & 2 deletions src/arx.jl
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,9 @@ function tfest(
end + 0.001abs2(a[1]-1) # Promote a monic polynomial for regularization (could enforce it without loss of generality.
end

res = Optim.optimize(loss, ComponentVector(p0), opt, opts, autodiff = :forward)
res = Optim.optimize(loss, ComponentVector(p0), opt, opts; autodiff = AutoForwardDiff())
if refine
res = Optim.optimize(loss2, res.minimizer, opt, opts, autodiff = :forward)
res = Optim.optimize(loss2, res.minimizer, opt, opts; autodiff = AutoForwardDiff())
end
a0 = res.minimizer.a[1]
tf(res.minimizer.b ./ a0, res.minimizer.a ./ a0)
Expand Down
10 changes: 5 additions & 5 deletions src/pem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ using Optim, Optim.LineSearches
optimizer = BFGS(
linesearch = LineSearches.BackTracking(),
),
autodiff = :forward,
autodiff = AutoForwardDiff(),
store_trace = true,
show_trace = true,
show_every = 50,
Expand Down Expand Up @@ -90,7 +90,7 @@ If a manually provided initial guess `sys0`, this must also be scaled appropriat
- `focus`: `prediction` or `:simulation`. If `:simulation`, the `K` matrix will be zero.
- `h`: Prediction horizon for the prediction error filter. Large values of `h` makes the problem computationally expensive. As `h` approaches infinity, the problem approaches the `focus = :simulation` case.
- `optimizer`: One of Optim's optimizers
- `autodiff`: Whether or not to use forward-mode AD to compute gradients. `:forward` (default) for forward-mode AD, or `:finite` for finite differences.
- `autodiff`: Whether or not to use forward-mode AD to compute gradients. `AutoForwardDiff()` (default) for forward-mode AD, or `AutoFiniteDiff()` for finite differences.
- `metric`: The metric used to measure residuals. Try, e.g., `abs` for better resistance to outliers.
The rest of the arguments are related to `Optim.Options`.
- `regularizer`: A function of the parameter vector and the corresponding `PredictionStateSpace/StateSpace` system that can be used to regularize the estimate.
Expand Down Expand Up @@ -175,7 +175,7 @@ function newpem(
# alphaguess = LineSearches.InitialStatic(alpha = 0.95),
linesearch = LineSearches.BackTracking(),
),
autodiff = :forward,
autodiff = AutoForwardDiff(),
store_trace = true,
show_trace = true,
show_every = 50,
Expand Down Expand Up @@ -764,8 +764,8 @@ function structured_pem(
optimizer,
Optim.Options(;
store_trace, show_trace, show_every, iterations, allow_f_increases,
time_limit, x_abstol, f_abstol, g_tol, f_calls_limit, g_calls_limit),
autodiff = :forward,
time_limit, x_abstol, f_abstol, g_tol, f_calls_limit, g_calls_limit);
autodiff = AutoForwardDiff(),
)
sys_opt, K_opt, x0_opt = inner_constructor(res.minimizer, constructor, d.Ts)
sysp_opt = PredictionStateSpace(
Expand Down
Loading