You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Whenever I pass in my distribution into the function that calculates the lognormal pdf I get the following error:
def lognormal_pdf(x, sigma, mu):
'''
Function will create the lognormal probability density function of the given
x values (x) based on the average and standard deviation provided through the
sigma and mu arguments
----------------------------------------------------------------------------
x:
sigma:
mu:
'''
pdf_values = (1/(x*sigma*np.sqrt(x*np.pi)))*np.exp(-1 * (((np.log(x)-mu)**2)/(2*sigma**2)))
#create a list of evenly spaced numbers between 0 and 150,000
income_range = np.linspace(0,150000,200)
#pass the income_range variable into the lognormal_pdf() function to get the
#log normal disribution of incomes based on the sigma = .5 and mu = 11
sigma = .5
mu = 11
lognormal_pdf(income_range, sigma, mu)
output:
/Users/thomascurran/anaconda/lib/python3.6/site-packages/ipykernel_launcher.py:17: RuntimeWarning: divide by zero encountered in true_divide
/Users/thomascurran/anaconda/lib/python3.6/site-packages/ipykernel_launcher.py:17: RuntimeWarning: divide by zero encountered in log
/Users/thomascurran/anaconda/lib/python3.6/site-packages/ipykernel_launcher.py:17: RuntimeWarning: invalid value encountered in multiply
do I need to include the prob_notcut variable like the lognormal function as in the MLE notebook from class?
The text was updated successfully, but these errors were encountered:
Whenever I pass in my distribution into the function that calculates the lognormal pdf I get the following error:
output:
do I need to include the
prob_notcut
variable like the lognormal function as in the MLE notebook from class?The text was updated successfully, but these errors were encountered: