Differentially private inference via noisy optimization