We implement a gradient-based simulation optimization approach, the Simultaneous Perturbation Stochastic Approximation (SPSA) algorithm, to estimate clearing functions (CFs) that describe the expected output of a production resource as a function of its expected workload from empirical data. Instead of trying to optimize the fit of the CF to the data, we seek values of the CF parameters that optimize the expected performance for the system when the fitted CFs are used to develop release schedules. A simulation model of a scaled-down wafer fabrication facility is used to generate the data and evaluate the performance of the CFs obtained from the SPSA. We show that SPSA significantly improves the production plan by either searching for better CF parameters or by directly optimizing releases.