Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a 2d normal random function. #5724

Merged
merged 2 commits into from Mar 29, 2019

Conversation

Projects
None yet
3 participants
@patrick-schultz
Copy link
Collaborator

commented Mar 28, 2019

No description provided.

The covariance of a 2d normal distribution is a 2x2 symmetric matrix
[[a, b], [b, c]]. This is specified in `cov` as a length 3 array [a, b, c].
The covariance matrix must be positive semi-definite, i.e. a>0, c>0, and
a*d - c^2 > 0.

This comment has been minimized.

Copy link
@tpoterba

tpoterba Mar 28, 2019

Collaborator

a*b?

m1 = 0
m2 = 0
else:
m1 = mean[0]

This comment has been minimized.

Copy link
@tpoterba

tpoterba Mar 28, 2019

Collaborator

we'll need to wrap this in a bind so that we don't evaluate the arguments multiple times.

Something like:

if mean is None:
    mean = [0, 0]
if cov is None:
    cov = [1, 0, 1]

def f(mean, cov):
    m1 = mean[0]
    ... 

return hl.rbind(mean, cov, f)

@danking danking merged commit e14d169 into hail-is:master Mar 29, 2019

1 check passed

hail-ci-0-1 successful build
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.