Created
August 6, 2021 04:13
-
-
Save mtmoses/3949a7fe455df981777a928f7e400424 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def lognormal_cascade(k, v,ln_lambda, ln_theta): | |
k = k - 1 | |
m0 = np.random.lognormal(ln_lambda,ln_theta) | |
m1 = np.random.lognormal(ln_lambda,ln_theta) | |
M = [m0, m1] | |
if (k >= 0): | |
d=[0 for x in range(0,2)] | |
for i in range(0,2): | |
d[i] = lognormal_cascade(k, (M[i]*v), ln_lambda, ln_theta) | |
v = d | |
return v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment