On the equivalence of internal and external habit formation models with finite memory