Skip to content

Instantly share code, notes, and snippets.

@certik
Created March 17, 2011 06:09
Show Gist options
  • Save certik/873912 to your computer and use it in GitHub Desktop.
Save certik/873912 to your computer and use it in GitHub Desktop.
from numpy import loadtxt, log, abs, sign, exp
from scipy import polyfit
from pylab import plot, show
a = loadtxt("a.txt")
E = a[:, 0]
rt = a[:, 2]
E_f = E[-1]
E = E[:-1]
rt = rt[:-1]
S = sign(E - E_f)
x = rt
y = log(abs(E-E_f))
a, b = polyfit(x, y, 1)
E_est = E - S * exp(a*rt + b)
for c, d in zip(E, E_est):
print c, d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment