In [1]:
%matplotlib inline
from pylab import*
In [2]:
import os
import numpy as np
In [3]:
from cvfit import data
from cvfit.equations import GHK
from cvfit.fitting import SingleFitSession
In [4]:
filename = "./Example/Example.xlsx"
set0 = data.read_sets_from_Excel(filename, 2, 0, 3)[0]
print("Loaded: " + os.path.split(str(filename))[1])
print (str(set0))
In [5]:
equation = GHK('GHK', pars=np.array([1.0, 150.0, 145.0, 5.0]))
fsession = SingleFitSession(set0, equation)
In [6]:
fsession.fit()
fsession.calculate_errors()
print(fsession.string_estimates())
print(fsession.string_liklimits())
In [7]:
plX, plY = equation.calculate_plot(set0.X, equation.pars)
rlim = fsession.Llimits[0]
plX1, plY1 = equation.calculate_plot(set0.X, [rlim[0], 150.0, 145.0, 5.0])
plX2, plY2 = equation.calculate_plot(set0.X, [rlim[1], 150.0, 145.0, 5.0])
set0.average_pooled()
In [8]:
plot(set0.X, set0.Y, 'ro') # all data points
errorbar(set0.avX, set0.avY, yerr=set0.avS, fmt='o')
plot(plX, plY, 'b-') # fit
plot(plX1, plY1, 'k--') # lower likelihood limit
plot(plX2, plY2, 'k--') # higher likelihood limit
xlabel('Kout, mM')
ylabel('Erev, mV');
In [ ]: