At first, download and install the latest version of Origin at www.origin.com/download (and make sure you have your Origin account ready as well)
Close the origin client and go directly to you origin folder C:\Program Files\Origin Games. Run the origin.exe in this folder with a rightclick -> run as administrator. Please make sure that your firewall/antivirus software is disabled or that Origin as well as Titanfall is added to the exception list of your protection software.
Is there any VPN/Proxy or ad-blocking software installed on your system? I recommend to close all not needed software via your Windows taskmanager in order to check if some application is causing the lag. You should power-cycle your router as well.
Cheers
Basti