def _krig_matrix(self, src, drift):
"""Sets up the kriging system for a configuration of source points.
"""
# the basic covariance matrix
var_matrix = self.cov_func(scipy.spatial.distance_matrix(src, src))
# the extended matrix, initialized to ones
edk_matrix = np.ones((len(src) + 2, len(src) + 2))
# adding entries for the first lagrange multiplier for the ordinary
# kriging part
edk_matrix[:-2, :-2] = var_matrix
edk_matrix[-2, -2] = 0.
# adding entries for the second lagrange multiplier for the edk part
edk_matrix[:-2, -1] = drift
edk_matrix[-1, :-2] = drift
edk_matrix[-2:, -1] = 0.
edk_matrix[-1, -2:] = 0.
return edk_matrix
评论列表
文章目录