  This paper is an initial stage of consideration of the general problem of
joint modeling of the vertical structure of a Galactic flat subsystem and the
average surface of the disk of the Galaxy, taking into account the natural and
measurement dispersions. We approximate the average surface of the Galactic
disk with a polynomial model and determine its parameters by minimizing the
squared deviations of objects along the normal to the model surface. The
developed method allows us to simultaneously identify significant details of
the Galactic warping and estimate the offset $z_\odot$ of the Sun relative to
the average (non-flat) surface of the Galactic disk and the vertical scale of
the object system for an arbitrary area of the disk covered by data. The method
is applied to data on classical Cepheids. Significant local extremes of the
average disk surface model were found: the minimum in the first Galactic
quadrant and the maximum in the second. A well-known warp in the third quadrant
has been confirmed. The optimal order of the model was found to be
$n_\text{o}=4$. The local (near the Sun, $n_\text{o}=0$) estimate of $z_\odot =
28.1 \pm \left.6.1\right|_{\text{stat.}}\left.{}\pm1.3\right|_{\text{cal.}}$ pc
is close to the non-local ($n_\text{o}=4$) $z_\odot = 27.1 \pm
\left.8.8\right|_{\text{stat.}}\left.{}^{+1.3}_{-1.2}\right|_{\text{cal.}}$ pc,
which suggests that the proposed method eliminates the influence of warping on
the $z_\odot$ estimate. However, the non-local estimate of the vertical
standard deviation of Cepheids $\sigma_{\rho} = 132.0 \pm
\left.3.7\right|_{\text{stat.}}\left.{}^{+6.3}_{-5.9}\right|_{\text{cal.}}$ pc
differs significantly from the local $\sigma_{\rho} = \left.76.5 \pm
4.4\right|_{\text{stat.}}\left.{}^{+3.6}_{-3.4}\right|_{\text{cal.}}$ pc, which
means the need to introduce more complex models outside the Sun's vicinity.
