Yield Estimation and Optimization of Electromagnetic Devices