The quality of measuring systems of the microwave range, including vector network analyzers, largely depends on the reliability of calibration procedures and direct measurements, which allow to take into account information about the reproducible errors of measuring systems for subsequent correction. The aim of the paper is mathematical modeling of the errors of the measuring system for the generalized case for 2-n pole device.The problems of increasing the accuracy of measuring microwave systems due to compensation of systematic errors determined during calibration are considered. Calibration of measuring systems and correction of the results of direct measurements based on calibration results require the use of appropriate mathematical models of errors. Mathematical models of errors are represented in the form of multipolar errors, included between the object of measurement and the measuring system, which is assumed to be ideal, free of errors. The article proposes a generalized mathematical model of errors, described by a network of errors containing n ports connected to the n-port measuring system, and n ports connected to the n port of the measurement object. To obtain in general form the calibration equation for the 2n-port model of the error multipolar network, its transmission wave matrix [T], recorded in a cellular form, was used, and then a relationship was found between the measurement result in a matrix form with the cellular wave matrix T. A solution for finding the error matrix of matrix equation that connects the matrices known from the results of the corresponding attestation for the standards with the results of measurements during calibration in the matrix form. When solving this equation, a matrix product of «sandwich» type appears due to the cellular wave matrix [T]. The solution is possible when using the Kronecker product of two matrix, the matrix translation operator, the RS operator of the matrix, and the Gaussian elimination method. An equation is obtained for reconstructing the actual values of the scattering matrix of the measurement object, starting from the results of direct measurements in the matrix form and the error matrix. When solving the reconstruction equation, it is advisable to use a matrix inverse to the transmission matrix [T].The developed generalized mathematical model can be used, for example, when it is necessary to measure the parameters of complex microwave devices made on boards (wafer), with probe transitions to measuring ports, where it is important to consider the presence of additional microwave power leaks between ports.