Open Dynamical Systems as Coalgebras for Polynomial Functors, With Application to Predictive Processing