Image: Chefs' Warehouse.

Economic data played a key role in driving the stock market's movements Friday, although a change of heart among investors toward the end of the day wiped out early losses. The Dow lost as much as 135 points during the morning in the wake of new concerns about inflation, which stemmed from the release of January's Consumer Price Index data.

Yet energy prices gave back some of their recent gains, and by the end of the day, the Dow finished down just 21 points, and the S&P 500 was essentially flat. Indeed, some stocks gained ground, and Applied Materials (AMAT 1.46%), Chefs' Warehouse (CHEF -0.66%), and Ambac Financial (AMBC -0.68%) showed strong gains to close the week.

Applied Materials rose 7% after announcing solid results in its fiscal first-quarter financial report Thursday night. The company said that it sees itself winning market share from its rivals as it develops new technology in the memory-chip space, seeking to distinguish itself from its peers in what many have seen as a commoditized business.

Between three-dimensional NAND memory and the capacity to create chips with process technologies allowing for 10-nanometer lithography, Applied Materials is staking its claim to the leadership role in the hard-hit memory industry. Analysts followed suit with upgrades for the chipmaker, and now it's up to Applied Materials to follow through and establish a stronger position in the memory space in 2016 and beyond.

Chefs' Warehouse soared 13% in the wake of its own fourth-quarter financial report. The specialty-food distributor posted a 31% increase in net sales that pushed net income up by 28%, and earnings topped investor expectations. Chefs' Warehouse said that its acquisition of Del Monte early in 2015 has had a dramatic impact on its overall business, and the addition of a new distribution facility in Chicago has been part of a broader strategic initiative to boost its capacity and allow new avenues for future growth.

Guidance for 2016 was consistent with what investors had already expected from the food company. Chefs' Warehouse has plenty of potential, given the favorable trends that are still emphasizing high-quality ingredients and food products.

Finally, Ambac Financial rose 6%. In its fourth-quarter release Thursday night, the insurer of mortgage securities and municipal bonds reported a 60% jump in earned premium during the quarter, yet it also succeeded in reducing its insured exposure to help it keep its internal risk management in line with its financial capacity to cover potential claims. Ambac said that the Puerto Rican debt that it has guaranteed remains a problem area for the company, but it has pushed hard to try to get the Puerto Rican government to work directly with creditors in a way that should help Ambac avoid having to pay out as much in losses as investors currently fear.

Ambac Financial isn't entirely out of the woods just yet, but investors are gaining confidence that the long-struggling insurer could finally be on the road toward a sustainable recovery.