Spatiotemporal graphical modeling for cyber-physical systems