Ejemplo n.º 1
0
def ch3bothdirs(tau01=2., tau12=4., nchannels=5):
    E = HME([])
    E.append(
        hmEnsemble.ch3Ensemble(V0=-65,
                               V1=20,
                               tau01=tau01,
                               tau12=tau12,
                               nchannels=nchannels))
    E.append(
        hmEnsemble.ch3Ensemble(V0=20,
                               V1=-65,
                               tau01=tau01,
                               tau12=tau12,
                               nchannels=nchannels))
    return E
Ejemplo n.º 2
0
def fig(seeds=[0], x=[2., 4.], y=[2., 4.], nc0=5, nc1=5):
    M0 = hmEnsemble.ch3Ensemble(tau01=2, tau12=4, nchannels=nc0)
    M0.sim(seeds=seeds)
    L = []
    G = []
    for tau01 in x:
        L.append([])
        G.append([])
        for tau12 in y:
            M1 = hmEnsemble.ch3Ensemble(tau01=tau01,
                                        tau12=tau12,
                                        nchannels=nc1)
            L[-1].append(M1.likelihood(M0.simData))
            G[-1].append((tau01, tau12))
    return (L, G)
Ejemplo n.º 3
0
def ch3mix():
    E = HME([])
    E.append(
        hmEnsemble.ch3Ensemble(tau01=tau01,
                               tau12=tau12,
                               V0=-25.,
                               V1=-20.,
                               Vchar01=15.,
                               Vchar12=15.,
                               nchannels=nchannels))
    return E
Ejemplo n.º 4
0
def ch3up(tau01=2., tau12=4., nchannels=5, Vchar01=1., Vchar12=1.):
    E = HME([])
    E.append(
        hmEnsemble.ch3Ensemble(V0=-65,
                               V1=20,
                               tau01=tau01,
                               tau12=tau12,
                               Vchar01=Vchar01,
                               Vchar12=Vchar12,
                               nchannels=nchannels))
    return E
Ejemplo n.º 5
0
 def ch3like(self, tau01, tau12, N):
     M_assumed = hmEnsemble.ch3Ensemble(V0=self.V0,
                                        V1=self.V1,
                                        tau01=tau01,
                                        tau12=tau12,
                                        nchannels=N)
     #try:
     L = M_assumed.likelihood(self.M_true.simData)
     #except:
     #print "Out of range: tau01", tau01, "tau12", tau12
     #L = numpy.nan
     return L
Ejemplo n.º 6
0
 def __init__(self, V0=-65, V1=20, tau01=2., tau12=4., N=5):
     self.V0 = V0
     self.V1 = V1
     self.tau01_true = tau01
     self.tau12_true = tau12
     self.N_true = N
     self.M_true = hmEnsemble.ch3Ensemble(V0=V0,
                                          V1=V1,
                                          tau01=tau01,
                                          tau12=tau12,
                                          nchannels=N)
     self.ml = None
Ejemplo n.º 7
0
def ch3like4opt(param, V0, V1, N, Data):
    tau01 = abs(param[0])
    tau12 = abs(param[1])
    M_assumed = hmEnsemble.ch3Ensemble(V0=V0,
                                       V1=V1,
                                       tau01=tau01,
                                       tau12=tau12,
                                       nchannels=N)
    try:
        L = M_assumed.likelihood(Data)
    except:
        print "Out of range: tau01", p[0], "tau12", p[1]
        L = numpy.nan
    return -L
Ejemplo n.º 8
0
def hybridprotocol(tau01=2., tau12=4., nchannels=5):
    E = HME([])
    E.append(
        hmEnsemble.ch3EnsemChain(tau01=tau01, tau12=tau12,
                                 nchannels=nchannels))
    E.append(
        hmEnsemble.ch3Ensemble(tau01=tau01,
                               tau12=tau12,
                               V0=-25.,
                               V1=-20.,
                               Vchar01=15.,
                               Vchar12=15.,
                               nchannels=nchannels))
    return E