Optimal Residual-Based Tests for Fractional Cointegration and Exchange Rate Dynamics