Permalink
Browse files

Changes to exponential.

  • Loading branch information...
1 parent ba64e61 commit df719ed18cce9322b97f275a5c2dbf087214fe88 @matthewbellis matthewbellis committed Jun 30, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 lichen/pdfs.py
View
@@ -9,15 +9,19 @@
################################################################################
def exp(x,slope,xlo,xhi,num_int_points=1000):
- exp_func = stats.expon(loc=0.0,scale=slope)
+ #exp_func = stats.expon(loc=0.0,scale=slope)
+ exp_func = stats.expon(loc=0.0,scale=1.0)
xnorm = np.linspace(xlo,xhi,num_int_points)
- ynorm = exp_func.pdf(xnorm)
+ #ynorm = exp_func.pdf(slope*xnorm)
+ ynorm = np.exp(-slope*xnorm)
normalization = integrate.simps(ynorm,x=xnorm)
+ #normalization = (exp_func.pdf(xlo)-exp_func.pdf(xhi))
#normalization = 1.0
#print "pdfs normalization: ",normalization
- y = exp_func.pdf(x)/normalization
+ #y = exp_func.pdf(slope*x)/normalization
+ y = np.exp(-slope*x)/normalization
return y

0 comments on commit df719ed

Please sign in to comment.