These mutual funds have benefited from a broad rally that has lifted mortgages of all credit qualities. Investors have even embraced subprime mortgages, the toxic assets that helped trigger the financial crisis.

As foreclosure rates have fallen lately, prices of some subprime mortgages have climbed to 50 cents on the dollar, up from 40 cents a year ago. High-grade issues jumped recently after the Federal Reserve announced that it would buy $40 billion of mortgages a month as part of the QE3 policy.

Mortgage securities represent pools of loans. Investors in the securities collect the principal and interest that borrowers pay. Part of the appeal of mortgages is their relatively attractive yields.

At a time when 10-year Treasuries yield only 1.62%, mortgages backed by agencies such as Fannie Mae ( FNMA) yield about 2.1%. Because of their government support, the agency mortgages come with no default risk.

To get fatter yields, investors can buy securities that are not backed by government agencies. High-quality nonagency mortgages, known as prime, yield about 4.5%. Risky subprime mortgages can yield 8.5%.

Nonagency mortgages were slammed during the financial crisis. With foreclosure rates spiking, some subprime mortgages traded for a few cents on the dollar. Many triple-A-rated securities were downgraded to junk.

After markets hit bottom in 2009, mortgages began recovering. Today investors remain wary, and many prime securities trade at 70 cents on the dollar.

The prices remain undervalued, argues Brad Friedlander, portfolio manager of Angel Oak Multi-Strategy. "This is one of the cheapest sectors of the fixed-income markets," he says.

While Angel Oak has the flexibility to buy many kinds of fixed-income securities, the fund currently has 78% of assets in nonagency mortgages.

Friedlander argues that the securities are priced as if the housing markets will remain deeply depressed. But the outlook has been improving as the inventory of foreclosed homes has shrunk. According to Standard & Poor's Case-Shiller index, home prices have increased for the last three months -- a big change from earlier in the year when prices were falling.

TCW Total Return has 34% of its assets in nonagency mortgages. Portfolio manager Bryan Whalen argues that the securities will continue performing well because supplies are declining at a time when demand is growing.

During the boom years of 2004 through 2007, investment banks issued $1 trillion in nonagency securities. Then the market froze as panicked investors refused to make any more commitments.

Since the financial crisis, only a trickle of nonagency securities has appeared.

"The private markets have not been willing to buy mortgages, unless they are guaranteed by the government," says Whalen.

With few new issues, the total amount of nonagency mortgages has declined as borrowers paid off loans. While supplies have dwindled, demand has increased as investors have become less concerned about defaults.

Besides loans made to owners of single-family homes, some funds also invest in commercial mortgages that finance properties such as office buildings and hotels. The commercial mortgages have provided a boost for Virtus Multi-Sector Fixed Income ( NAMFX), which has returned 11.3% this year.

Portfolio manager Andrew Szabo says that the outlook for commercial properties is improving. Vacancy rates for office buildings and hotels are heading down, and few properties are defaulting.

Investors have been flocking to the commercial securities because triple-A-rated mortgages yield 2.8%. While demand for space is slowly growing, only limited supplies are becoming available.

"Occupancy rates have been improving, because there has not been much construction nationwide," says Szabo.

At the time of publication, Luxenberg held no positions in funds mentioned.

This article is commentary by an independent contributor, separate from TheStreet's regular news coverage.