Skip to content

Instantly share code, notes, and snippets.

View karakfa's full-sized avatar
💭
lurking...

Fatih Karakurt karakfa

💭
lurking...
View GitHub Profile
@karakfa
karakfa / cov2corr.py
Created September 17, 2018 21:04
cov2corr
# extract correlation matrix from covariance matrix
def cov2corr(cov):
d = np.diagonal(cov)
s = np.reciprocal(np.sqrt(d))
return np.multiply(s,np.multiply(s,cov).T)
-- Knuth's way
-- from the blog post http://videlalvaro.github.io/2016/10/knuth-first-erlang-programmer.html
gcd m n = f m n 0 1
where f m n r 1 = f m n (mod m n) 2
f m n 0 2 = n
f m n r 2 = f n r r 1
@karakfa
karakfa / ExponentialDistribution.ipynb
Created October 21, 2015 20:35
exponential distribution
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.