ENH : add inverse with diagnoise for testing