Skip to content

Commit

Permalink
Updated docstrings in utility functions
Browse files Browse the repository at this point in the history
  • Loading branch information
williamjameshandley committed Jan 16, 2023
1 parent 1a958dd commit c2decc7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion anesthetic/examples/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ def random_ellipsoid(mean, cov, size=None):
cov: 2d array-like
The covariance structure of the ellipsoid. Axes have lengths equal to
the square root of the eigenvalues of this matrix.
Returns
-------
points: array-like
Points drawn uniformly from the ellipsoid.
shape (*size, len(mean)).
"""
"""Generate samples uniformly from the ellipsoid."""
d = len(mean)
L = np.linalg.cholesky(cov)
x = np.random.multivariate_normal(np.zeros(d), np.eye(d), size=size)
Expand All @@ -37,6 +42,11 @@ def random_covariance(sigmas):
----------
sigmas, 1d array like
Lengths of the axes of the ellipsoid.
Returns
-------
Covariance matrix: 2d np.array
shape (len(sigmas, len(sigmas)).
"""
d = len(sigmas)
R = special_ortho_group.rvs(d)
Expand Down

0 comments on commit c2decc7

Please sign in to comment.