The theory and empirical estimation of currency substitution