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

Update Readme #54

Open
azev77 opened this issue Oct 12, 2020 · 1 comment
Open

Update Readme #54

azev77 opened this issue Oct 12, 2020 · 1 comment

Comments

@azev77
Copy link

azev77 commented Oct 12, 2020

Add using Expectations etc.
General syntax: expectation(x->f(x), Distribution(θ))

using Expectations, Distributions;
E=expectation;
const μ=0.0; const σ=1.0;
E(x->x, Normal(μ,σ))
E(x->exp(x), Normal(μ,σ))
exp+^2)/2.)
E(x->x^2, Normal(μ,σ))
E(x->x^2+exp(x), Normal(μ,σ))
#
D = [Uniform(), Normal(), Gamma()];
d = MixtureModel(D);
E.(x->x, D)
E(x->x, d)     #expectation of a mixture
( E(x->x,D[1]) + E(x->x,D[2]) + E(x->x,D[3]) )/3
#
E(x->x^2, d) #expectation of a transformation of a mixture

# truncated dist
d=truncated(LogNormal(μ,σ),0.0,5.4)
E(x->x, d)
E(x->x^2, d)
# truncated mixture
d=truncated(MixtureModel(D),0.0,5.4)
E(x->x, d)
E(x->x^2, d)

If you can agree, I can submit PR.

@arnavs
Copy link
Member

arnavs commented Oct 12, 2020

Hi @azev77, sure, I think the README should always be copy/pastable and detailed.

Thanks for your interest and looking forward to the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants