Learning algorithm for modeling complex spatial dynamics.