projnormal.formulas.projected_normal.moments

Approximation to the moments of the general projected normal distribution.

Functions

mean(mean_x, covariance_x)

Compute the mean of \(y = x/\sqrt{x^T x}\), where \(x \sim \mathcal{N}(\mu_x, \Sigma_x)\) via Taylor approximation.

second_moment(mean_x, covariance_x)

Compute the second moment matrix of \(y = x/\sqrt{x^T x}\), where \(x \sim \mathcal{N}(\mu_x, \Sigma_x)\) via Taylor approximation.

mean(mean_x, covariance_x)

Compute the mean of \(y = x/\sqrt{x^T x}\), where \(x \sim \mathcal{N}(\mu_x, \Sigma_x)\) via Taylor approximation. (\(y\) has a projected normal distribution.).

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).

Returns:

Expected value for the projected normal. Shape is (n_dim,).

Return type:

torch.Tensor

second_moment(mean_x, covariance_x)

Compute the second moment matrix of \(y = x/\sqrt{x^T x}\), where \(x \sim \mathcal{N}(\mu_x, \Sigma_x)\) via Taylor approximation. (\(y\) has a projected normal distribution.).

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).

Returns:

Second moment matrix of \(y\). Shape is (n_dim, n_dim).

Return type:

torch.Tensor