  An algorithm has been developed for finding the global minimum of a
multidimensional error function by fitting model spectral maps into observed
ones. Principal component analysis is applied to reduce the dimensionality of
the model and the coupling degree between the parameters, and to determine the
region of the minimum. The k-nearest neighbors method is used to calculate the
optimal parameter values. The algorithm is used to estimate the physical
parameters of the contracting dense star-forming core of L1287. Maps in the
HCO+(1-0), H13CO+(1-0), HCN(1-0), and H13CN(1-0) lines, calculated within a 1D
microturbulent model, are fitted into the observed ones. Estimates are obtained
for the physical parameters of the core, including the radial profiles of
density ($\propto r^{-1.7}$), turbulent velocity ($\propto r^{-0.4}$), and
contraction velocity ($\propto r^{-0.1}$). Confidence intervals are calculated
for the parameter values. The power-law index of the contraction-velocity
radial profile, considering the determination error, is lower in absolute terms
than the expected one in the case of gas collapse onto the protostar in free
fall. This result can serve as an argument in favor of a global contraction
model for the L1287 core.
