Estimation and Inference on Nonlinear and Heterogenous Effects