  This paper introduces a novel optimization-based approach for parametric
nonlinear system identification. Building upon the prediction error method
framework, traditionally used for linear system identification, we extend its
capabilities to nonlinear systems. The predictions are computed using a moving
horizon state estimator with a constant arrival cost. Eventually, both the
system parameters and the arrival cost are estimated by minimizing the sum of
the squared prediction errors. Since the predictions are induced by the state
estimator, the method can be viewed as the tuning of a state estimator, based
on its predictive capacities. The present extension of the prediction error
method not only enhances performance for nonlinear systems but also enables
learning from multiple trajectories with unknown initial states, broadening its
applicability in practical scenarios. Additionally, the novel formulation
leaves room for the design of efficient and parallelizable optimization
algorithms, since each output prediction only depends on a fixed window of past
actions and measurements. In the special case of linear time-invariant systems,
we show an important property of the proposed method which suggests asymptotic
consistency under reasonable assumptions. Numerical examples illustrate the
effectiveness and practicality of the approach, and one of the examples also
highlights the necessity for the arrival cost.
