projnormal.formulas.projected_normal_c.moments
Approximation to the moments of the general projected normal distribution with additive const term in denominator.
Functions
|
Compute the mean of \(y = x/\sqrt{x^T x + c}\), where \(x \sim \mathcal{N}(\mu_x, \Sigma_x)\) and \(c\) is a positive constant. |
|
Compute the second moment matrix of \(y = x/\sqrt{x^T x + c}\), where \(x \sim \mathcal{N}(\mu_x, \Sigma_x)\) and \(c\) is a positive constant. |
- mean(mean_x, covariance_x, const=0)
Compute the mean of \(y = x/\sqrt{x^T x + c}\), where \(x \sim \mathcal{N}(\mu_x, \Sigma_x)\) and \(c\) is a positive constant. Uses a Taylor approximation.
- 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).const (
torch.Tensor) – Constant added to the denominator. Shape is().
- Returns:
Expected value for the projected normal on ellipse. Shape is
(n_dim,).- Return type:
torch.Tensor
- second_moment(mean_x, covariance_x, const)
Compute the second moment matrix of \(y = x/\sqrt{x^T x + c}\), where \(x \sim \mathcal{N}(\mu_x, \Sigma_x)\) and \(c\) is a positive constant. Uses a Taylor approximation.
- 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).const (
torch.Tensor) – Constant added to the denominator. Shape is().
- Returns:
Second moment matrix of \(y\). Shape is
(n_dim, n_dim).- Return type:
torch.Tensor