Mining stocks have lost their mojo in recent weeks as commodity prices have stalled, rattling investors faith and sending share prices lower. But analysts at Goldman Sachs still believe, both in the sector and in London-listed Glencore (GLCNF) in particular.

"Miners are attractive on spot (prices) - we expect them to generate double digit cash flows (2017/18) and they are trading 2-3 turns below their mid-cycle multiples," the broker wrote in a note. "Our view is that even though commodity prices likely fall, the FCF generated in the meantime will lead to lower net debt which means valuations can be higher."

Goldman upgraded Glencore to 'buy' from 'neutral', handing it a price target of 390 pence ($4.76), a 20% premium to the 323.60 pence it traded on Wednesday.   

Mining stocks have been amongst the markets best performers over the past year as they have rebounded from historic lows at the start of 2016 to capitalize on deep cost cutting a late 2016 spike in commodities including coal, iron ore, zinc and nickel.

Glencore has gained 130% over the past year, and in February posted an annual profit of $1.99 billion, up 48% year-on-year. Anglo American (AAL) , also rated a 'buy' at Goldman has added 146% over the same period.

Those gains have stalled since the start of February as iron ore, coal and copper prices slid on concerns over slowing economic growth in China; due to the strong greenback, which has hurt dollar denominated commodity prices; and fears that record iron ore inventories at Chinese ports will lead to a sharp dip in demand.

Goldman shrugged off some of those concerns, claiming that demand out of China should remain "strong" as the Chinese government remains committed to supporting economic growth, while iron ore inventories have begun to de-stock without hurting the price of steel - suggesting strong end user demand. There is also the potential for growing demand for steel in other regions, boosted by stronger economic growth in Europe and hopes for the massive public works program promised by the Trump administration.

"We expect miners under our coverage to continue to generate significant free-cash-flow(2017/18E
average FCF yield of 8%/10%)," Goldman wrote. "They have fixed their balance sheets (average net debt to EBITDA on our estimates for 2017 is 0.5x) and are trading at 4.96x/5.2x 2017/18E EV/EBITDA. At spot these numbers are even more attractive - average FCF yield of 13.2%/15.5% at an EV/EBITDA of 4.7x/4.2x for 2017/18E."

On Glencore, Goldman said that the mining and commodity trading group had yet to reap the full benefit of a stronger balance sheet boosted by asset sales, and should benefit from its about 50% exposure at an earnings level to zinc and copper. Goldman said it expects prices for both metals to increase from their current spot price levels.

The broker also cited "upside risk to dividends" noting that it had promised to pay out $1 billion plus 25% of free cash flow. Goldman is tipping Glencore to pay about $0.15 per share in dividends in 2017, against an analyst consensus estimate of about $0.11.