A new knock threshold optimization method is presented based on minimization of the total misclassification error of knocking / non-knocking engine operating conditions. The procedure can be used in conjunction with any knock-event-based controller, but is illustrated on a classical knock control strategy. Initial simulations suggest that the method delivers significant performance improvements with no changes other than a retuning of the controller. However, it is not possible rigorously to evaluate controller performance based on any individual experiment or simulation time history due to the random nature of the knock process. A recently developed stochastic simulation technique is therefore used to compute and compare the statistical properties of the closed loop steady state and transient response characteristics. The results demonstrate that optimization of the knock threshold can significantly reduce the dispersion of closed loop spark angle, while also improving the ensemble mean transient performance of the controller.