Memory Effects and the Autocorrelation Function of a Dynamical Variable