Moody's Investor Service has changed its mind about the U.S. retail sector and has turned bullish thanks to a robust U.S. economy that will propel the sector through 2019.

Specifically, Moody's said it sees the retail sector benefiting the most from investments in e-commerce and operating efficiencies.

The firm raised its 2018 forecast for retail operating income growth to between 4% and 5% from between 3.5% and 4.5%. Sales are now expected to grow between 4.5% and 5.5% from between 3.5% and 4.5%. 

"For the first time since July 2015, we are raising our outlook to positive from stable for the U.S. retail industry. This marks a big change from just a year ago, when swaths of the retail industry were still slogging through a rising tide of distressed names and defaults," Moody's retail team wrote. 

Moody's also sees that growth acceleration continuing into 2019, with retail industry operating income growing between 5% and 6% and sales growth matching 2018 levels. 

For the holiday season, Moody's expects "very healthy" retail sales growth between 5% and 6% with "a healthy U.S. economy, consumer confidence and increasing wage growth" aiding consumer spending. 

Moody's noted the dire straits the retail has sector has been in since late 2017 when "the retail industry still had the dubious distinction of holding the third-highest default rate among 18 U.S. corporate industries."

But the sector now benefits from a robust economy and a store rationalization process "that began in earnest about three years ago has helped many retailers streamline their operations and better provide their consumers with a seamless shopping experience."

Big retailers were gaining Thursday, bolstering Moody's thesis. 

Macy's Inc. (M) shares were up 2.8%, while Kohl's Corp. (KSS) gained 2.41%, Nordstrom Inc. (JWN) jumped 3.66%, Target Corp. (TGT) rose 2.72% and J.C. Penney Co. (JCP) rose 1.75%. 

Sears Holdings Corp. (SHLD) was one of the retail laggards Thursday, however, following a report from CNBC that said CEO Eddie Lampert was attempting to renegotiate the terms of a loan agreement that would float the retailer through bankruptcy to better protect him. Lampert reportedly was asking to have the "first lien" on certain assets, which would put him in line to be paid back first. 

Sears shares are down more than 17%. 

More from Investing

Even Wall Street Experts Had a Tough Year in 2018

Even Wall Street Experts Had a Tough Year in 2018

Why Jim Cramer Is Holding Off on Buying Nvidia Stock

Why Jim Cramer Is Holding Off on Buying Nvidia Stock

16 Stocks Jim Cramer Says Could Win from a U.S.-Chinese Trade Deal

16 Stocks Jim Cramer Says Could Win from a U.S.-Chinese Trade Deal

Harman CEO Talks Self-Driving Cars, Voice Assistants and More with TheStreet

Harman CEO Talks Self-Driving Cars, Voice Assistants and More with TheStreet

Why Diversity Should be a Corporate Priority

Why Diversity Should be a Corporate Priority