Astronomical theory of paleoclimates