In the Mishneh Torah the Rambam states
Some of the Sages say that Elijah will come before the coming of the Messiah. But regarding all these matters and similar, no one knows how it will be until it will be. For these matters were unclear to the Prophets. Even the Sages themselves did not have a Tradition regarding these matters and only could attempt to understand the verses. Thus, there were disagreements in these matters. Nevertheless, neither the order that these events will occur nor their details are fundamental to the religion. Thus, a person must never busy himself with the Aggadohs and not dwell on the Midrashim regarding these matters or similar issues. He must not make them dogma. For these do not result in either love (for G-d) nor fear (of sin). Similarly, one should not calculate the Ends. Our Sages have said that the spirit of those who calculate the Ends will expire. Rather, one is to (simply) wait and believe in the principle of this matter, as we have explained. (Emphasis Mine)
which appears to discourage people to calculate the time of Moshiach's arrival. However in the Epistle To Yemen ,the Rambam gives a prediction himself. In addition, there are others who also give predictions as well. How is all of this justified?