Reconstructing dynamics of complex systems from noisy time series with hidden variables