A turbulent week for markets ended with a late burst of buying, breaking a three-week losing streak and giving major indexes their biggest gains of the year. The S&P 500 added 2.4% Friday, nearly all of it coming in the last hour of trading. That followed several days of sudden moves up and down throughout the week. Markets have been jittery as investors try to anticipate how aggressively the Federal Reserve will move to withdraw its economic stimulus and raise interest rates to fight inflation. Technology stocks led the rally. Apple rose after reporting strong holiday iPhone sales. Treasury yields fell.