projnormal.formulas.projected_normal_B.probability

Probability density function (PDF) for the general projected normal distribution.

Functions

log_pdf(mean_x, covariance_x, y[, B])

Compute the log-pdf at points y for the distribution of the variable \(y = x/\sqrt{x^T B x}\), where \(x \sim \mathcal{N}(\mu_x, \Sigma_x)\) and \(B\) is a symmetric positive definite matrix.

pdf(mean_x, covariance_x, y[, B])

Compute the pdf at points y for the distribution of the variable \(y = x/\sqrt{x^T B x}\), where \(x \sim \mathcal{N}(\mu_x, \Sigma_x)\) and \(B\) is a symmetric positive definite matrix.

log_pdf(mean_x, covariance_x, y, B=None)

Compute the log-pdf at points y for the distribution of the variable \(y = x/\sqrt{x^T B x}\), where \(x \sim \mathcal{N}(\mu_x, \Sigma_x)\) and \(B\) is a symmetric positive definite matrix.

Parameters:
  • mean_x (torch.Tensor) – Mean of x. Shape is (n_dim,).

  • covariance_x (torch.Tensor) – Covariance of x. Shape is (n_dim, n_dim).

  • y (torch.Tensor) – Points where to evaluate the PDF. Shape is (n_points, n_dim).

  • B (torch.Tensor, optional) – Matrix B used in the denominator of the projection. If not provided, the identity matrix is used. Shape is (n_dim, n_dim).

Returns:

Log-PDF evaluated at each y. Shape is (n_points,).

Return type:

torch.Tensor

pdf(mean_x, covariance_x, y, B=None)

Compute the pdf at points y for the distribution of the variable \(y = x/\sqrt{x^T B x}\), where \(x \sim \mathcal{N}(\mu_x, \Sigma_x)\) and \(B\) is a symmetric positive definite matrix.

Parameters:
  • mean_x (torch.Tensor) – Mean of x. Shape is (n_dim,).

  • covariance_x (torch.Tensor) – Covariance of x. Shape is (n_dim, n_dim).

  • y (torch.Tensor) – Points where to evaluate the PDF. Shape is (n_points, n_dim).

  • B (torch.Tensor, optional) – Matrix B used in the denominator of the projection. If not provided, the identity matrix is used. Shape is (n_dim, n_dim).

Returns:

PDF evaluated at each y. Shape is (n_points,).

Return type:

torch.Tensor