I want to plot a Normal versus a Log-Normal function using following code:
from scipy.stats import norm, lognorm
import numpy as np
import matplotlib.pyplot as plt
# example: r(t) = ln(1 + R(t)) ~ N(0.05, (0.5)^2))
# 1 + R(t) = exp(r(t)) ~ logNormal(0.05, (0.5)^2)
# R(t) = e(r(t)) - 1 ~ logNormal(0.05, (0.5)^2) - 1
#
# plot normal and log normal density
mu = .05
sd = .5
x = np.linspace(mu - 3 * sd, mu + 3 * sd, 100)
plt.plot(x, norm.pdf(x, mu, sd), label="Normal")
plt.plot(exp(x)-1, lognorm.pdf(exp(x), mu, sd), '--', label="Log-Normal")
What is wrong ? I expect something like: 
The order of parameters in the lognorm.pdf function is not what you think!
When you reverse the order to:
lognorm.pdf(exp(x), sd, mu), you get the plot you were expecting.EDIT: The documentation gives
pdf(x, s, loc=0, scale=1)