A method and apparatus for estimating a parameter vector including a plurality of parameters of a detector response model of a photon-counting detector. The method includes calculating a modeled spectrum based on an input spectrum and an initial value of the plurality of parameters. For each detector, a difference between the normalized photon count of the measured spectrum and the normalized modeled spectrum is calculated. A root mean square error (RMSE) between the measured and modeled spectra is obtained by squaring the normalized difference and weighting the normalized difference by a weighting factor. The parameter vector is updated until an optimum RMSE value is achieved. Upon determining optimal values of the parameter vector, measured data that is obtained via a patient scan is corrected based on the optimal parameter vector.