Comments (2)
Thank you for your kind words :)
We do not have any built in support for nonlinear ARX models. There are a few alternatives available
- If the nonlinearity is on the input only, you may expand the input in a nonlinear basis. Tools for this are available here https://github.com/baggepinnen/BasisFunctionExpansions.jl#lpv-arx-modeling
- If the nonlinarity is more complicated, the best strategy I've found is to simply use the lower level features together with the fact that almost all julia code is differentiable, to simply perform gradient descent on any model with any cost function. I believe the nlarx support in matlab came in a time (and language) where computing gradients through a model had to be supported explicitly by the software. In julia, there are things like DiffEqFlux.jl that is much more powerful and general than the nlarx support in matlab.
Below is a simple example making use of BasisFunctionExpansions that expands both inputs and outputs in two separate bases to perform estimation of a Hammerstein-Wiener model, using Optim and automatic differentiation to optimize the parameters.
using Optim, BasisFunctionExpansions, ControlSystemIdentification
dn = iddata(y, ......................)
na,nb,nl = 10,6,6
bfe = UniformRBFE(dn.y, nl)
bfeu = UniformRBFE(dn.u, nl)
y, A = ControlSystemIdentification.getARXregressor(dn.y, dn.u, na, nb)
forward = function (p)
bfa = BasisFunctionApproximation(bfe, p[2na+nb.+(1:nl)])
bfau = BasisFunctionApproximation(bfeu, p[2na+nb+nl.+(1:nl)])
ynl = bfa(dn.y)
unl = bfa(dn.u)
_, A_nl = ControlSystemIdentification.getARXregressor(ynl, unl, na, nb)
yhl = [A A_nl] * p[1:2na+2nb]
end
costfun = p->√(mean((y .- forward(p)).^2))
p0 = [A\y; 0.1randn(na + nb + 2nl)]
costfun(p0)
res = Optim.optimize(
costfun,
p0,
BFGS(),
Optim.Options(
show_trace = true,
show_every = 1,
iterations = 5000,
time_limit = 50,
g_tol = 1e-8,
),
autodiff=:forward,
)
yarx = A*(A\y)
yhl = forward(res.minimizer)
plot(
plot([y yarx yhl], lab=["y" "y_{arx}" "y_{lpv]"], linewidth=[2 1 1]),
plot(y-yhl, ylims=(-0.2, 0.2))
)
from controlsystemidentification.jl.
I just merged some new functionality that allows for estimation of Hammerstein-Wiener models, it's not identical to NARX, but should hopefully cover at least some situations
https://baggepinnen.github.io/ControlSystemIdentification.jl/dev/nonlinear/
from controlsystemidentification.jl.
Related Issues (20)
- Fix example text
- Minus on K
- Possible wrong state space model formula HOT 1
- Missing docstring HOT 1
- Question: Can this library estimate the parameters of a Cauer or Foster model? HOT 2
- Generate a model from a known impulse/step response HOT 1
- Efficient estimation of Hammerstein Wiener systems
- Unable to compile module HOT 2
- Identification from frequency response HOT 1
- System idenfitifaction of data in the frequency domain HOT 14
- Unable to add package HOT 5
- TagBot trigger issue HOT 41
- Wrong TransferFunction from arx() if nb > na HOT 4
- iddata not defined HOT 10
- Regarding ar() HOT 4
- Invalidations
- arx() estimator issues HOT 11
- Feature request: generator of some standard input signals such as PRBS HOT 2
- Better default stability margin in pem and subspaceid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from controlsystemidentification.jl.