The fixed-time solutions may not be optimal, and therefore time-variations of the harmonics must be considered in the optimum harmonic filters design. The probabilistic modeling of current and voltage harmonics as an accurate estimation of power system harmonic behavior has become an important indicator for customers and suppliers alike. This patent presents an application of the probabilistic approach based mean value estimation of source and load characteristics, which is enabled by sampling measurements and statistical analysis performed on an electrical plant, which allow appropriate calculation of optimal harmonic filters parameters considering voltage harmonics and source impedance as randomly time-varying quantities. The optimization also considers practical constraints such as load power factor and total voltage harmonic distortion limitations. Also, this patent includes different optimization criteria. Finally, the effectiveness and robustness of the proposed harmonic filters are validated by means of three case studies, including a detailed comparison of the different objectives presented in this patent.