Parametric solution to the joint system identification and optimization problem