The optical and electrical properties of dysprosium and ytterbium monophosphides