Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Homework Help
Calculus and Beyond Homework Help
Bernoulli and Bayesian probabilities
Reply to thread
Message
[QUOTE="hdp12, post: 6445919, member: 514926"] [B]Summary::[/B] Hello there, I'm a mechanical engineer pursuing my graduate degree and I'm taking a class on machine learning. Coding is a skill of mine, but statistics is not... anyway, I have a homework problem on Bernoulli and Bayesian probabilities. I believe I've done the first few parts correctly, but the final question asks me to explain why one is more accurate than another, and the inverse as well. I am not sure, so I figured I'd reach out here and ask. The work and appropriate equations are below: [B]1. (10 pts) Consider 20 values randomly sampled from the Bernoulli Distribution with parameter :[/B] [CODE=matlab] x = [1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1]; N = length(x); [/CODE] [B] (a) Estimate the parameter using the maximum likelihood approach and the 20 data values.[/B] [CODE=matlab] u = sum(x==1)/N; % u = 0.75 bern = (u.^x).*(1-u).^(1-x) p = 0; for n = 1:N pTemp = x(n)*log(u) + (1-x(n))*log(1-u); p = p+pTemp; end %ln(a) = b <--> a = e^b p = exp(p); % p = 1.3050e-05 [/CODE] [B](b) Estimate the parameter using the Bayesian approach. Use the beta distribution Beta(a=8, b=4).[/B] [CODE=matlab] % a + sum(xn),b + N - sum(xn) % (8 + 15 - 1) / (12 + 20 - 2) = 22/30 u = 22/30; % u = 0.7333 [/CODE] [B](c) Estimate the parameter using the Bayesian approach. Use the beta distribution Beta(a=4, b=8).[/B] [CODE=matlab] % (4 + 15 - 1) / (12 + 20 - 2) = 18/30 u = 18/30; % u = 0.6 [/CODE] [B](d) Discuss why the estimation from (b) is more accurate than that from (a) and why the estimation from (c) is worse than that from (a).[/B] [CODE=matlab] uA = 0.75; uB = 0.7333; uC = 0.6; [/CODE] [ATTACH type="full" alt="1610979062961.png"]276415[/ATTACH] [ATTACH type="full" alt="1610979089554.png"]276416[/ATTACH] Thanks in advance for any help! [/QUOTE]
Insert quotes…
Post reply
Forums
Homework Help
Calculus and Beyond Homework Help
Bernoulli and Bayesian probabilities
Back
Top