Skip to content

Instantly share code, notes, and snippets.

@riccardoscalco
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riccardoscalco/81820c43e42307806faf to your computer and use it in GitHub Desktop.
Save riccardoscalco/81820c43e42307806faf to your computer and use it in GitHub Desktop.
Mean life time

Mean life time

Let say you have a process that decays exponentially, with constant lamb

>>> t = [..] #list of times
>>> x = [x0 * math.exp(-t[i]/lamb) for i in range(n)]

Constant lamb can be derived from vector x

>>> lamb = 1/N * sum([t[i]/math.log(x0/x[i])for i in range(n)])
>>> tau = 1/lamb = T/math.log(2) # T is the mean life time 

Written with StackEdit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment