sigma_sq

Convenience functions for optimizing the sigma_sq parameter of MuyGPS objects.

Currently only supports an analytic approximation, but will support other methods in the future.

MuyGPyS.optimize.sigma_sq.mmuygps_analytic_sigma_sq_optim(mmuygps, pairwise_diffs, nn_targets)[source]

Optimize the value of the \(\sigma^2\) scale parameter for each response dimension.

We approximate \(\sigma^2\) by way of averaging over the analytic solution from each local kernel.

\[\sigma^2 = \frac{1}{bk} * \sum_{i \in B} Y_{nn_i}^T K_{nn_i}^{-1} Y_{nn_i}\]

Here \(Y_{nn_i}\) and \(K_{nn_i}\) are the target and kernel matrices with respect to the nearest neighbor set in scope, where \(k\) is the number of nearest neighbors and \(b = |B|\) is the number of batch elements considered.

Parameters:
  • muygps – The model to be optimized.

  • pairwise_diffs (ndarray) – A tensor of shape (batch_count, nn_count, nn_count, feature_count) containing the (nn_count, nn_count, feature_count)-shaped pairwise nearest neighbor difference tensors corresponding to each of the batch elements.

  • nn_targets (ndarray) – Tensor of floats of shape (batch_count, nn_count, response_count) containing the expected response for each nearest neighbor of each batch element.

Return type:

MultivariateMuyGPS

Returns:

A new MuyGPs model whose sigma_sq parameter has been optimized.

MuyGPyS.optimize.sigma_sq.mmuygps_sigma_sq_optim(mmuygps, pairwise_diffs, nn_targets, sigma_method='analytic')[source]

Optimize the value of the \(\sigma^2\) scale parameter for each response dimension of a MultivariateMuyGPS object.

The optimization to be applied depends upon the value of sigma_method.

Parameters:
  • mmuygps (MultivariateMuyGPS) – The model to be optimized.

  • pairwise_diffs (ndarray) – A tensor of shape (batch_count, nn_count, nn_count, feature_count) containing the (nn_count, nn_count, feature_count)-shaped pairwise nearest neighbor difference tensors corresponding to each of the batch elements.

  • nn_targets (ndarray) – Tensor of floats of shape (batch_count, nn_count, response_count) containing the expected response for each nearest neighbor of each batch element.

  • sigma_method (Optional[str]) – The optimization method to apply. Currently only supports "analytic" and None.

Return type:

MultivariateMuyGPS

Returns:

A new MultivariateMuyGPs model whose sigma_sq parameter has been optimized.

MuyGPyS.optimize.sigma_sq.muygps_analytic_sigma_sq_optim(muygps, pairwise_diffs, nn_targets)[source]

Optimize the value of the \(\sigma^2\) scale parameter for each response dimension.

We approximate \(\sigma^2\) by way of averaging over the analytic solution from each local kernel.

\[\sigma^2 = \frac{1}{bk} * \sum_{i \in B} Y_{nn_i}^T K_{nn_i}^{-1} Y_{nn_i}\]

Here \(Y_{nn_i}\) and \(K_{nn_i}\) are the target and kernel matrices with respect to the nearest neighbor set in scope, where \(k\) is the number of nearest neighbors and \(b = |B|\) is the number of batch elements considered.

Parameters:
  • muygps (MuyGPS) – The model to be optimized.

  • pairwise_diffs (ndarray) – A tensor of shape (batch_count, nn_count, nn_count, feature_count) containing the (nn_count, nn_count, feature_count)-shaped pairwise nearest neighbor difference tensors corresponding to each of the batch elements.

  • nn_targets (ndarray) – Tensor of floats of shape (batch_count, nn_count, response_count) containing the expected response for each nearest neighbor of each batch element.

Return type:

MuyGPS

Returns:

A new MuyGPs model whose sigma_sq parameter has been optimized.

MuyGPyS.optimize.sigma_sq.muygps_sigma_sq_optim(muygps, pairwise_diffs, nn_targets, sigma_method='analytic')[source]

Optimize the value of the \(\sigma^2\) scale parameter for each response dimension.

The optimization to be applied depends upon the value of sigma_method.

Parameters:
  • muygps (MuyGPS) – The model to be optimized.

  • pairwise_diffs (ndarray) – A tensor of shape (batch_count, nn_count, nn_count, feature_count) containing the (nn_count, nn_count, feature_count)-shaped pairwise nearest neighbor difference tensors corresponding to each of the batch elements.

  • nn_targets (ndarray) – Tensor of floats of shape (batch_count, nn_count, response_count) containing the expected response for each nearest neighbor of each batch element.

  • sigma_method (Optional[str]) – The optimization method to apply. Currently only supports "analytic" and None.

Return type:

MuyGPS

Returns:

A new MuyGPs model whose sigma_sq parameter has been optimized.