fonnesbeck / bios8366 Goto Github PK
View Code? Open in Web Editor NEWAdvanced Statistical Computing at Vanderbilt University Medical Center's Department of Biostatistics
Home Page: http://fonnesbeck.github.io/Bios8366/
Advanced Statistical Computing at Vanderbilt University Medical Center's Department of Biostatistics
Home Page: http://fonnesbeck.github.io/Bios8366/
In the Expectation and Maximization notebook,
I am not sure, but can you check the following E-step
a = psi * (x == 0)
b = (1-psi)*poisson.pmf(x, mu)
is correct? The following can be correct.
a = (1-psi) * (x == 0)
b = psi*poisson.pmf(x, mu)
Excellent work.
And I found a typo in Section3_1-Expectation-Maximization.ipynb
-General formulation
from scipy.stats.distributions import norm
def e_step(x, mu, sigma, psi):
a = psi * norm.pdf(x, mu[0], sigma[0])
b = (1. - psi) * norm.pdf(x, mu[1], sigma[1])
return b / (a + b)
should be
def e_step(x, mu, sigma, psi):
a = (1. - psi) * norm.pdf(x, mu[0], sigma[0])
b = psi * norm.pdf(x, mu[1], sigma[1])
return b / (a + b)
Becasue m_step
output psi
of second distribution and to be consistent with formula.
The conditional function takes as input (x_new, x, y, params), there is no need to pass y in the function. By definition of conditional probability above conditional distribution, "x_new" represent "x" and "x" represent "y".
Correct implementation would be:
def conditional(x_new, x, params):
B = exponential_cov(x_new, x, params)
C = exponential_cov(x, x, params)
A = exponential_cov(x_new, x_new, params)
mu = np.linalg.inv(C).dot(B.T).T.dot(x) // y is replace by x.
sigma = A - B.dot(np.linalg.inv(C).dot(B.T))
return(mu.squeeze(), sigma.squeeze())
Moving to URLs will allow notebooks to be standalone.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.