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

Implement "Law of total expectation/variance" in UPArrays #12

Open
JohnGoertz opened this issue Feb 3, 2022 · 0 comments
Open

Implement "Law of total expectation/variance" in UPArrays #12

JohnGoertz opened this issue Feb 3, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@JohnGoertz
Copy link
Owner

Given a list of UPArrays, y_upas, we can find total expectation/variance as:

μs = np.stack([y.μ for y in y_upas])
σ2s = np.stack([y.σ2 for y in y_upas])

total_upa = gmb.uparray('y',
                        μ = μs.mean(0),
                        σ2 = μs.var(0) + σ2s.mean(0),
                        stdzr=stdzr
                       )

Implement as something like

gmb.uparray.total(y_upas)

Where name and stdzr are inferred from, e.g., the first upa in the list.

@JohnGoertz JohnGoertz added enhancement New feature or request good first issue Good for newcomers labels Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant