Investigating the physical basis of river memory and application to flood frequency prediction