gold ends higher, logs biggest weekly gain since 2016