The Federal National Mortgage Association has launched an internal investigation of its purchase of $102 million of risky loans to real estate tax shelters organized by Equity Programs Investment Corp.

The company, which is commonly known as Fannie Mae, began the investigation in response to a demand by some shareholders that it take action against officers and directors responsible for the purchase of the EPIC mortgages.

Fannie Mae buys and sells mortgage loans. The EPIC partnerships, which have their headquarters in Falls Church, defaulted on the loans in question in the fall and were tied up in bankruptcy proceedings until Monday. The default led to the closing of EPIC's affiliated company, Community Savings & Loan of Bethesda.

David O. Maxwell, chairman and chief executive officer of Fannie Mae, disclosed the action at the company's annual meeting yesterday in Washington under questioning by a lawyer for some shareholders.

Maxwell also told the meeting that Fannie Mae expects 1986 to be "one of its best earnings years" since becoming a private, shareholder-owned company in 1968. Fannie Mae earned $37 million in 1985, a figure it came close to surpassing in the first quarter of 1986.

Discussing the EPIC matter after the meeting, Maxwell said that Fannie Mae received a letter in October from Richard D. Greenfield of Philadelphia, the lawyer for the disgruntled shareholders. Subsequently, the directors established a three-man subcommittee to investigate the matter, he said.

Maxwell said that the subcommittee is expected to report back to the full board in June. While Maxwell said he is unaware of the progress of the investigation, he added that he is personally satisfied that "there had been no neglect of duty" among Fannie Mae officers responsible for buying the loans.

"They were bought in the normal course of business," Maxwell said. The fees and return earned from the loans were "appropriate to cover the risk," he added.

But Greenfield said that his clients are considering bringing a lawsuit against the board for allowing the purchase of the EPIC loans. Greenfield previously brought a lawsuit against PSFS, the Philadelphia thrift that bought more than $200 million worth of EPIC loans.

"It was a glorified Ponzi scheme, and nothing more," Greenfield said of the EPIC real estate empire, whose collapse precipitated a crisis in the mortgage finance markets.

"It is one thing if you or I as an individual want to speculate for a high return. It is another thing for a presumably conservative financial institution to take that risk," he said. "It is a breach of fiduciary duty to permit that kind of investment."

Fannie Mae was one of 140 financial institutions that lent a combined $1.4 billion to the EPIC partnerships. A federal bankruptcy court last month approved a plan to pay off these creditors from proceeds of the sale of houses owned by the EPIC partnerships.

Maxwell, who served as chairman of a committee of investors instrumental in drawing up the EPIC reorganization plan, told shareholders yesterday that the company would lose none of the principal of its loans as a result of adopting this plan.

But during the meeting, he was asked by Greenfield whether Fannie Mae would suffer any other losses, such as from lost interest income. After consulting with Fannie Mae's general counsel, Caryl S. Bernstein, Maxwell declined to answer the question.

"I guess you'll have to take my deposition to find out," Maxwell said during a sharp exchange with Greenfield. He added that Fannie Mae's shareholders do not need to know the exact losses right now and that "they will know in a timely manner."

After the meeting, Maxwell said the EPIC losses would be "minimal," although he did not specify the exact amount. He said EPIC missed interest payments for six months on the mortgages, which on average paid a 13 percent interest rate. This would amount to lost income of about $6 million to $7 million.

But Maxwell said that the $102 million worth of EPIC loans on Fannie Mae's books were a "pittance" compared to the company's overall $95 billion portfolio of mortgages.

"We purchase that much every day," Maxwell added. Wall Street analysts agreed with his upbeat assessment of the EPIC situation.

"We're talking peanuts -- even if the whole loans went bad," said Thomas D. Klingenstein, who follows Fannie Mae for Wertheim & Co.