Magnetic properties of nanocomposite and bulk rare earth titanates Ho2Ti2O7 and Yb2Ti2O7