Geometric methods in stochastic realization and system identification