Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = .1; s = .4
- sg = sqrt(log(1 + s^2/m^2)); sg
- ## 1.683215
- mu = log(m) - .5*sg^2; mu
- ## -3.719192
- x = rnorm(10^6, mu, sg); y = exp(x)
- mean(x); sd(x)
- ## -3.720081
- ## 1.682534
- mean(y); sd(y)
- ## 0.09942132
- ## 0.4097221
- m = .1; s = .2
- mu = log(m^2/sqrt(s^2 + m^2)); mu
- ## -3.107304
- sg = sqrt(log(1+s^2/m^2)); sg
- ## 1.268636
- x = rnorm(10^6, mu, sg)
- mean(x); sd(x)
- ## -3.107111
- ## 1.269737
- y = exp(x)
- mean(y); sd(y)
- ## 0.1000590
- ## 0.1992975
- y = rlnorm(10^6, -11.4511, 3.0144); mean(y); sd(y) # Your values
- ## 0.0009537684
- ## 0.03262853 # not right
- y = rlnorm(10^6, -3.107304, 1.268636); mean(y); sd(y) # m=.1, s=.2
- ## 0.1003433
- ## 0.2027905
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement