What is the opposite of the word prediction? I thought of retrospect but that refers to events that already happened.
The OED lists retrodict as:
state a fact about the past based on inference or deduction, rather than evidence.
An example of this word being actually used in science:
This conclusion was, then, serendipitous by suggesting that there had been an early event satisfying the specific etiology that Freud had hypothesized for Lorenz's obsessional neurosis. Since this etiology required precocious masturbation events, Freud retrodicted that the patient had been punished by his father for masturbation (...)
Excerpt from Mind and Medicine, page 276. Emphasis mine.
Retrospective (or retrospection), description, report, account, log. All these speak of recording events in the past.
How about "hindsight":
Hindsight: recognition of the realities, possibilities, or requirements of a situation, event, decision etc., after its occurrence.
There really is no direct antonym for prediction, in the sense of the definition "to express an outcome in advance". The thesaurus entry does list antonyms for other definitions, however.
How about "predicting the past"? You are making a prediction, it's just not about the future. Predicting the past is a nice oxymoron that will make your hearers understand exactly what you've done.
"Inference" (to infer) is probably the word you were looking for.