  In this paper, we propose a very efficient numerical method based on the
L-BFGS-B algorithm for identifying linear and nonlinear discrete-time
state-space models, possibly under $\ell_1$- and group-Lasso regularization for
reducing model complexity. For the identification of linear models, we show
that, compared to classical linear subspace methods, the approach often
provides better results, is much more general in terms of the loss and
regularization terms used (such as penalties for enforcing system stability),
and is also more stable from a numerical point of view. The proposed method not
only enriches the existing set of linear system identification tools but can
also be applied to identifying a very broad class of parametric nonlinear
state-space models, including recurrent neural networks. We illustrate the
approach on synthetic and experimental datasets and apply it to solve a
challenging industrial robot benchmark for nonlinear multi-input/multi-output
system identification. A Python implementation of the proposed identification
method is available in the package jax-sysid, available at
https://github.com/bemporad/jax-sysid.
