Nonconvex optimization with applications to machine learning and signal recovery