NEW YORK ( TheStreet ) -- News reports have hailed a shale energy boom. Industry analysts predict that the U.S. can achieve energy independence in the next decade. But so far, the optimism has not translated into outsized gains for investors. During the past five years, energy funds lost 7.0% annually, compared to a gain of 6.9% for the S&P 500, according to Morningstar. Weakening oil prices and sluggish global demand have held back the stocks. Now some fund managers argue that the shares have become undervalued. William Riley, co-manager of Guinness Atkinson Global Energy ( GAGEX), says that energy stocks have sometimes sold at a premium to the overall market. But in recent years, the sector has traded at a discount. A basket of major oil and gas companies that Riley tracks has a price-to-earnings ratio of 10.9, vs. 16.0 for the S&P 500. The discount is wide because many investors expect oil prices to sink. "We think the size of the discount is unwarranted," Riley says. "In the emerging markets, demand for energy is pretty robust." To bet on a revival in the sector, consider a solid-performing energy fund. Sound choices include Fidelity Select Energy ( FSENX), Guinness Atkinson Global Energy, and Ivy Energy ( IEYAX). During the past five years, all three funds outdid their average peers. William Riley of Guinness Atkinson Global Energy favors natural gas producers. He says that the outlook for gas prices is improving. In recent years, prices sank as shale production increased and excess supplies plagued the markets. During the past year, companies have started reacting to market forces, reducing the number of rigs that are producing gas. At the same time that supplies have been falling, demand has grown as some big users switched from high-cost coal to cheaper gas. Gas futures recently reached $3.56 per million British thermal units, up 31% from a year ago. Riley likes Ultra Petroleum ( UPL), which produces gas in the Marcellus field of Appalachia. "They will be rewarded as the gas price continues to recover," he says. Riley also likes BP ( BP). The shares have been unloved since the Gulf oil spill made headlines in 2010. He says that the company has the resources to cover the costs of the spill.