Randgold Resources' share price was given a lift on Monday by analysts at UBS who upgraded the stock from 'neutral' to 'buy' after a recent slump in the value of the gold miner.The bank said that it still prefers precious metals peer Fresnillo over Randgold, but reckons that the risk/reward balance at the latter is now "attractive at current levels".The stock has fallen by around 20% over the past three months, UBS said, which is more or less in line with other European gold stocks (-17%) and global gold indices.However, the bank believes that Randgold still remains the "best-managed and highest quality gold stock in our European coverage universe". As such, it thinks the stock should trade at a premium to others in the sector."After share price weakness, valuation metrics look less expensive; we believe RRS offers high quality/low cost exposure to gold price upside, medium-term [dividend] growth and long-term value accretive growth potential from their exploration portfolio," UBS said.Ahead of the miner's third-quarter results on 6 November, the bank said that the ramp-up of production at the Kilbali mine in the second half will be key for the company to achieve full-year guidance. However, even though there is potential for Kibali to disappoint, this could be offset by better performances at Loulo and Gounkoto.For the third quarter, UBS expects the group to produce 300,000 ounces of gold.