Negative thermal expansion and local dynamics inCu2OandAg2O