class_docstr: Posterior class for a Higher order Gaussian process model [Zhe2019hogp]_. Extends
  the standard GPyTorch posterior class by overwriting the rsample method.
  The posterior variance is handled internally by the HigherOrderGP model.
  HOGP is a tensorized GP model so the posterior covariance grows to be extremely
  large, but is highly structured, which means that we can exploit Kronecker
  identities to sample from the posterior using Matheron's rule as described in
  [Doucet2010sampl]_.
  
  In general, this posterior should ONLY be used for HOGP models
  that have highly structured covariances. It should also only be used internally when
  called from the HigherOrderGP.posterior(...) method. At this time, the posterior
  does not support gradients with respect to the training data.
docstr: A Posterior for HigherOrderGP models.
  
  Args:
      distribution: Posterior multivariate normal distribution.
      joint_covariance_matrix: Joint test train covariance matrix over the entire
          tensor.
      train_train_covar: Covariance matrix of train points in the data space.
      test_train_covar: Covariance matrix of test x train points
          in the data space.
      train_targets: Training responses vectorized.
      output_shape: Shape output training responses.
      num_outputs: Batch shaping of model.
docstr_tok: ["A","Posterior","for","HigherOrderGP","models",".","Args",":","distribution",":","Posterior","multivariate","normal","distribution",".","joint_covariance_matrix",":","Joint","test","train","covariance","matrix","over","the","entire","tensor",".","train_train_covar",":","Covariance","matrix","of","train","points","in","the","data","space",".","test_train_covar",":","Covariance","matrix","of","test","x","train","points","in","the","data","space",".","train_targets",":","Training","responses","vectorized",".","output_shape",":","Shape","output","training","responses",".","num_outputs",":","Batch","shaping","of","model","."]
code: def __init__(
      self,
      distribution: MultivariateNormal,
      joint_covariance_matrix: LinearOperator,
      train_train_covar: LinearOperator,
      test_train_covar: LinearOperator,
      train_targets: Tensor,
      output_shape: torch.Size,
      num_outputs: int,
  ) -> None:
      r"""A Posterior for HigherOrderGP models.
  
      Args:
          distribution: Posterior multivariate normal distribution.
          joint_covariance_matrix: Joint test train covariance matrix over the entire
              tensor.
          train_train_covar: Covariance matrix of train points in the data space.
          test_train_covar: Covariance matrix of test x train points
              in the data space.
          train_targets: Training responses vectorized.
          output_shape: Shape output training responses.
          num_outputs: Batch shaping of model.
      """
      super().__init__(distribution=distribution)
      self.joint_covariance_matrix = joint_covariance_matrix
      self.train_train_covar = train_train_covar
      self.test_train_covar = test_train_covar
      self.train_targets = train_targets
      self.output_shape = output_shape
      self._is_mt = True
      self.num_outputs = num_outputs
  
file_path: botorch/botorch/posteriors/higher_order.py
imports: from typing import Optional, Tuple
  import torch
  from botorch.exceptions.errors import BotorchTensorDimensionError
  from botorch.posteriors.gpytorch import GPyTorchPosterior
  from gpytorch.distributions import MultivariateNormal
  from linear_operator.operators import LinearOperator
  from torch import Tensor
label_desc: Use image node_id 1 to create a new HigherOrderGPPosterior object from inherited base classes: GPyTorchPosterior with example: obj = HigherOrderGPPosterior(distribution, joint_covariance_matrix, train_train_covar, test_train_covar, train_targets, output_shape, num_outputs)