Density functional calculations for 4f-electron systems: Hopping matrix elements for the Anderson model